Elastic beanstalk and Visual Studio Online - deployment

Is there any way to deploy build from VSO direct to Elastic Beanstalk?
I have working build of .Net Core application and I can easy deploy it from AWS Toolkit, but don't know it is possibile from VSO.

You can use the deployment tool to automate deployments to Elastic Beanstalk.
Set up an on premise build agent
Prepare environment (e.g. install AWS Toolkit for VS)
Call awsdeploy.exe tool to deploy via Command Line build step/task (e.g. Tool: C:\Program Files (x86)\AWS Tools\Deployment Tool\awsdeploy.exe, Working folder: $(build.sourcesdirectory), Arguments: ElasticBeanstalkDeploymentSample.txt)
More information about deployment tool, you can refer to: Deploying Elastic Beanstalk Applications in .NET Using the Deployment Tool

Related

Azure Virtual Machine Scale Set Deployment: What to fill in for Deployment Script field

I created a sample project using VS2017 "ASP.NET Core Web Application" with Angular.
Then in VSTS I built using Build Template: ASP.NET Core (Build ASP.NET Core Web Application targeting .NET Core). This built successfully and in the artifact section kept the build in a .zip file.
I would like to deploy it to a scale set. So for the Release section I used "Azure Virtual Machine Scale Set Deployment" template. While filling it out there is a field "Deployment Script field" which is mandatory. Not sure what this script is used for and how do i configure in it and where to source the script from.
TL;DR:
This script deploys the content of your deployment package on the virtual machine that you're preparing. In the case of an Angular ASP.NET Core app, this means that you will have to install IIS, the .NET Core Windows Server Hosting Bundle and copy your app to IIS.
Extra info
The Azure Virtual Machine Scale Set Deployment template creates an environment with two tasks:
Build immutable machine image
Azure VMSS: update with immutable machine image
Both tasks have a bunch of fields that need to be configured. Release Management allows you to link important fields to your process. This means that these settings are all grouped under the environment and can be easily set without going through the tasks.
If you look at the following screenshot you'll see that beneath the selected Deployment script field there is a line: This field is linked to 1 setting in 'Build immutable machine image'.
If you look at the documentation for the Build immutable machine image tasks you see the following for the Deployment script:
Deployment Script: Specify the relative path to the PowerShell script (for Windows) or shell script (for Linux) that deploys the package. This script should be within the deployment package path selected above. For example, Deploy/ubuntu/deployNodejsApp.sh. The script may need to install Curl, Node.js, NGINX, and PM2; copy the application; and then configure NGINX and PM2 to run the application.
So this is the script that will automatically deploy your application to a VM. In the case of an Angular ASP.NET Core app, this means that you will have to install IIS, install the NET Core Windows Server Hosting bundle and copy your app to IIS.
I would encourage you to first create an empty Windows Server 2016 VM and experiment with creating a script that prepares the VM and installs your app. Once that's done, you can reuse this script in the Build Image task in VSTS to automate VM and image creation and use that image for your Scale Set.
UPDATE
Your VSTS Build produces an artifact. In your scenario, you are already publishing the zip file with your web application. You can configure the Publish Build Artifacts task to also publish any deployment scripts you want to use during your release. These scripts should be stored in version control. The whole artifact, including your zip file and any deployment scripts you add, is used as input to your Release Definition. The zip file contains your web app as a Web Deploy package that you need to deploy to IIS. This piece of documentation explains how to install Web Deploy and use it to deploy your app.

How deploy .NET Core web application via Visual Studio Team Services to hosting with IIS

