AzureRM WebJobs Deployment with Release Management on Visual Studio Team Services - azure-devops

I'm trying to deploy AzureRM Webjobs with VSTS Release Management and haven't been able to find a good solution for it other than uploading it via FTP. This way works, but doesn't handle when the schedule of the job changes. Every solution that I've found so far refers to Classic Webjobs which won't work for jobs deployed to Resource Manager.

DavidDebbo created a sample for how to publish webjobs with ARM template here: ARMTemplates/WebAppWithWebJobs.json. You can refer to this for details.
Besides, you can simply add an AzureRM Web App Deployment task in your release definition to deploy your webjob via Azure Resource Manager if you can see this task in task list.
The AzureRM Web App Deployment task is used to deploy Web Apps and
WebJobs to Azure. The task works with the Azure Resource Manager APIs
only. The underlying technology used by the task is Web Deploy.
The task is under development and is available to a limited set of
accounts on Visual Studio Team Services (VSTS). The video describes
the features that are available in the task currently.

Related

Azure Devops Release not update Azure WebApp

I did an initial deployment to an Azure WebApp on Linux via a direct publish from Visual Studio. The code just echoes out some text and the page comes up successfully. I can update the text in the code and re-publish. And the new text displays on the web.
Now I am trying to deploy it via Azure DevOps rather than a direct publish from Visual Studio. I created a rudimentary build and release pipeline in Azure DevOps.
I updated the text echoed out in the code then ran the build pipeline followed by the release pipeline. The Deployment status says that everything was successful. I went through the logs as well and there are no error messages. However, the website page text has not changed. Also restarted the App Service in Azure but the change is not reflected.
The release pipeline has one artifact which is linked to the latest build. And one stage which is "Azure App Service deployment" with the right subscription and the right App Service Name linked.
Release Pipeline
Any idea what I might be missing?
Here is the output from the deployment step -
Blockquote##[section]Starting: Deploy Azure App Service
==============================================================================
Task : Azure App Service deploy
Description : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
Version : 4.163.9
Author : Microsoft Corporation
Help : https://aka.ms/azureappservicetroubleshooting
==============================================================================
Got service connection details for Azure App Service:'myAppName'
Package deployment using ZIP Deploy initiated.
Deploy logs can be viewed at https://myAppName.scm.azurewebsites.net/api/deployments/xxx/log
Successfully deployed web package to App Service.
Successfully updated deployment History at https://myAppName.scm.azurewebsites.net/api/deployments/xxx
App Service Application URL: https://myAppName.azurewebsites.net
##[section]Finishing: Deploy Azure App Service
Thanks in advance, Jake.
I was able to create an empty Azure Service directly within Azure. Then pushed the code to this new Azure Service via DevOps. Now it seems to be working as expected. Only other difference is that I had created this as an App for Windows rather than App for Linux. Anyway, the update is working now.

Azure Devops build to create only bin,web.config and global.asax for webapi service

How to create a azure devops build definition only to publish bin,web.config and global.asax for webapi service.
If you build a project in Azure DevOps, you'll get all the output. You're asking for a publish of the web API.
You're looking for an Azure Web App deployment.
The simplest way to deploy to an Azure Web App is to use the Azure App Service Deploy task. This task is automatically added to the release pipeline when you select one of the prebuilt deployment templates for Azure App Service deployment. Templates exist for apps developed in various programming languages. If you can't find a template for your language, select the generic Azure App Service Deployment template.

How do I deploy to an Azure Web App on Linux using Azure DevOps?

The docs have a link to Deployments > Azure Web App on Windows but no link to Azure Web App on Linux.
[Update]
Here is my latest attempt
It is not possible to data enter the app service name.
[Update]
It turns out that the order of filling things in matters.
Once I filled in the settings for the pipeline task then I could enter data in the Azure App Service Task.
The Azure App Service Deploy task supports Web App on Linux app service type, so you can directly deploy Azure Web App on Linux through this task. See Deploy: Azure App Service Deploy for details.
The Azure App Service Deploy task is used to deploy to a range of App
Services on Azure. The task works on cross-platform agents running
Windows, Linux, or Mac.
Reference this similar thread : VSTS Deploy to Azure WebApp For Linux
And you can also reference this article for the deployment: Docker Deployment to Azure App Service (Linux) using VSTS

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/