From 6254bb725620c0ce51494d0d08228eb731878d81 Mon Sep 17 00:00:00 2001 From: Marvin Buss <34542414+marvinbuss@users.noreply.github.com> Date: Wed, 6 Oct 2021 09:25:15 +0200 Subject: [PATCH] Added What-If Controlled Rollout (#185) * Added What-If Controlled Rollout * updated location in ado workflow --- .../dataManagementZoneDeployment.yml | 30 ++++++++++++++++++- .../dataManagementZoneDeployment.yml | 18 +++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/.ado/workflows/dataManagementZoneDeployment.yml b/.ado/workflows/dataManagementZoneDeployment.yml index 7897eb0..b64d91d 100644 --- a/.ado/workflows/dataManagementZoneDeployment.yml +++ b/.ado/workflows/dataManagementZoneDeployment.yml @@ -22,7 +22,7 @@ pr: variables: AZURE_RESOURCE_MANAGER_CONNECTION_NAME: "data-management-zone-service-connection" # Update to '{yourResourceManagerConnectionName}' AZURE_SUBSCRIPTION_ID: "17588eb2-2943-461a-ab3f-00a3ceac3112" # Update to '{yourDataManagementZoneSubscriptionId}' - AZURE_LOCATION: "North Europe" # Update to '{yourRegionName}' + AZURE_LOCATION: "northeurope" # Update to '{yourRegionName}' stages: - stage: Validation @@ -61,6 +61,34 @@ stages: csmParametersFile: "$(System.DefaultWorkingDirectory)/infra/params.dev.json" deploymentMode: "Validation" + # Deploy Data Management Zone - what-if + - task: AzureCLI@2 + name: data_management_zone_whatif + displayName: Deploy Data Management Zone - what-if + enabled: true + continueOnError: false + inputs: + azureSubscription: ${{ variables.AZURE_RESOURCE_MANAGER_CONNECTION_NAME }} + scriptType: pscore + scriptLocation: inlineScript + inlineScript: | + az account set ` + --subscription ${{ variables.AZURE_SUBSCRIPTION_ID }} + + az deployment sub what-if ` + --location ${{ variables.AZURE_LOCATION }} ` + --subscription ${{ variables.AZURE_SUBSCRIPTION_ID }} ` + --exclude-change-types Ignore NoChange Unsupported ` + --template-file "$(System.DefaultWorkingDirectory)/infra/main.json" ` + --parameters "$(System.DefaultWorkingDirectory)/infra/params.dev.json" ` + --result-format "FullResourcePayloads" + + powerShellErrorActionPreference: "stop" + addSpnToEnvironment: false + useGlobalConfig: false + failOnStandardError: false + powerShellIgnoreLASTEXITCODE: false + - stage: Deployment displayName: "Deployment of IaC templates" dependsOn: Validation diff --git a/.github/workflows/dataManagementZoneDeployment.yml b/.github/workflows/dataManagementZoneDeployment.yml index 817e6f1..7a5cdb5 100644 --- a/.github/workflows/dataManagementZoneDeployment.yml +++ b/.github/workflows/dataManagementZoneDeployment.yml @@ -51,6 +51,24 @@ jobs: deploymentMode: Validate failOnStdErr: false + # Deploy Data Management Zone - what-if + - name: Deploy Data Management Zone - what-if + id: data_management_zone_whatif + uses: azure/CLI@v1 + with: + azcliversion: "latest" + inlineScript: | + az account set \ + --subscription ${{ env.AZURE_SUBSCRIPTION_ID }} + + az deployment sub what-if \ + --location ${{ env.AZURE_LOCATION }} \ + --subscription ${{ env.AZURE_SUBSCRIPTION_ID }} \ + --exclude-change-types Ignore NoChange Unsupported \ + --template-file "${GITHUB_WORKSPACE}/infra/main.json" \ + --parameters "${GITHUB_WORKSPACE}/infra/params.dev.json" \ + --result-format "FullResourcePayloads" + # Log out from Azure - name: Log out from Azure id: azure_logout