Search code examples
azureazure-devopsazure-functionsazure-pipelinesazure-linux

Is it possible to do continuous deployment CI/CD of an Azure Function through a Linux Environment via Azure DevOps?


When creating a function in Azure through a Linux environment it seems CI/CD is completely missing from it's capabilities as I can't see any actual files. My VS code tells me this

Error: This plan does not support viewing files.

and when I try to deploy my files to the server through the Azure pipeline everything works except for the Azure App Service Deploy

Which tells me this.

2020-04-21T19:48:37.6676043Z ##[error]Failed to deploy web package to App Service.
2020-04-21T19:48:37.6689536Z ##[error]Error: Error: Failed to deploy web package to App Service. Conflict (CODE: 409)

I did get it working directly through VS Code with a windows environment and didn't notice any of those issues.

Can you confirm this is not possible through Linux or perhaps there is a solution for what I am looking for.


Solution

    • is it possible to do continuous deployment CI/CD of an Azure Function through a Linux Environment via Azure DevOps?

    The answer is Yes.

    To deploy a Azure Function, you should use Azure Function App task instead of Azure App Service Deploy task. For below example.

    steps:
    - task: AzureFunctionApp@1
      inputs:
        azureSubscription: '<Azure service connection>'
        appType: functionAppLinux
        appName: '<Name of function app>'
        #Uncomment the next lines to deploy to a deployment slot
        #Note that deployment slots is not supported for Linux Dynamic SKU
        #deployToSlotOrASE: true
        #resourceGroupName: '<Resource Group Name>'
        #slotName: '<Slot name>'
    

    Please check out this document Continuous delivery by using Azure DevOps for detailed examples.