In my [Step by Step] Power Pages : Set up Azure AD B2C article, I have explained how to configure Azure AD B2C as an Identity Provider.

If you review the process, you will see that you need to configure the following details in the Configure Identity Providers pane.

These settings are unique to each website and are stored as Site Settings records. They need to be manually updated for each website.

With the new Environment variables for site settings , we can eliminate the manual effort of updating settings for each website after deployment.

By configuring an Environment Variable and mapping it in Site Settings you can easily update values within the same environment or when migrating solutions to other environments.

Lets see how to map Environment Variables in Site Settings.

Prerequisites:

To use environment variables with site settings, you must meet the following prerequisites:

  • The site must be within an environment where the enhanced data model is enabled.
  • The following versions are required for environment variables to work in Power Pages:
    • Dataverse server version 9.2.25013.x
    • Power Pages package version 1.0.2501.x
    • Power Pages runtime version 9.7.1.x

Use environment variables in site settings

To use environment variables in site settings:

  • Open the Power Pages Management app and go to Site Settings.
  • Select the specific site setting you want to configure with an environment variable.
  • Select the source as Environment Variable.
  • In the Azure AD B2C scenario, open the Site Setting record created during configuration and change the Source as Environment Variable. Then, create Environment Variable for each setting that needs to be modified in downstream environments.

Once you defined the Environment Variables and mapped them with Site Settings, follow below steps to update values in down stream environments.

Update Environment Variables values:

  • You can also refer the Environment Variable instead of hard coded value in from Power Pages Studio using {X} option.

🙂

Advertisements
Advertisements

Leave a comment