Base solution for your next web application
Open Closed

AppBaseUrl : Tenancy name as subdomain for a multi-tenant application #8835


User avatar
0
goontechpetter created

Hi,

I am looking to use tenancyname as placeholder in AppBaseUrl. Have followed the link step mentioned below. https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Overview-Angular#configuration

Problem: tenancyname place holder in appBaseUrl is not working. I have hosted angular UI in Azure storage.

Azure storage - Created CDN - Endpoint. - Custom Domain. In DNS setting: CNAME - *.mydomian.com Using CDN endpoint to redirect - xyz.azureedge.net

Is there constraint while using tenancyname as placeholder in appBaseUrl, If app is hosted in azure storage? OR please guide if I missed something.

**P.S : ** App is working fine with custom domain mapping of azure storage hosted. I am facing issue when I look to extend the feature for having tenancyname placeholder in AppBaseUrl.

-Anshu


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

    Can you share your app api and angular url? [email protected]

  • User Avatar
    0
    goontechpetter created

    Have sent email with details, kept email subject line same..!!

  • User Avatar
    0
    maliming created
    Support Team

    hi @goontechpetter

    remoteServiceBaseUrl also needs to use {TENANCY_NAME}.

    https://{TENANCY_NAME}.glex.z1.web.core.windows.net/ Wildcard domain names also don't seem to work. eg

    https://xx.glex.z1.web.core.windows.net

    Zero demo website appconfig is:

    {
        "remoteServiceBaseUrl": "http://{TENANCY_NAME}.demo.aspnetzero.com",
        "appBaseUrl": "http://{TENANCY_NAME}.demo.aspnetzero.com",
    }
    

    http://notexistsubdomain.demo.aspnetzero.com This non-existent tenant name url should also be accessible. It will be Host.

    We should configure DNS to redirect all subdomains to a static IP address. To declare 'all subdomains', we can use wildcard like *.mydomain.com. We should configure IIS to bind this static IP to our application.

    https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Overview-Angular#multi-tenancy

  • User Avatar
    0
    goontechpetter created

    After changing the remoteServiceBaseUrl for tenancy_name and added Custom domain mapping for Subdomain in Azure CDN endpoint. I am able to redirect to the tenant(subdomain) specific URL but the login allowed as Admin/Host only.

    Below URL Works for Admin login only. Should be allowed to login for Tenant user/admin.. https://mvestenergy.admin.glex.no/

    https://mvestenergy.glex.z1.web.core.windows.net/?impersonationToken=de2deb21-b162-4f08-9c47-a33fc932729d&tenantId=2 Error: can’t connect to the server...

    Host URL seems working fine but similar behavior in case of impersonate login as tenant. https://notexistsubdomain.admin.glex.no/app/admin/hostDashboard

  • User Avatar
    0
    maliming created
    Support Team

    hi

    https://mvestenergy.admin.glex.no/assets/appconfig.production.json?d=1586916096801

    "remoteServiceBaseUrl": "https://{TENANCY_NAME}.glexwebapp.azurewebsites.net/"
    "appBaseUrl": "https://{TENANCY_NAME}.glex.z1.web.core.windows.net/"
    

    https://{TENANCY_NAME}.glexwebapp.azurewebsites.net/ Wildcard domain names don't seem to work.

    eg: https://xx.glexwebapp.azurewebsites.net

    I am not familiar with Azure CDN, you can bind the domain name through IIS locally and test it.

    For example, edit the windows hosts file to set the intranet domain name.

    After working locally you try to troubleshoot azure.