Base solution for your next web application
Open Closed

tenantId: null on Tenant Custom domains under Azure Front Door #9644


User avatar
0
dexter.cunanan created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? ASP.net Core 3.1 + Angular 8
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .NET Core

Setup

We're using Azure Front Door custom domain for the .Net Core app service with format tenant1.mydomain.com and set it in "ServerRootAddress" and "remoteServiceBaseUrl" ({TENANCY_NAME}.mydomain.com).

Issue:

When we run the application, the tenantid is null under /AbpUserConfiguration/GetAll? instead of getting the tenantId based from the tenancy name. How do we pass the tenantId from the tenancy name through Azure Front Door.

Thanks!


3 Answer(s)
  • User Avatar
    0
    zony created
    Support Team

    Hi dexter.cunanan, DomainTenantResolveContributor will resolve subdomains through HttpContext.Request.Url.Host. Can you write a Demo Controller, inject IHttpContextAccessor, and observe whether the currently requested Url matches your tenant's configuration. Or inject DomainTenantResolveContributor to call its ResolveTenantId() method and observe whether the return value is NULL.

  • User Avatar
    0
    dexter.cunanan created

    Hi @zony thank you for the information. We' have tried to enable this and the tenantId is passed correctly on the basic setup. However, when we involve Front Door, we lose the tenantId. It is as if it's reading it as the base URL mydomain.azurewebsites.net, instead of the custom domain tenant1.mydomain.com.

    Any other suggestions?

  • User Avatar
    0
    zony created
    Support Team

    Hi dexter.cunanan, After printing the value of HttpContext.Request.Url.Host, do you find that it is inconsistent with the expected tenant1.domain.com?