How to change Visual Studio publish destination to Azure Web App slot?

Grmacjon-MSFT 19,301 Reputation points Moderator
2021-07-28T20:12:07.247+00:00

In Visual Studio 2019 I have a publishing profile that deploys to the production slot of my Azure Web App. I don't see an option to change the publishing destination to the staging deployment slot, it is still pointing to the production URL. Do I need to create a separate publishing profile in order to publish to a different deployment slot?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,971 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jahnavi Valluri 241 Reputation points Microsoft Employee
    2021-07-28T20:22:58.75+00:00

    No, a new publishing profile is not needed in order to change the publishing destination. In Visual Studio when you select the Publish option -> Specific Target -> Azure App Service, then a dropdown shows of resource groups in your subscription. Within the resource group for your app there should be a prod app service, this can be expanded to reveal a "Deployment Slots" folder.

    If a publishing profile already exists, then when clicking the publish button the solution will directly start to build and upload, without an option to select the target. In this case, within the Solution Explorer on Visual Studio, there is a "Connected Services" section. When clicking on this, it takes you to a view with three options on the left: Overview, Connected Services, and Publish. Clicking into Publish, you can then select "Edit", and here is where the destination URL can be changed to that of the staging slot. For a target change within the same web app (just to a different slot), all fields can be left the same with the exception of the destination URL field. This field will be changed to appname-slotname.azurewebsites.net.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.