0

I have an ASP.NET MVC application deployed to a standard Azure web app service. I also configure the web app to have 1 deployment slot called 'staging'. First, I published my web app using VS2015 publishing tool to staging slot and tested. It worked so I swapped it with production slot. Then, I published another version with some code changes to staging slot again. It published directly to my production slot. I thought Azure web app production slot is now actual staging slot after swapping. How can I make the web app always publish to the slot that is not currently live (i.e. production slot) to test before swapping again?

I published the web app by right click on the web project and select publish, enter my azure subscription ID and password, select web app and publish.

Thank you

2 Answers 2

2

I've found out what is happening with the publish process. VS2015 publishing tool does not allow to select specific slot to deploy the web app. It will deploy to production slot if you choose the web app from the selection list. For some reason, it published to my staging slot at the first time and it caused my confusion.

To make the publish wizard to deploy web app to staging slot, I had to download the publish profile from my staging slot on Azure Portal and copy the information from it to the publish wizard. The info needs to copy includes publishUrl, msdeploySite, userName, userPWD and destinationAppUrl. After updating the publish profile, my publish wizard now always deploys to my staging slot.

Sign up to request clarification or add additional context in comments.

Comments

0

The staging slot is always considered the staging slot. Behind the scenes, it is working some DNS magic, but that is nothing that you have to plan for.

4 Comments

You should also ensure that auto-swap is not turned on. If it is, that would explain why a publish to staging showed up in production automatically.
The auto-swap is always off. My point was the publish tool in VS2015 deployed directly to the production slot after swapping production and staging once.
The publishing profile in visual studio should save the slot information that was used previously. Did you use the same profile or create a new one?
I used the same profile which was used to publish to staging slot before swapping in the first time. The site name is always "<mysite>-staging".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.