Skip to content
code

GitHub Action

Deploy B2C Custom Policy

v6.0.0 Latest version

Deploy B2C Custom Policy

code

Deploy B2C Custom Policy

A PowerShell-based GitHub Action for deploying Azure AD B2C policies using the Microsoft Graph API

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Deploy B2C Custom Policy

uses: Andrews-McMeel-Universal/[email protected]

Learn more about this action in Andrews-McMeel-Universal/deploy-trustframework-policy

Choose a version

GitHub Action for Deploying Azure AD B2C custom policies

This is a fork of the azure-ad-b2c/deploy-trustframework-policy repository to convert it into a PowerShell-based composite action to account for better error handling.

Use this GitHub Action to deploy an Azure AD B2C custom policy into your Azure Active Directory B2C tenant using the Microsoft Graph API. If the policy does not yet exist, it will be created. If the policy already exists, it will be replaced.

For more information, see Deploy Azure AD B2C custom policy with GitHub actions.

Getting Started

git clone https://github.com/Andrews-McMeel-Universal/deploy-trustframework-policy

Inputs

Variable Description Required [Default]
folder The folder where the custom policies files are stored x N/A
files Comma delimiter list of policy files x N/A
tenant The full Azure AD B2C tenant name (for example, contoso.onmicrosoft.com) or GUID x N/A
clientId The application Client ID for a service principal which will be used to authenticate to the Microsoft Graph x N/A
clientSecret The application Secret for a service principal which will be used to authenticate to the Microsoft Graph x N/A
renumberSteps Renumber the orchestration steps. Possible values: true, or false false
addAppInsightsStep Add App Insights orchestration steps to the the user journeys. false
verbose Log level verbose. false

Sample workflow

on: push

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Upload TrustFrameworkBase Policy
        uses: azure-ad-b2c/deploy-trustframework-policy@v5
        with:
          folder: "./Policies"
          files: "TrustFrameworkBase.xml,TrustFrameworkExtensions.xml,SignUpOrSignin.xml"
          tenant: my-tenant.onmicrosoft.com
          clientId: 00000000-0000-0000-0000-000000000000
          clientSecret: ${{ secrets.clientSecret }}
          renumberSteps: false

Reusable Workflow Integration

Once a pull request is merged into main, you can create a new release to use it as a reusable workflow. To create a new release, follow the instructions in this guide: Creating a Release

Update Major Release

Once you've created a new release, you can use the Update Major Release Workflow to automatically update the major release tag for the repository.

  1. Navigate to the Update Major Release workflow.
  2. Press "Run workflow" on the right-hand side of the page.
  3. Specify the tag to create a major release for and what the major release will be.
  4. Click "Run workflow"