Azure devops deploy .net core to AWS elastic beanstalk - azure-devops

I am using azure devops for CI/CD of a .net core application
I am doing a nuget restore/build solution test etc followed by "Publish Artifact like below". All fairly standard
I want to deploy this the AWS elastic beanstalk, and have the following task setup in Azure Devops..
I have tried a number of things but not sure how to get the .net core application deployed to aws beanstalk... The problem i believe is with the location of zip file. what should this be? - Is there anything else needed to be done? It just errors trying to created deployment bundle in the "Deploy to Elastic Beanstalk" task (btw aws connection etc is working fine)

Azure devops deploy .net core to AWS elastic beanstalk
It depends on the output of the previous dotnet publish.
You could get the info from the Deployment Bundle Type:
ASP.NET Core (Source: dotnet publish)
As you can see the source is from dotnet publish task.
Then, the output location of the next option Published Application Path should be based on previous build steps placed the deployment artifacts. It should be the path and filename of the .zip file containing the artifacts.
You can check the details info from the document:
AWS Elastic Beanstalk Deploy Application Task
Hope this helps.

Here is a full tutorial on how to do Elastic Beanstalk deployment using Azure DevOps
You can also use this PowerShell script to automate the end to end deployment instead of using Azure DevOps plugins. It gives your more flexibility on what you can do with your deployments

Related

Azure Devops deploy Yaml to OpenShift

I am Having a Yaml Deployment Config to deploy Image to OpenShift.
It contains reference to Docker Image in Artifactory.
It contains service connection and route information.
Usually I do the deployment from the OpenShift web console from Add to Project--->Import Yaml Json
Now I would like to have this done from Azure Devops pipeline.
Is there any way I could execute this Yaml file deployment from one of the task in Azure devops ?
Or if I first import this YAML from OpenShift web console is there any way further I can handle tagging of images in future releases from the Azure pipeline ?
We can install the extension OpenShift Extension, this Azure DevOps extension offers tasks for integrating OpenShift into your build and release pipelines, for example by executing user defined oc commands.
You can refer to the blog and doc for more details.
I work for Red Hat and have found there are a few ways to work Azure DevOps with OpenShift. 3 Patterns I have found OpenShift Extension, Kubernetes/Helm tasks or a self hosted agent running in a pod within openshift that has the oc tool which can help orchestrate.
I've made a video with an overview of 3 Patterns here : https://youtu.be/hMsvN7ld7E8

Deploy .NET Core Console App to Windows VM using Azure DevOps

We have a .NET Core Console App which we publish to an On Prem VM using publish feature in Visual Studio. Here is how we configure publishing to a file system.
Target location in the image is actually the folder structure of where we want our app to reside on the VM.
How can we configure the same in DevOps. I can't seem to find any good resource on this.
I have created a CI build pipeline.
You can follow below steps to deploy Console App to the On Prem VM.
1, Create a deployment agent on On-Prem VM. create a deployment group from azure devops portal. Follow the first part of this tutorial to create deployment group. Check the official document for more information about deployment group.
2, Create a release pipeline. See document here.
Setup the artifacts(you should have the publish build artifacts task in the CI build pipeline to publish the console app build artifacts to azure devops server.), and add stage for the release pipeline.
Add a deployment group job in the release stage.
see below screenshot to select the deployment group created in the first step, which contains the deployment agent on the ON-premise VM,
Add copy file task to copy the console app build artifacts to the folder on the ON-premise VM
Another workaround is to use self-hosted agent(steps are similar to above using deployment group). Check the detailed steps in this example.
Hope above helps!

Deploy Azure App Service and Webjobs using Azure Devops in .Net Framework

