azure cli - error swapping slots with publish profile

Jordan Marr 96 Reputation points

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

    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

    Hi @Jordan Marr , I would advise using AzureWebApp@ and AzureAppServiceManage@ tasks to perform you swap, see

    - task: AzureWebApp@1  
        azureSubscription: '<Azure service connection>'  
        appName: '<name of web app>'  
        slotName: staging  
    - task: AzureAppServiceManage@0  
        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.