azure cli - error swapping slots with publish profile

Jordan Marr 96 Reputation points
2021-03-18T23:34:19.233+00:00

I am trying to create an automated deployment for my web app service via Azure DevOps using the "Azure CLI" task with the following script:

az webapp deployment slot auto-swap --name samplesite-web --resource-group samplesite-rg --slot staging

I get the following error: "Auth Scheme PublishProfile is not supported" In a previous step, I successfully deployed my site to the "staging" slot using a publish profile. So why doesn't this work? I am able to swap from Azure Portal without an error.

Btw, the same CLI script works when run from my local pc.

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

Accepted answer
  1. Jordan Marr 96 Reputation points
    2021-03-23T14:45:03.577+00:00

    The error message appears to be caused due to the fact that I was using an arm task with the following Service Connector type:

    Azure Resource Manager
    using publish profile based authentication
    

    Unfortunately, I do not have "create application" access at the tenant, so none of the other available options will work for me to finish my deployment pipeline.
    So I will just have to use the publish profile and then manually swap slots via the Azure CLI.

    Thank you for the help.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Ryan Hill 26,951 Reputation points Microsoft Employee
    2021-03-19T16:38:49.967+00:00

    Hi @Jordan Marr , I would advise using AzureWebApp@ and AzureAppServiceManage@ tasks to perform you swap, see https://learn.microsoft.com/en-us/azure/devops/pipelines/targets/webapp?view=azure-devops&tabs=yaml#deploy-to-a-slot.

    - task: AzureWebApp@1  
      inputs:  
        azureSubscription: '<Azure service connection>'  
        appName: '<name of web app>'  
        slotName: staging  
      
    - task: AzureAppServiceManage@0  
      inputs:  
        azureSubscription: '<Azure service connection>'  
        WebAppName: '<name of web app>'  
        ResourceGroupName: '<name of resource group>'  
        SourceSlot: staging  
    

    I can't speak to what caused the Auth Scheme PublishProfile, especially since you said a CLI script worked in the prior step. You can use the --debug switch to get more verbose logging to see where about the failure is thrown and create a new issue on the Azure CLI repo.

    Regards,
    Ryan