Base solution for your next web application
Open Closed

Migrate to Azure CDN #11750


User avatar
0
Ricavir created

Hi,

I need to activate Azure CDN for my app that is running over Azure App Service. I'm using Angular v15 and .NET7. Thus, I need to update appsettings file and appconfig file. I followed this article : https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Step-by-step-publish-to-azure-angular-staticsite but it does not mentioned tenant resolution...

My current appsettings file is :

"App": {
    "ServerRootAddress": "https://{TENANCY_NAME}.xxxx-app.com/",
    "ClientRootAddress": "https://{TENANCY_NAME}.xxxx-app.com/",
    "CorsOrigins": "https://*.xxxx-app.com,http://*.xxxx-app.com",
  },

My current angular appconfig file is :

{
  "remoteServiceBaseUrl": "https://{TENANCY_NAME}.xxxx-app.com",
  "appBaseUrl": "https://{TENANCY_NAME}.xxxx-app.com"
}

Let's say that CDN endpoint is : http://xxxx-app.azureedge.net

Can you please provide some advice to update app URL's with tenant resolution {TENANCY_NAME} ?


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

    Hi @Ricavir

    I assume you are hostin your API app on a different place, is that right ? If so, you only need to change appBaseUrl and ClientRootAddress.

  • User Avatar
    0
    Ricavir created

    Hi @Ismcagdas,

    No, API and app are hosted in the same server. The main point is how do you manage {TENANCY_NAME} in the URL when using a CDN endpoint.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Ricavir ,

    I'm not sure what is the difference in CDN endpoint. Is it not possible to use subdomains in CDN endpoint ?

  • User Avatar
    0
    Ricavir created

    Hi @Ismcagdas,

    Yes, it is possible to configure a custom host name on Azure CDN, it seems easy. But with ABP, I don't know how to proceed.

    Do you mean that I don't need to change anything in my app settings/config ? Do I just need to create a DNS record to redirect all app requests to the CDN endpoint (server and client) ?

    In fact, I would appreciate some guidance on how to implement a CDN with ABP. I'm using the same URL for server and client (angular) and tenant is being resolved from the URL (thanks to {TENANCY_NAME})

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Ricavir

    Altough I don't have any experience with Azure CDN, it should work if you don't change anything. Let me know if you face any issues.