Přeskočit na hlavní obsah

Setting up reports for on-premises Alvao with Entra ID

Technical requirements​

  • Alvao on-premises installation
  • MS Entra authentication to Alvao
  • Alvao REST API accessible from the Internet
  • Custom domain verified in MS Entra Custom Domains
  • Power BI Desktop updated to the newest version

Set up IIS​

First, we need to create a dedicated copy of the AlvaoRestApi application to serve reporting data.

  1. In Application Pools - Add Application Pool:

    • Name: AlvaoRestApiReports AppPool
    • All other settings (for example, AppPool identity) should be the same as for the AlvaoRestApi AppPool.
  2. In Sites – Default Web Site – Add Application:

    • Alias: AlvaoRestApiReports
    • Application pool: AlvaoRestApiReports AppPool
    • Physical path: same as for the AlvaoRestApi app (for example, C:\inetpub\wwwroot\AlvaoRestApi)
    • Click OK.
  3. Open https://<server>/AlvaoRestApiReports in a web browser and ensure that the application is running correctly. It should return the same information as the original AlvaoRestApi app.

  4. Make AlvaoRestApiReports accessible from your public domain, for example, https://contoso.com/AlvaoRestApiReports.

  5. In the installation path of the AlvaoRestApi (for example, C:\inetpub\wwwroot\AlvaoRestApi) open web.config and remove line:

    <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />
  6. Open a command prompt as an administrator and run the following commands:

    cd C:\Windows\system32\inetsrv

    .\appcmd.exe set config -section:system.applicationHost/applicationPools /+"[name='AlvaoRestApiReports AppPool'].environmentVariables.[name='ASPNETCORE_ENVIRONMENT',value='Reports']"

    .\appcmd.exe set config -section:system.applicationHost/applicationPools /+"[name='AlvaoRestApi AppPool'].environmentVariables.[name='ASPNETCORE_ENVIRONMENT',value='Production']"

    You can check the ASPNETCORE_ENVIRONMENT variables for the app pools using the following commands:

    .\appcmd.exe list apppool "AlvaoRestApi AppPool" /config
    .\appcmd.exe list apppool "AlvaoRestApiReports AppPool" /config

Set up MS Entra​

We need to create a new app registration in MS Entra that will be used just for authentication in Power BI.

  1. In App registrations - New registration, register an application:
    • Name: AlvaoRestApi Reports
  2. In AlvaoRestApi Reports – Expose an API
    • Set Application ID URI to public URL of the AlvaoRestApiReports app, for example, https://contoso.com/AlvaoRestApiReports.

      You need to verify your domain ownership in the Domain Names service first

    • Click Add a scope:

      • Name: Reports
      • Who can consent?: Admins and users
      • Admin consent display name: Alvao Reports
      • Admin consent description: Allows users to connect to Alvao Reports
      • State: Enabled
    • Click Add a client application:

      • ClientID: b52893c8-bc2e-47fc-918b-77022b299bbc
      • Authorized scopes: select the previously added scope

      This is a confidential client used in the Power BI service.

    • Click Add a client application:

      • ClientID: a672d62c-fc7b-4e81-a576-e60dc46e951d
      • Authorized scopes: select the previously added scope

      This is a public client used in Power BI Desktop and the gateway.

Finish the configuration​

  1. In the installation path of the AlvaoRestApi, create a new file appsettings.Reports.json with:

    • attribute AAD_ApplicationId set to the Application (client) ID of the AlvaoRestApi Reports app registration created in the previous steps.

    • attribute AAD_AdditionalAudience set to the Application ID URL from your app registration, for example:

      {
      "AAD_ApplicationId": "f3adada9-c73e-4b86-b30e-c86bc6ce0a93",
      "AAD_AdditionalAudience": "https://contoso.com/AlvaoRestApiReports"
      }
  2. Open AlvaoRestApiReports/v1/systemSettings (for example, https://contoso.com/AlvaoRestApiReports/v1/systemSettings) in a browser and check that addClientId in the response is set to AAD_ApplicationId from the previous step.

  3. Do the same check for /AlvaoRestApi. It should return the clientId set in the AzureApplicationId property.

Load data to Power BI report​

Follow the on-premises procedure in Setting up Power BI reports, and connect your report to the AlvaoRestApiReports app (for example, https://contoso.com/AlvaoRestApiReports) created in the previous steps.