From 24c6dfe3641094a8450bc4f51bc34dd61f933382 Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Mon, 17 Jul 2023 13:39:36 -0500 Subject: [PATCH 1/4] Updated B2C yarn bulid policies command --- .github/workflows/b2c-build-and-deploy.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/b2c-build-and-deploy.yaml b/.github/workflows/b2c-build-and-deploy.yaml index 50203bf6..df2c4630 100644 --- a/.github/workflows/b2c-build-and-deploy.yaml +++ b/.github/workflows/b2c-build-and-deploy.yaml @@ -101,14 +101,12 @@ jobs: environmentKeyVault: ${{ inputs.environmentKeyVault }} - name: Get Fresh Packages - shell: pwsh run: | yarn install - name: Build Policies - shell: pwsh run: | - yarn build:${{ inputs.environment }} + yarn generate - name: Upload TrustFrameworkBase Policy uses: Andrews-McMeel-Universal/deploy-trustframework-policy@v5 @@ -118,7 +116,7 @@ jobs: tenant: ${{ inputs.azureB2CDomain }} clientId: ${{ secrets.azureB2CClientId }} clientSecret: ${{ secrets.azureB2CClientSecret }} - verbose: ${{ secrets.ACTIONS_STEP_DEBUG || env.ACTIONS_STEP_DEBUG || 'false' }} + verbose: ${{ secrets.ACTIONS_STEP_DEBUG || vars.ACTIONS_STEP_DEBUG || env.ACTIONS_STEP_DEBUG || 'false' }} - name: Upload Auth Assets uses: azure/powershell@v1 From dffa49442d274622b8cd4129f7e508c934927add Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Mon, 17 Jul 2023 14:13:09 -0500 Subject: [PATCH 2/4] Update dir paths --- .github/workflows/b2c-build-and-deploy.yaml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/b2c-build-and-deploy.yaml b/.github/workflows/b2c-build-and-deploy.yaml index df2c4630..ddfd7e05 100644 --- a/.github/workflows/b2c-build-and-deploy.yaml +++ b/.github/workflows/b2c-build-and-deploy.yaml @@ -11,10 +11,6 @@ on: required: false type: string description: "AKS Key vault." - azureB2CProductShortName: - required: true - type: string - description: "Short name of the B2C product." azureB2CDomain: required: true type: string @@ -27,10 +23,6 @@ on: required: true type: string description: "ID of the B2C product." - azureB2CProductName: - required: true - type: string - description: "Name of the B2C product." secrets: azureCredentials: required: true @@ -111,7 +103,7 @@ jobs: - name: Upload TrustFrameworkBase Policy uses: Andrews-McMeel-Universal/deploy-trustframework-policy@v5 with: - folder: "./dist/${{ inputs.azureB2CProductName }}/custom-policies" + folder: "./dist/custom-policies" files: "B2C_1A_${{ inputs.azureB2CProductId }}_SIGNINSIGNOUT_BASE.xml,B2C_1A_${{ inputs.azureB2CProductId }}_SIGNINSIGNOUT_EXTENSIONS.xml,B2C_1A_${{ inputs.azureB2CProductId }}_SIGNINSIGNOUT_POLICIES.xml,B2C_1A_${{ inputs.azureB2CProductId }}_IMPERSONATION.xml" tenant: ${{ inputs.azureB2CDomain }} clientId: ${{ secrets.azureB2CClientId }} @@ -122,7 +114,6 @@ jobs: uses: azure/powershell@v1 with: inlineScript: | - $BasePath = Get-Location - $DistPath = Join-Path $BasePath "dist" - ./deployments/scripts/Deploy-B2C_Auth.ps1 -StorageAccountName "amuauthassets" -StorageAccountKey "${{ secrets.storageAccountKey }}" -ContainerName "${{ inputs.environment }}-assets" -DistPath $DistPath -ProductPath "${{ inputs.azureB2CProductShortName }}" + $DistPath = Join-Path (Get-Location) "dist" + ./deployments/scripts/Deploy-B2C-Auth.ps1 -StorageAccountName "amuauthassets" -StorageAccountKey "${{ secrets.storageAccountKey }}" -ContainerName "${{ inputs.environment }}-assets" -DistPath $DistPath azPSVersion: "latest" From fd7e2519b59e40935b1f010e4bfad7c9202b1f9f Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Wed, 19 Jul 2023 13:51:09 -0500 Subject: [PATCH 3/4] Switch back to b2c deploy policy action --- .github/workflows/b2c-build-and-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/b2c-build-and-deploy.yaml b/.github/workflows/b2c-build-and-deploy.yaml index ddfd7e05..59b366b3 100644 --- a/.github/workflows/b2c-build-and-deploy.yaml +++ b/.github/workflows/b2c-build-and-deploy.yaml @@ -101,7 +101,7 @@ jobs: yarn generate - name: Upload TrustFrameworkBase Policy - uses: Andrews-McMeel-Universal/deploy-trustframework-policy@v5 + uses: azure-ad-b2c/deploy-trustframework-policy@v5.3 with: folder: "./dist/custom-policies" files: "B2C_1A_${{ inputs.azureB2CProductId }}_SIGNINSIGNOUT_BASE.xml,B2C_1A_${{ inputs.azureB2CProductId }}_SIGNINSIGNOUT_EXTENSIONS.xml,B2C_1A_${{ inputs.azureB2CProductId }}_SIGNINSIGNOUT_POLICIES.xml,B2C_1A_${{ inputs.azureB2CProductId }}_IMPERSONATION.xml" From a70586b81365c1319a63c770bf88936355371c06 Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Wed, 19 Jul 2023 14:00:12 -0500 Subject: [PATCH 4/4] Updated B2C instructions in README --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 04bf5deb..67117924 100644 --- a/README.md +++ b/README.md @@ -185,17 +185,20 @@ jobs: ```YAML Example jobs: - b2c-build-and-deploy: + deploy: + name: B2C Deploy uses: Andrews-McMeel-Universal/reusable_workflows/.github/workflows/b2c-build-and-deploy.yaml@2 with: environment: development - azureB2CProductName: appname + environmentKeyVault: ${{ vars.AZURE_KEYVAULT_PREFIX }}-development azureB2CDomain: developmentamub2c.onmicrosoft.com + azureB2CProductURL: development.appname.com + azureB2CProductId: APPID secrets: azureCredentials: ${{ secrets.AZURE_CREDENTIALS }} - storageAccountKey: ${{ secrets.STORAGEACCOUNT_KEY }} - azureB2CClientId: ${{ secrets.B2C_CLIENT_ID }} - azureB2CClientSecret: ${{ secrets.B2C_CLIENT_SECRET }} + storageAccountKey: ${{ secrets.AZURE_B2C_STORAGE_ACCOUNT_KEY }} + azureB2CClientId: ${{ secrets.AZURE_B2C_CLIENT_ID }} + azureB2CClientSecret: ${{ secrets.AZURE_B2C_CLIENT_SECRET }} ``` ### Purge CDN