Best practices: should I create different custom domains for each environment?

Ernesto 61 Reputation points
2023-06-30T14:01:52.71+00:00

Best practices: should I create different custom domains for each environment for the same app?

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

2 answers

Sort by: Most helpful
  1. Luke Murray 11,436 Reputation points MVP Volunteer Moderator
    2023-06-30T19:27:26.79+00:00

    Hi, Ernesto

    This really depends on your requirements, whether you need to access the app services using a Custom domain, if you add a custom domain to the other environments, then you will need to manage the certifications.

    In terms of testing - it would make sense to use the custom domains, as having a custom domain and certificate will match production (vs just using the azurewebsites CNAME).

    If theres a dev environment, that is only accessed by a few people, you might argue that having a custom domain isn't worth the additional admin, which is fine - but you can also consider deploying your environments when you need it.

    0 comments No comments

  2. Grmacjon-MSFT 19,151 Reputation points Moderator
    2023-07-10T08:24:07.23+00:00

    Hi @Ernesto ,

    Thanks for the question. Like Luke mentioned in his detailed answer, it all depends on your requirements and what you're trying to achieve with your web app.

    It's generally a good practice to use different custom domains for each environment (e.g. dev, test, prod) to avoid confusion and ensure that each environment is clearly identified. This can also help with security and compliance, as it allows you to apply different policies and settings to each environment.

    When setting up custom domains in Azure App Service, there are a few best practices shared in the Azure docs that you should keep in mind:

    -To clearly identify each environment, it's a good practice to use a subdomain for each environment (e.g. dev.example.com, test.example.com, prod.example.com).

    -If you are using SSL/TLS for your custom domains, it's a good practice to use a wildcard SSL certificate that covers all subdomains. This can simplify the management of SSL certificates and ensure that all subdomains are secured.

    -Consider using Azure DNS for domain management. Azure DNS is a managed DNS service that can be used to manage custom domains in Azure App Service. Using Azure DNS can simplify the management of DNS records and ensure that your custom domains are configured correctly.

    • If you have multiple instances of your application running in different regions, you can use Azure Traffic Manager to load balance traffic across the instances. This can help improve performance and ensure high availability.

    Check out these docs for more detailed info: Custom domains in Azure App Service, Azure DNS overview, Azure Traffic Manager overview

    -Grace

    0 comments No comments

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.