Skip to content

Commit

Permalink
Added What-If Controlled Rollout (#92)
Browse files Browse the repository at this point in the history
* Added What-If Controlled Rollout

* updated pwsh execution

* excluded change type

* updated ado workflow location

* updated domain to product - linting

* updated service connection name
  • Loading branch information
marvinbuss authored Oct 6, 2021
1 parent fb9830e commit 8b011ce
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 9 deletions.
36 changes: 32 additions & 4 deletions .ado/workflows/dataProductDeployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ pr:
- .ado/workflows/dataProductDeployment.yml

variables:
AZURE_RESOURCE_MANAGER_CONNECTION_NAME: "domain-product-service-connection" # Update to '{resourceManagerConnectionName}'
AZURE_SUBSCRIPTION_ID: "2150d511-458f-43b9-8691-6819ba2e6c7b" # Update to '{dataLandingZoneSubscriptionId}'
AZURE_RESOURCE_GROUP_NAME: "dlz01-dev-dp001" # Update to '{dataLandingZoneName}-rg'
AZURE_LOCATION: "North Europe" # Update to '{regionName}'
AZURE_RESOURCE_MANAGER_CONNECTION_NAME: "integration-product-service-connection" # Update to '{resourceManagerConnectionName}'
AZURE_SUBSCRIPTION_ID: "2150d511-458f-43b9-8691-6819ba2e6c7b" # Update to '{dataLandingZoneSubscriptionId}'
AZURE_RESOURCE_GROUP_NAME: "dlz01-dev-dp001" # Update to '{dataLandingZoneName}-rg'
AZURE_LOCATION: "northeurope" # Update to '{regionName}'

stages:
- stage: Validation
Expand Down Expand Up @@ -80,6 +80,34 @@ stages:
overrideParameters: >
-administratorPassword "$(password)"
# Deploy Data Product - what-if
- task: AzureCLI@2
name: data_product_whatif
displayName: Deploy Data Product - 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 group what-if `
--resource-group ${{ variables.AZURE_RESOURCE_GROUP_NAME }} `
--exclude-change-types Ignore NoChange Unsupported `
--mode "Incremental" `
--template-file "$(System.DefaultWorkingDirectory)/infra/main.json" `
--parameters "$(System.DefaultWorkingDirectory)/infra/params.dev.json" administratorPassword="$(password)" `
--result-format "FullResourcePayloads"
powerShellErrorActionPreference: "stop"
addSpnToEnvironment: false
useGlobalConfig: false
failOnStandardError: false
powerShellIgnoreLASTEXITCODE: false

- stage: Deployment
displayName: "Deployment of IaC templates"
dependsOn: Validation
Expand Down
28 changes: 23 additions & 5 deletions .github/workflows/dataProductDeployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
id: generate_password_001
run: |
echo "Generating Password"
pwsh $GITHUB_WORKSPACE/code/GeneratePassword.ps1 -GitHub
pwsh "${GITHUB_WORKSPACE}/code/GeneratePassword.ps1" -GitHub
# Deploy Data Product - validation
- name: Deploy Data Product - validation
Expand All @@ -59,6 +59,24 @@ jobs:
deploymentMode: Validate
failOnStdErr: false

# Deploy Data Product - what-if
- name: Deploy Data Product - what-if
id: data_product_whatif
uses: azure/CLI@v1
with:
azcliversion: "latest"
inlineScript: |
az account set \
--subscription ${{ env.AZURE_SUBSCRIPTION_ID }}
az deployment group what-if \
--resource-group ${{ env.AZURE_RESOURCE_GROUP_NAME }} \
--exclude-change-types Ignore NoChange Unsupported \
--mode "Incremental" \
--template-file "${GITHUB_WORKSPACE}/infra/main.json" \
--parameters "${GITHUB_WORKSPACE}/infra/params.dev.json" administratorPassword="${{ steps.generate_password_001.outputs.password }}" \
--result-format "FullResourcePayloads"
# Log out from Azure
- name: Log out from Azure
id: azure_logout
Expand Down Expand Up @@ -93,11 +111,11 @@ jobs:
id: generate_password_001
run: |
echo "Generating Password"
pwsh $GITHUB_WORKSPACE/code/GeneratePassword.ps1 -GitHub
pwsh "${GITHUB_WORKSPACE}/code/GeneratePassword.ps1" -GitHub
# Deploy Data Domain
- name: Deploy Data Domain
id: data_domain_deployment
# Deploy Data Product
- name: Deploy Data Product
id: data_product_deployment
uses: azure/arm-deploy@v1
with:
scope: resourcegroup
Expand Down

0 comments on commit 8b011ce

Please sign in to comment.