I would like to deploy my .NET Core web application via Visual Studio Team Services to hosting with IIS.
I have tried to discover the possibility of deployment the final release but I don't know what type of task I can use.
I usually used the deploy via Visual Studio 2017 and using publish proccess with MSDeploy and setup profile like this:
<publishData>
<publishProfile
publishUrl="publishUrl"
msdeploySite="site"
destinationAppUrl="destinationAppUrl"
profileName="Default Settings"
publishMethod="MSDeploy" userName="login" />
</publishData>
This site is not running on azure but on shared asp.net hosting.
How can I setup the Visual Studio Team Services - Deploy release if I only know these information?
What type of task is necessary to use?
Since you can deploy it with publish profile, you can to do it in VSTS build/release too.
NuGet restore (2.*) or Dotnet restore task
Visual Studio Build task (MSBuild Arguments: /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:PublishProfile="[profile name]"
You can use IIS Web App Deployment Using WinRM tasks if you have admin account.
If the host supports FTP, you also can upload the published files through FTP task.

Deploy asp.net web app on local or remote IIS using PowerShell DSC

I am unable to find any help on how to use PowerShell for DSC and deploy asp.net web app on local or remote on premises IIS.
Can you please help me with the steps or any resources?
What's your preferred method of deploying code prior to using DSC? xRobocopy was created with this scenario in mind, but if you are packaging your solution using NuGet, you could also use the PackageManagement resource.
I started working on a NuGet based config script recently but it isn't ready to publish in the gallery yet:
https://github.com/Microsoft/NuGetIISAppServerConfig/blob/master/NuGetIISAppServerConfig.ps1

Azure Enable Web Deploy via automated deployment

Does anyone know of an automated way to deploy a web role to Azure with the "Enable Web Deploy" option enabled? We have an automated acceptance test process that deploys to Azure using Web Deploy to save time. But we would also like to automate the full deployment of the web role so that it could run off-hours on a less frequent basis.
We are currently using the WAPPSCmdlets module to automate full Azure deployments. However, neither this nor the newer official Azure Powershell cmdlets seem to expose a way to enable Web Deploy in new deployments.
What you'll need to do is create a startup task that does the following:
Download and install Web Deploy
Windows Azure Bootstrapper can help you to download and run the installer from a startup task.
Configure Web Deploy with PowerShell. You might want to start with this article: PowerShell scripts for automating Web Deploy setup
Running PowerShell from a startup task might seem tricky at first. If you run into trouble, take a look at this article: Azure Startup Tasks and Powershell: Lessons Learned
Keep in mind that this startup task should only run for CI deployments and not for your production deployments, so this might be something you need to take care of in your build process (you can use different Cloud projects in Visual Studio for example).

Deploy web applications and windows services using TFS 2010

Just went from TFS 2008 to 2010 at a client site and now wondering what happened to the TFSBuild.proj files from the TeamBuildTypes folder. I've already got the builds and drops working and now I need to get the old deployments working again. We used to do this with AfterBuild targets in the TFSBuild.proj. That mechanism seems to have moved or disappeared in 2010.
Can anyone point me to an article or describe how the deployment options have changed in 2010?
Specifically, I need to support running psexec to install and enable Windows Services on remote deployment targets and I need to deploy some web sites / web services to remote IIS nodes as part of the automated builds.
EDIT: Just found this: http://blogs.msdn.com/jimlamb/archive/2009/11/03/upgrading-tfs-2008-build-definitions-to-tfs-2010.aspx I'm more than a little taken back by the breaking changes between 2008 and 2010. I'm gonna need advice on how to deploy remote sites and services in the new default build process template mechanism.
Check out Vishal Joshi's PDC talk on Deploying Web Applications with VS 2010 and MSDeploy. On his blog, you'll also find tips on building MSDeploy packages with MSBuild. You can run psexec from your MSBuild script or, potentially, from a customized build process template. With TFS 2010, you can use MSBuild and Windows Workflow to solve your build automation problems.
Alternatively, you can use the "Upgrade" build process template and continue using your TFSBuild.proj file. This is the default behavior for upgraded build definitions for backwards compatibility. In that case, your build is still primarily driven by MSBuild with just a thin workflow to allocate an agent and run MSBuild.
Another option is to use TFS 2010 Build Agent on the server that you deploy to. This is how Visual Studio Lab Management deploys.
I have written a blog post about this: Continuous deployment with TFS 2010 Build Agent