0
votes

I have a web app that is relies on a series of azure services. Currently, to handle different environments, we have a subscription and resource groups to handle each environment that we use (dev, test, staging, production).

Right now, every web app site EXCEPT for Prod uses the default url that Azure assigns to the web app upon creation.

This has led to some issues with in house business case testers getting confused about which urls go to what environment.

I wanted to know if it is possible to create subdomains that are named according to the environment (so if prod is https://superglue.com then dev would be https://dev.superglue.com) and if we can, if there are any reasons NOT to do it this way.

THanks in advance for any help!

2
Any update on your side? if the reply is helpful, you could consider accepting it. - Nancy Xiong
Sorry, I'm still working on it and trying both answers out below. I was going to do an update to my post to lay it all out step by step on what I did so it is taking a little longer than usual to mark an answer. Sorry about that. - JakeHova

2 Answers

1
votes

You could add custom domains to each of your web app service. For example, you could map a subdomain www.contoso.com by using a CNAME record in your DNS provider. Then In the Custom domains page of the web app, add the fully qualified custom DNS name www.contoso.com to the list.

You could follow these steps in the official doc. https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain#map-your-domain

Azure does not support this if you have a free F1 price tier. But if you have shared D1 price tier, you could add custom domains. With a basic price tier and above, you could add custom domains and SSL binding.

1
votes

Yes, you can use Azure web app deployment slot if you want to distinguish the dev,staging and prod environment of your web app. Deployment slots are actually live apps with their own host names. And this is a recommended way to do some tests or building up test environment on your web apps . What's more,if you have ensure that the staging env is ready to online , you can swap it to prod environment directly of course you can swap it back to staging easily too : ). Hope it helps .