Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Tenant name Url #12200


User avatar
0
[email protected] created

.NET Core & Angular - latest version, .NET8 I have been trying to get this working for a couple days, and have read the similar posts but am having no luck. I want to be able to hit each tenant using the URL : https://tenantName.mydomain.com

My web apps:

  • API (host) - https://myserver.azurewebsites.net (Azure web app)
  • Angular app - https://mydomain.com (Azure web app)

My settings (host):

  • ServerRootAddress: https://{TENANCY_NAME}.myserver.azurewebsites.net
  • ClientRootAddress: https://{TENANCY_NAME}.mydomain.com

My Settings (angular):

  • remoteServiceBaseUrl: https://{TENANCY_NAME}.myserver.azurewebsites.net
  • appBaseUrl: https://{TENANCY_NAME}.mydomain.com

DNS

  • mydomain.com is working and is set as a custom domain for the Azure Web App hosting the angular project.
  • I have a wildcard A record in place for mydomain.com that points to the IP of the Azure Web App hosting the angular project.

Browsing to https://tenantName.mydomain.com with a valid tenant name just gives a "site can't be reached" error in the browser. Same when I try to login as a tenant from the host admin UI.

Any help would be appreciated! Thanks.


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you are hosting your app on Azure, this might help https://stackoverflow.com/a/43571399. Could you try it and let us know if it works ?

  • User Avatar
    0
    [email protected] created

    Hi,

    If you are hosting your app on Azure, this might help https://stackoverflow.com/a/43571399. Could you try it and let us know if it works ?

    The solution in the link is out dated for Azure. You can no longer add wildcards on custom domains, it won't let you. I do have the wildcard DNS record in place though.

  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi sandy

    By using Azure Front Door (in a WAF policy), you can configure wildcard subdomain routing. Azure Front Door provides global distribution and allows you to route requests based on subdomains. It supports wildcard subdomains and also manages SSL configurations. This way, you can direct all tenant subdomain requests, like "tenantName.mydomain.com" , to your main application through Front Door. Did you set up the routing using Front Door?

  • User Avatar
    0
    [email protected] created

    Hi sandy

    By using Azure Front Door (in a WAF policy), you can configure wildcard subdomain routing. Azure Front Door provides global distribution and allows you to route requests based on subdomains. It supports wildcard subdomains and also manages SSL configurations. This way, you can direct all tenant subdomain requests, like "tenantName.mydomain.com" , to your main application through Front Door. Did you set up the routing using Front Door?

    Thanks, I didn't try Front Door, but ended up getting it to work by adding my own wildcard cert. Once the wildcard cert was loaded I added the *.mydomain.com to the App Service - Custom Domains. You can use the wildcard if you "add cert later" when adding the custom domain.

    Also from my original post, the only settings file that needs the {TENANCY_NAME} placeholders is the settings file for the angular app, not the Host app.

  • User Avatar
    0
    oguzhanagir created
    Support Team

    We're glad you resolved your problem. Thank you for your information. Enjoy your work.