Base solution for your next web application
Open Closed

Adding public site on Azure #7007


User avatar
0
yoshrepublic created

Hello,

I am trying to wrap my head around what would be involved adding a fast loading home page using your public site to an existing Azure setup. Currently I have two app services on Azure:

mydomainAPI.azurewebsites.net (.Net core 6.5) mydomainUi.azurewebsites.net (Angular 6.5)

I have a text domain pointer on godaddy for mydomain.com pointing @ to mydomainUi.azurewebsites.net

I have a public module in Angular that has a few components to handle public pages and has redirects in place to go to app/main when authentication is required. Everything works fine except the huge overhead of loading Agular on the home page (8+ seconds) . It is pretty bad locally too so it is not an Azure issue. Your public site loads very fast (.8s). I have published it to

mydomainPublic.azurewebsites.net

What do I need to do to have the public site handle the home page only and all other requests go to Angular? The urls in the browser still should just show mydomain.com and not the Azure app service domains.

What dns records do I need on godaddy?

I am assuming the appsettings.production.json for public site will look something like this:

"App": { "WebSiteRootAddress": "https://mydomain.com/", "AdminWebSiteRootAddress": "https://mydomainUI.azurewebsites.net" }

How will the appsettings.production.json look like for the Core and Angular project including CorsOrigins?

"App": { "WebSiteRootAddress": "", "ClientRootAddress": "", "CorsOrigins": "" },

Are there any additional steps required?

Thank you for your help


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

    Hi @yoshrepublic

    You can create a separate Angular app and move your public pages to it.

  • User Avatar
    0
    yoshrepublic created

    Hello,

    Thank you for your response. I understand that I could create a separate Angular solution for the public pages but what I really need fast loading home page withot all the Angular overhead. My questions were more about implementing your public solution in a fairly typical scenaro that I have and most likely others too. Can you lay out how I would go about implementing your public site and answer my bolded questions please?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @yoshrepublic

    AspNet Zero's public website is not an Angular project, it is an ASP.NET Core MVC project.

    What dns records do I need on godaddy?

    I'm not familiar with DNS records and GoDaddy, you can do it as you do for your other websites.

    How will the appsettings.production.json look like for the Core and Angular project including CorsOrigins?

    It should be similar to appsettings.json, you need to add the settings which exists in appsettings.json and not in appsettings.production.json to appsettings.production.json.

    Are there any additional steps required?

    No.

    You can also check https://docs.aspnetzero.com/documents/aspnet-core-angular/latest/Deployment-Angular-Publish-Azure

  • User Avatar
    0
    yoshrepublic created

    Wow. These have got to be the worst non-answers I have ever gotten back from a support team.

    Do it as you do for your other websites? Seriously?

    If you don't know what a DNS record or the world's largest domain registry is, you probably shouldn't be answering technical questions.

    I have done my homework and tried to find documentation on publishing and implement your public site but only found scattered bits and pieces. I did not ask you to fix code that I wrote or broke. I have asked instructions on how to use your product in the most common scenario I can think of.

    So here it is again:

    I have a typical setup on Azure with three app services:

    mydomainAPI.azurewebsites.net (.Net core 6.5) mydomainUi.azurewebsites.net (Angular 6.5) mydomainPublic.azurewebsites.net (MVC Public ASPNETZERO site)

    The public site is only used for the home page. All other pages will be handled by Angular

    1. What steps do I need to make to publish and implement the PUBLIC site in Azure (similar to your Angular documentation)?
    2. The steps should include all application settings changes in the public project showing the app service domains as well as settings that need to be changed in the other two projects if needed.
    3. What DNS records are required to make this all work with the browser only showing mydomain.com?
  • User Avatar
    0
    aaron created
    Support Team
    1. What steps do I need to make to publish and implement the PUBLIC site in Azure (similar to your Angular documentation)?

    Not specific to ASP<span></span>.NET Zero. It is like any other ASP<span></span>.NET Core (especially MVC) website.

    https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/azure-apps/?view=aspnetcore-2.2

    1. The steps should include all application settings changes in the public project showing the app service domains as well as settings that need to be changed in the other two projects if needed.

    Specific to ASP<span></span>.NET Zero. It is already mentioned in the documentation.

    https://docs.aspnetzero.com/documents/aspnet-core-mvc/latest/Public-Website

    1. What DNS records are required to make this all work with the browser only showing mydomain<span></span>.com?

    Not specific to ASP<span></span>.NET Zero. This is a question that you should be asking your hosting provider.

    https://sg.godaddy.com/help/how-do-i-install-an-application-to-a-subdomain-or-non-primary-domain-1732

  • User Avatar
    0
    yoshrepublic created

    Thank you