Open Closed

Azure publish guide for ASP.NET Core + Angular #4786


0
trenxo created

Hi guys,

Can you please reply a simple guide on how to publish the ASP.NET Core + Angular template to Azure with multitenancy enabled using a single domain (ex. mydomain.com)

Thanks in advance.


14 Answer(s)
  • 0
    faisalalam created

    I would like to see that as well

  • 0
    alper created
    Support Team

    Step by step publish to azure angular <a class="postlink" href="https://www.aspnetzero.com/Documents/Step-by-step-publish-to-azure-angular">https://www.aspnetzero.com/Documents/St ... re-angular</a>

  • 0
    mikatmlvertti created

    How about Merged project?

    Also there could be some more info about how to use different settings on development/staging/production servers.

    And how to handle connection strings when I use multi tenancy with own DB:s

  • 0
    alper created
    Support Team

    Merged project is almost same as the separate one. If you encounter any issues while publishing you can write and we'll get back to you.

  • 0
    mikatmlvertti created

    <cite>alper: </cite> Merged project is almost same as the separate one. If you encounter any issues while publishing you can write and we'll get back to you.

    Please give me more details than "almost same" :) What I should do different and what I should skip.

    I did everything by the manual before I realized that I is propably not intented with merged project. So now my server gives me "Error occured" notification, Client App gives me 502.5 process failure. Swagger is alive :D

  • 0
    ismcagdas created
    Support Team

    @MikaTmlVertti, can you check the Logs.txt file which should be under App_Data folder ? Your problem might be related to database connection.

  • 0
    mikatmlvertti created

    Hi @ismcagdas, all were fine there. Few authorization exeptions but it was because I played with swagger site.

    For some reason, I couln't debug my project anymore. So I undo changes and tested that my project still works. Now I see login page, but after login, it tried to reroute to localhost. I only set my appsettings.production.json and there I set clientrootaddress same as my server.

    So now I would like to know, do I need to set the other app for client? What settings I need to set and where?

  • 0
    mikatmlvertti created

    Now I edited my wwwroot/assets/appconfig.json file in azure. I set remoteServiceBaseUrl and appBaseUrl -> my server url and I was able to login. So how this should be done, that I don't have to login in azure and edit file manually?

  • 0
    ismcagdas created
    Support Team

    @MikaTmlVertti, currently you need to configure appconfig.json on Azure after publish.

  • 0
    mikatmlvertti created

    @ismcagdas ok.

    After publishing, when I try to debug locally, after starting Web.Host, my browser starts to localhost:22742 and there is error notification. Before publish, this site+port did not send anything. And after npm start, port 4200 produses same error.. So I can't debug after publishing?

  • 0
    ismcagdas created
    Support Team

    @MikaTmlVertti, yes you shouldn't debug after publish. You need to take a look at error logs in Logs.txt file.

    Or I didn't understand what you are trying to do :).

  • 0
    mikatmlvertti created

    @ismcagdas lets try again ;)

    I published my project to Azure, it works and happy days.

    Now I resumed developing new code to the project and naturally I want to test my code behavior on VS locally. I start VS debugging (Web.Host, IIS Express) and it opens browser like before publishing, but now port 22742 shows me error. This didn't happen before publishing. Normally it showed me blank page, and I only could use swagger. Only after npm start, I got something from port 4200 (<a class="postlink" href="https://aspnetzero.com/Documents/Getting-Started-Angular">https://aspnetzero.com/Documents/Gettin ... ed-Angular</a>), but now it too shows me error.

    So here are these steps again:

    1. Develop and debug locally -> ok
    2. Publish Azure
    3. Azure works
    4. Develop and debug locally -> error

    This happens after these changes: add appsettings.production.json add wwwroot folder and lots of stuff in it add publish profile

  • 0
    mikatmlvertti created

    Ok now I found AppData -> Logs locally and there is problem with wrong tenant number :roll:

    One question still, it is related to this topic :D There was appsettings.Staging.json in template project. Can you tell me how to use these settings. I will set up staging site so having different settings would be great.

  • 0
    alirizaadiyahsi created

    Hi @MikaTmlVertti , check following tutorial for detailed explanation

    <a class="postlink" href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-2.1">https://docs.microsoft.com/en-us/aspnet ... etcore-2.1</a>