I have created Azure AppService and added Webjobs console application in a single solution. I'm trying to build the solution through Azure DevOps build pipeline and Deploy the package through Octopus. When I build the solution there files required for Appservice such as Web.config and Global.asax are missing from Artifacts folder. so When deploying that package is breaking the AppService.
I tried to change the MSBuild arguments while building the solution. the current MSBuild arguments are as follows:
/p:DeployOnBuild=true/p:WebPublishMethod=Package
/p:Configuration=$(BuildConfiguration) /p:OutputPath=.\bin\ /p:PackageTempRootDir="$(build.artifactstagingdirectory)\temp" /p:packageAsSingleFile=true /p:TargetProfile=Cloud
I suspect, while building the Webjobs it is removing the App Service files, so the generated package does not contain all the required files. My Build pipeline looks like below.
My Artifacts folder Creates a Nupkg file which has following files.
If the App Service is deployed alone, It is working fine,Please suggest me the way I can deploy both from single solution and one Build definition on Azure devOps.

Azure DevOps SetUp - Mulitple Project / WebJobs under Single Solution

We have about multiple Projects in a single Solution.
2 projects needs to be deployed as Azure Web App
10 projects are web jobs which needs be deployed to one of the Azure web app
Can someone guide me on how to setup the deployment pipeline for Continuous Integration.
This is one option:
Setup build pipeline so that build will produce ready to install packages. An easy way to achieve this is to use Build solution Task and add following parameters into MSBuild arguments:
/p:TransformConfigFiles=true /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:OutDir="$(build.stagingDirectory)"
(+ of course you need publish symbols path and publish artifact task which are created by default)
Now when you build your solution you should have ready to install packages (zip files).
Next we need to setup deployment pipeline. Here you should use Azure App Service Deploy task. All the other parameters except package or folder should be easy to setup if you have linked Azure subscription into Azure DevOps.In package or folder you can put: $(System.DefaultWorkingDirectory)/**/(name of the zip package you want to deploy).zip.
Web jobs don't differ from apps much, so you should be able to setup their pipelines also with above guide.
For more information about web job deployment check this Microsoft example:
https://blogs.msdn.microsoft.com/tfssetup/2016/05/18/deploying-and-schedule-azure-webjobs-from-vsts-to-azure-web-app-with-bonus-cron-scheduling/

VSTS: Release Management Deploying Artifacts to IIS on Premise

I am using VSTS Release management to deploy artifacts to IIS websites. I have several Web applications and web services to be deployed. So, i am trying to figure out what sort of tasks that best fits my situation.
I have created a build definition with Visual Studio Build Task for projects as this one:
which works fine but i need to add a task for copying the artifacts Under IIS Website Directory.
The other approach is to use IIS web deployment as a task in Release definition, so I created the build definition as:
However, it expects a Publish Profile (the build fails because it can't find it). I don't need to create a publish profile for each project in the application because this would be too much work.
Is there is a workaround for that or what is preferred approach for this?
You can update your build definition to generate a web deployment package and upload it to artifacts. And then in Release Management, add a task to run "projectname.deploy.cmd" in the deployment package to deploy it to your IIS server. Refer to this link for details: How to: Install a Deployment Package Using the deploy.cmd File Created by Visual Studio.
And you can also enable FTP Publishing on your IIS server and add a task in your release to publish the artifacts via FTP. You may need this task:
FTP Uploader.
My Continuous Delivery with TFS / VSTS – Server Configuration and Application Deployment with Release Management blog post (with reference to some previous posts) has all the details you need for deploying your artefacts to target nodes using Windows Machine File Copy tasks then use PowerShell on Target Machines tasks to get them in to correct locations and to do token replacement and anything else that's required.
I would recommend using PowerShell DSC so that IIS is properly configured before deployment but that's not required. Where possible for web apps I favour keeping things very simple by creating artefacts that contain all the web files that are needed for a particular folder and then just using plain xcopy for the deployment.
If you need more control you can also use my MSDeploy VSTS extension to deploy a MSDeploy package
https://marketplace.visualstudio.com/items?itemName=rschiefer.MSDeployAllTheThings
https://dotnetcatch.com/2016/04/20/msdeployallthethings-vststfs-extension-is-public/