How to Configure CI/CD for Azure WebJobs in in Azure DevOps.

Sai Kiran Maturi 61 Reputation points
2023-03-21T13:22:28.18+00:00

How can we configure CI/CD Pipelines for an azure Webjob of azure app service in azure DevOps.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,782 questions
{count} votes

3 answers

Sort by: Most helpful
  1. brtrach-MSFT 16,356 Reputation points Microsoft Employee
    2023-03-23T01:44:53.3366667+00:00

    To configure CI/CD pipelines for an Azure WebJob of Azure App Service in Azure DevOps, you can follow the steps below:

    1. Create a new pipeline in Azure DevOps and select the appropriate repository where your code is stored.
    2. Add a build step to build your WebJob project.
    3. Add a publish step to publish the WebJob artifacts to a staging directory.
    4. Add a deploy step to deploy the WebJob artifacts to the Azure App Service.
    5. In the deploy step, select the WebJob type as "Continuous" and specify the WebJob name and file path.
    6. Finally, save and run the pipeline to deploy the WebJob to the Azure App Service.

    You can find more detailed information on how to configure CI/CD pipelines for Azure WebJobs in Azure DevOps in this document.

    Let me know if you have any further questions or need more information.

    1 person found this answer helpful.

  2. Phil Nachreiner-MSFT 1 Reputation point Microsoft Employee
    2024-09-19T18:54:56.57+00:00
    
    

    To deploy an Azure WebJob in an Azure DevOps CI/CD pipeline you'll want to use the AzureRMWebAppDeployment task. The documentation for the AzureRMWebAppDeployment task can be found here: AzureRmWebAppDeployment@4 - Azure App Service deploy v4 task.

    In order to use the AzureRMWebAppDeployment task to deploy an Azure WebJob. You will first need to create the WebJob in the Azure Portal.

    1. Steps to create a continuous or triggered Azure WebJob in Azure Portal:

    Now that you have an Azure WebJob created in the Azure App Service you can use the AzureRMWebAppDeployment to deploy new versions of your Azure WebJob.

    The scenario below assumes you will be deploying a WebJob as .NET Framework console app as a Package (compressed zip file). The compressed zip file needs to have a specific rooted folder structure App_Data/jobs/continuous for continuous and App_Data/jobs/triggered for triggered in order to be deployed as a WebJob. Azure WebJobs deploy to those folders in your Azure App Service (i.e. wwwroot\app_data\jobs\triggered\{job name} or wwwroot\app_data\jobs\continuous\{job name}.

    The Console development tool is useful in diagnosing deployment issues Working with Files in Azure App Service.

    The below Azure DevOps YAML assumes you've stored your Azure WebJob Package in $(Build.ArtifactStagingDirectory) and that you'll be using a Pipeline Service connection Manage service connections to your Azure Subscription.

    Consult the documentation for the AzureRmWebAppDeployment@4 task for descriptions on each of the inputs.

    Here's the YAML task to deploy your Packaged Azure WebJob

    steps:
    - task: AzureRmWebAppDeployment@4
      displayName: 'Deploy: Azure WebJob'
      inputs:
      azureSubscription: '<Service Connection to Azure Resource Manager for your Azure Subscription>'
        WebAppName: '<Azure App Service name>'
        packageForLinux: '$(Build.ArtifactStagingDirectory)/<azurewebjobpackage>.zip'
        enableCustomDeployment: true
        DeploymentType: zipDeploy
    
    0 comments No comments

  3. Phil Nachreiner-MSFT 1 Reputation point Microsoft Employee
    2024-09-19T19:00:45.15+00:00

    To deploy an Azure WebJob in an Azure DevOps CI/CD pipeline you'll want to use the AzureRMWebAppDeployment task. The documentation for the AzureRMWebAppDeployment task can be found here: AzureRmWebAppDeployment@4 - Azure App Service deploy v4 task.

    In order to use the AzureRMWebAppDeployment task to deploy an Azure WebJob. You will first need to create the Azure your textWebJob in the Azure Portal.

    1. Steps to create a continuous or triggered Azure WebJob in Azure Portal:

    Now that you have an Azure WebJob created in the Azure App Service you can use the AzureRMWebAppDeployment to deploy new versions of your Azure WebJob.

    The scenario below assumes you will be deploying a WebJob as .NET Framework console app as a Package (compressed zip file). The compressed zip file needs to have a specific rooted folder structure App_Data/jobs/continuous for continuous and App_Data/jobs/triggered for triggered in order to be deployed as a WebJob. Azure WebJobs deploy to those folders in your Azure App Service (i.e. wwwroot\app_data\jobs\triggered\{job name} or wwwroot\app_data\jobs\continuous\{job name}.

    The Console development tool is useful in diagnosing deployment issues Working with Files in Azure App Service.

    The below Azure DevOps YAML assumes you've stored your Azure WebJob Package in $(Build.ArtifactStagingDirectory) and that you'll be using a Pipeline Service connection Manage service connections to your Azure Subscription.

    See the documentation for the AzureRmWebAppDeployment@4 task for description on each of the inputs.

    Here's the YAML task snippet to deploy your Packaged Azure WebJob

    steps:
    - task: AzureRmWebAppDeployment@4
      displayName: 'Deploy: Azure WebJob'
      inputs:
        azureSubscription: '<Service Connection to Azure Resource Manager for your Azure Subscription>'
        WebAppName: '<Azure App Service name>'
        packageForLinux: '$(Build.ArtifactStagingDirectory)/<azurewebjobpackage>.zip'
        enableCustomDeployment: true
        DeploymentType: zipDeploy
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.