Support forum for ASP.NET Zero (https://aspnetzero.com/).
By Mudaser
#24626 Hello Everyone

I am trying to login to tenant using subdomain like tenant.domain.com/account/login but I am getting error
"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
My configuration includes addition of {TENANCY_NAME} in appBaseUrl in appconfig.json like http://{TENANCY_NAME}.localhost:4200

I have also added the same to appremoteurl but it returns an error during loading of tenant login page.
So can anyone guide me how to solve this
Or even if I can restrict somehow to login by a certain tenant by default instead of host user.
By BBakerMMC
#24639 We don't usually use {Tenancy_Name} with our local/dev machines. If you remove it from the config when you goto login you can choose what tenant you want to use. Then in our Prod environment we have our build server add it back in and it works fine (Note you have have to have a wild card DNS and the bindings properly set for your domains to make it work)
By ismcagdas
#24654 Thanks @BBakerMMC :).

@Mudaser, as @BBakerMMC pointed out, it is hard to use subdomains in the local machine.
But if you still want to do that, you need to modify your windows host file to redirect some of domains to your local IP (127.0.0.1) and in your local environment, you can only do that if you use port numbers.
By Mudaser
#24955 I have binded the wildcard in the domain by adding a A card with * and ip address
My remoteServiceBaseUrl is left to default because adding {TENANCY_NAME} to it returns error "Detail not sent by server"
So I only included {TENANCY_NAME} in appBaseUrl like http://{TENANCY_NAME}.domain.com
Now I can open using "tenant.domain.com"
but upon sign in it opens host admin page by default rather than tenant dashboard page
By ismcagdas
#24973 Hi @Mudaser,

Just to be sure, are you trying this on your local machine ?
If so, you can follow a similar configuration like this:

Angular app config

Code: Select all{
  "remoteServiceBaseUrl": "http://{TENANCY_NAME}.localcore.aspnetzero.com:2021",
  "appBaseUrl": "http://{TENANCY_NAME}.zerong2client.com:4445/"
}


Host app config

Code: Select all"App": {
    "WebSiteRootAddress": "http://{TENANCY_NAME}.zerong2host.com:4444",
    "ClientRootAddress": "http://{TENANCY_NAME}.zerong2client.com:4445/",
    "CorsOrigins": "http://zerong2client.com:4445/,http://default.zerong2client.com:4445"
  }


Windows app config

Code: Select all127.0.0.1          zerong2client.com
127.0.0.1          default.zerong2client.com
127.0.0.1          zerong2host.com
127.0.0.1          default.zerong2host.com 


You need to create two seperate websites on your local IIS and publish Angular app to localhost:4445, your host application to localhost:4444.

When you configure them like I shared above, you can login as default tenant admin using http://default.zerong2client.com:4445 link.
By Mudaser
#25002 Hello ismcagdas,

Thanks for such an elaborate response to my query
I am not using localhost, but deploying on the domain 'jackfolks.com'
While the services (Web host ) is deployed on azure app 'http://miranzeasysecurewebapi.azurewebsites.net'
I have used your configurations as you suggested but still facing issue. Below are my configuration files

Angular app config
Code: Select all  "remoteServiceBaseUrl": "http://{TENANCY_NAME}.miranzeasysecurewebapi.azurewebsites.net",
  "appBaseUrl": "http://{TENANCY_NAME}.jackfolks.com"


Host app config
Code: Select all    "ServerRootAddress": "http://{TENANCY_NAME}.miranzeasysecurewebapi.azurewebsites.net/",
    "ClientRootAddress": "http://{TENANCY_NAME}.jackfolks.com/",
    "CorsOrigins": "http://jackfolks.com,http://default.jackfolks.com"


When I open the domain using 'jackfolks.com' or 'default.jackfolks.com'
nothing is shown on the landing page except the error 'Details not sent by the server'
By ismcagdas
#25012 Hi @Mudaser,

Your configuration is correct.
I can access to http://miranzeasysecurewebapi.azurewebs ... t/swagger/ but cannot access to http://default.miranzeasysecurewebapi.a ... t/swagger/.

Probably you need to enable subdomains on azure but I don't know how to do that, you can search it on the web.
If you cannot find a solution for that, we can try to help you.
By Mudaser
#25113 Hi @ismcagdas,

I was trying to add wild card on Azure but I found out that without an SSL certificate it is not possible.
So I was thinking that rather than deploying services on Azure, I can deploy it on the domain as well.

But now do I have to deploy angular and Services Apps on separate domains or is it possible
that I add the dist folder of angular to the web host folder. In this way I can deploy both on the same domain.
By godrunner
#25114 @Mudase, I have a test deployment working on Azure with no SSL for now and it works fine.
You just have to configure your site in the Azure "Custom domains" page for your app service and make the required changes to your DNS as per the instruction on that page.