How to deploy to sharepoint? - visual-studio

Been working some with SharePoint 2010 for a litle while and it feels like my deployment method is way to slow and way to complicated, so my question is basically..
Is there anyway for me to deploy a package to a remote sharepoint server directly from Visual studio?..
For instance.. could I some how create a connection between my visual studio project and the sharepoint server I want to deploy to and then simply press some kind of "Deploy-button" that then deploys the whole project(or even better just my changes) against the remote sharepoint-server?
Thanks in advance!

This won't be easy. Firstly there is the Deploy option which you have for every SharePoint project. This deploys the Solution (WSP) to the URL you specified under Site URL for the project. However this won't help you in your case because it only deploys to a local SharePoint Server.
There simply is no automated way to deploy to a remote server from within Visual Studio. What you are talking about actually has aspects of Continuous Integration -> Continuously wanting to deploy on each check-in.
The perfect tool for continuous integration is the Team Foundation Server. There you will have the possibility to create a deployment script (via a TFS workflow) which automatically increases the version number of your assemblies as well as deploys them to a remote SharePoint server. This usually is done via PowerShell remoting.
PowerShell is the keyword here as in the end you could create your own PowerShell deploy scripts and just call them in the Visual Studio Post-Build instead of using a full fledged TFS.

Related

Deploying Multiple Sites in Single Solution by FTP in Visual Studio Team Services / Azure DevOps

I have a Visual Studio solution which has various class libraries and several ASP.NET website projects. The website projects reference the class library projects, so for ease of working they need to be in the same solution.
The whole solution is version controlled through Visual Studio Team Services (now Azure DevOps).
When the solution is committed to VSTS, the solution is automatically built by VSTS.
I also want to use continuous integration and deploy the website projects in the solution to various web servers via FTP (FTP is the only option for this, MSDeploy etc is not available). The releases will be triggered by the build on commit.
The problem is that I need to publish the actual website files via FTP during a release triggered by the build, but the build artifact only contains .zip files.
For example, if the solution has a website project called 'MyWebsite' the build artifact has a zip called Mywebsite.zip, but no files are accessible. As such, I can deploy a zip file to the web server, but not the actual website files.
How can I deploy these files?
Furthermore, I don't want to deploy all of the files in the website project. I want to deploy a release version (similar to what is published using Visual Studio 2017's Publish tool), which the zip file seems to contain.
VSTS/Azure Dev Ops has Tasks built in to Extract Files and FTP Upload. The release pipeline also has a variables which you can access via release tasks and powershell. $(System.DefaultWorkingDirectory) is where artifacts(built code) are downloaded to. An Agent Job with two tasks should be able to accomplish what you are looking for.
Tasks
Details
Azure Dev Ops Release Variables

Visual Studio Team Services, continuous deployment and WebJobs

Has anyone managed so set up a working deploy pipeline using Visual Studio Team Services RELEASE tasks? All the info I can find seem to be based on the Nuget publishing package which takes its parameters directly from the source. I am trying to get this working in the proper release workflow with multiple environments, dev to QA to prod pipeline etc.
The tooling does not seem to be in place for that scenario - or at least, I cannot figure out any combination of parameter where the powershell publish task in VSTS actually populates the app_data folder and sets up the schedule.
Frankly I am completely stumped.
You can use "Azure Web App Deployment" task to deploy your WebJobs and use CRON expression to set up the schedule.
A similar questions for your reference: How to deploy a webjob through CI in VSO with vNext

Publish from TFS 2013 to WebSite IIS : Failed with no error

At my company, we have received Team Foundation Server 2013 and Visual Studio 2013 to manage our code and deployment.
I'm trying to make it work but I can't figure out what I miss.
So here is the scenario :
I have a Web Application with no DB for the moment.
It's added to TFS and I have checked in everything.
There is a Build Controller on TFS.
On the Web Server, Web Deploy is installed and Management Services is there and allow remote management. The services are running. I have create a website but the folder with the source is empty for now.
My objective is to build on TFS and deploy from there in one single operation with the build definition.
Here is my problem, the build is working fine and everything is put in the drop folder. But it deploy nothing on the webserver and It raised no error on the build.
I tryied two techniques for the MSBuild arguments:
1) I create a publish profile in VS, when I publish from there it works but with this argument it does nothing:
/p:DeployOnBuild=true;PublishProfile=PublishIGU
2) I use this argument :
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish
/p:MSDeployServiceURL=https://{serverWeb}:8172/msdeploy.axd
/p:DeployIISAppPath=IGUDEV /p:MsDeployPublishMethod=WMSVC
/p:AllowUntrustedCertificate=True /p:UserName=DOMAIN\user
/p:Password=XXXXX
And... it still does nothing.
I read a lot on the internet and follow tutorials but I can't figure this out.
Like I don't have any error message I don't know where to start.
Thank you if you see something that could help me.

publish vs package via tfsbuild

I am currently integrating in web deploy package publish via visual studio and tfs bulid 2010 and have some questions:
For different environments, is a Publish profile needed for each?
As part of the publish is it possible to execute a generated database against a database?
Within the publish profile is it possible to create an application pool, web site, configure it etc if it doesn't previously exist?
Re tfs build - is it possible to click a button to deploy a successful build based on a selected publish profile?
Thanks for any feedback!
I know you're trying to use webdeploy, although most enterprise architecture will use other tooling. I suggest using powershell remoting tools. This gives you the full power of the .NET framework to do database deployments using whatever tools you want.
I usually create different transforms to transform the configuration files. Depending on what environment you deploy to you can use the appropriate transform that matches your environment or manipulate the transform as desired.

How do I handle builds of Web Application Projects in VS 2012 without Web Deployment Projects?

My team uses Team City to do continuous builds and deployment of our Web Application Projects. In order to do a deployment build, we use Web Deployment Projects, which are not available in Visual Studio 2012. We aren't really using any of the advanced features of WDPs like .config transformations, but the main reason we use them is because when they build, they put only the necessary files for deployment into the build folder - in essence, removing all the .cs files and leaving only what's needed for "xcopy deployment". We then rsync the result to our test/prod environments.
So, my question is this: now that WDPs are no longer supported in Visual Studio 2012, how do I do an automated deployment build that pares down to only the files needed for deployment in VS2012?
Web Deployment Projects have been superseded by Publishing Profiles in VS2012.
They can do everything WDPs can do, with the added advantage of not needing to install additional software or create a separate .WDP project file.
Doug Rathbone has done a great blog post on migrating to Publishing Profiles from WDP:
http://www.diaryofaninja.com/blog/2012/08/26/visual-studio-2012-web-deployment-projects-are-dead-ndash-long-live-publishing-profiles
You should look into Octopus, it gives you all kind of deployment options. http://octopusdeploy.com/
Since .net 4.0 there is package and publish support in Web Application Projects out of the box. All you need is call msbuild /t:Package - it will do all the stuff.
I recommend to read this tutorial, there is everything you need. http://www.asp.net/web-forms/tutorials/deployment/deploying-web-applications-in-enterprise-scenarios/deploying-web-applications-in-enterprise-scenarios
We use Jenkins for our CI environment combined with SVN. In VS 2012 we check in code (using Ankh) to SVN and we configure Jenkins to poll SVN every 15 minutes:
Jenkins CI
Here's a post I wrote about setting up a CI server with IIS7 and Web Deploy 2.0:
Setup CI server with IIS7 and Web Deploy 2.0

Resources