How to set Custom Base URL in Azure App Service with .Net Core?

Viewed 658

I have created a web application in .Net core(v5.0) and hosted it in Azure App Service. I have created a view and that allows me to add a new URL based on that create a new subdomain in the same service and publish code in that. This concept also uses in Jira software where our <projectname>.atlassian.com

Eg:

I have added dev in a text box then-new subdomain added like. dev.<myappservicename>.azurewebsites.net In this case, all code copy and run this code properly.

Main Domain:

Base URL(Created URL): <myappservicename>.azurewebsites.net

Custom URL(Added from View): dev.<myappservicename>.azurewebsites.net , admin.<myappservicename>.azurewebsites.net

Technology Specification:

  1. .Net Core(5.0)
  2. C#
  3. Azure App Service

If anyone has an idea then suggest thought. It helps me a lot.

1 Answers

You can use restapi or .net sdk to create subdomain.

From your description, I see that there should be no need to redeploy your webapp, so if there is a business need, it is recommended to identify it through the program, what is the input url of the browser, to process your program.

Eg:

  1. company1.<projec_tname>.azurewebsites.net

    Get HttpRequest url to handle company1's bussiness.

  2. company2.<projec_tname>.azurewebsites.net

    Get HttpRequest url to handle company2's bussiness.

Related