Open Closed

App-Pro Blazor IdentityServer configuration for Azure App Service deployment. #826


User avatar
0
jarrad78 created
  • ABP Framework version: v4.1.1
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Seperated (Angular): No
  • Exception message and stack trace: N/A
  • Steps to reproduce the issue: N/A

Is there documentation to help me understand what each Identity Server client is used for exactly? It is obvious what Blazor and Swagger clients are there for in DBMigrator appsettings.json file but I am unsure about _Web and _App. Are these two endpoints necessary in my usage scenario?

For example if I create a Blazor Project with the following configuration: abp new ExampleProject -t app-pro -u blazor

If I deploy this project to Azure App Service I will have two independent App Services to deploy, (ExampleProject.HttpApi.Host and ExampleProject.Blazor) each app service will have an independent url.

For example: ExampleProject.HttpApi.Host - https://exampleProject-Blazor.azurewebsites.net ExampleProject.Blazor - https://exampleProject-HttpApiHost.azurewebsites.net

1.) How would this be usage scenario be configured in the IdentityServer clients section below for creating the DBMigration in DBMigrator project? 2.) Are _Web and _App clients even necessary in this usage case? 3.) Do you have more detailed documentation on IdentityServer configuration specific to ABP-PRO Blazor

  "IdentityServer": {
    "Clients": {
      "**ExampleProject_Web**": {
        "ClientId": "ExampleProject_Web",
        "RootUrl": "https://localhost:44323/"
      },
      "**ExampleProject_App**": {
        "ClientId": "ExampleProject_App",
        "RootUrl": "http://localhost:4200"
      },
      "**ExampleProject_Blazor**": {
        "ClientId": "ExampleProject_Blazor",
        "RootUrl": "http://localhost:44307"
      },
      "**ExampleProject_Swagger**": {
        "ClientId": "ExampleProject_Swagger",
        "ClientSecret": "1q2w3e*",
        "RootUrl": "https://localhost:44319"
      }
    }
  }

Is the expected config for HttpApi + Blazor config as follows?

DBMigrator - appsettings.json

"IdentityServer": {
    "Clients": {
        "ExampleProject_Blazor": {
            "ClientId": "ExampleProject_Blazor",
            "RootUrl": "https://exampleProject-Blazor.azurewebsites.net"
        },
        "ExampleProject_Swagger": {
            "ClientId": "ExampleProject_Swagger",
            "ClientSecret": "1q2w3e*",
            "RootUrl": "https://exampleProject-HttpApiHost.azurewebsites.net"
        }
    }
}

ExampleProject.Blazor - appsettings.json

{
  "AuthServer": {
    "Authority": "https://exampleProject-HttpApiHost.azurewebsites.net",
    "ClientId": "ExampleProject_Blazor",
    "ResponseType": "code"
  },
  "RemoteServices": {
    "Default": {
      "BaseUrl": "https://exampleProject-HttpApiHost.azurewebsites.net"
    }
  },
  "AbpCli": {
    "Bundle": {
      "Mode": "BundleAndMinify", /* Options: None, Bundle, BundleAndMinify */
      "Name": "global",
      "Parameters": {
        "LeptonTheme.Style": "Style6", /* Options: Style1, Style2... Style6 */
        "LeptonTheme.ChangeStyleDynamically": "true"
      }
    }
  }

ExampleProject.HttpApi.Host - appsettings.json

{
"App": {
  "SelfUrl": "https://exampleProject-HttpApiHost.azurewebsites.net",
  "CorsOrigins": "https://*.ShopLogic.com,https://exampleProject-Blazor.azurewebsites.net"
},
"ConnectionStrings": {
  "Default": ".........."
},
"AuthServer": {
  "Authority": "https://exampleProject-HttpApiHost.azurewebsites.net",
  "RequireHttpsMetadata": "false"
}
"StringEncryption": {
  "DefaultPassPhrase": ".........."
},
"Settings": {
  "Volo.Abp.LeptonTheme.Style": "Style3", /* Options: Style1, Style2... Style6 */
  "Volo.Abp.LeptonTheme.Layout.MenuPlacement": "Top", /* Options: Left, Top */
  "Volo.Abp.LeptonTheme.Layout.MenuStatus": "AlwaysOpened", /* Options: AlwaysOpened, OpenOnHover */
  "Volo.Abp.LeptonTheme.Layout.Boxed": "False", /* Options: True, False */
  "Abp.Mailing.Smtp.Host": "127.0.0.1",
  "Abp.Mailing.Smtp.Port": "25",
  "Abp.Mailing.Smtp.UserName": "",
  "Abp.Mailing.Smtp.Password": "",
  "Abp.Mailing.Smtp.Domain": "",
  "Abp.Mailing.Smtp.EnableSsl": "false",
  "Abp.Mailing.Smtp.UseDefaultCredentials": "true",
  "Abp.Mailing.DefaultFromAddress": "noreply@abp.io",
  "Abp.Mailing.DefaultFromDisplayName": "ABP application"
},
"AbpLicenseCode": ".........."
}

Thanks for your feedback.


1 Answer(s)
  • User Avatar
    0
    dmeagor created

    I saw your comment about having different App Services for each endpoint which conserned me slightly as we were planning to have just two containing all of the hosts and load balance between them. I did a quick check and it does seem you can put multiple hosts into one App Service plan.

    https://docs.microsoft.com/en-us/azure/app-service/overview-hosting-plans#should-i-put-an-app-in-a-new-plan-or-an-existing-plan

    Not much info about on Identity Service or deploying to Azure.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11