From 647158bc7c6cdcbce1f2beafe802061d35d98a87 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 4 Oct 2021 14:28:18 -0400 Subject: [PATCH 001/132] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..3f4625a51 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,19 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- vidbala-cicd + +pool: + vmImage: ubuntu-latest + +steps: +- script: echo Hello, world! + displayName: 'Run a one-line script' + +- script: | + echo Add other tasks to build, test, and deploy your project. + echo See https://aka.ms/yaml + displayName: 'Run a multi-line script' From 06e035a71fb7f8e4eeb098c120f36f5cbcec0c30 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 4 Oct 2021 20:45:25 -0400 Subject: [PATCH 002/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3f4625a51..a027308ff 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,16 +4,37 @@ # https://aka.ms/yaml trigger: -- vidbala-cicd +- main pool: vmImage: ubuntu-latest -steps: -- script: echo Hello, world! - displayName: 'Run a one-line script' - -- script: | - echo Add other tasks to build, test, and deploy your project. - echo See https://aka.ms/yaml - displayName: 'Run a multi-line script' +variables: + ServiceConnectionName: $(CAzureConnection) + GServiceConnectionName: $(GAzureConnection) + +jobs: +- job: CommercialCloud + steps: + - task: AzureCLI@2 + inputs: + azureSubscription: $(ServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub create \ + --name $(DeploymentName) \ + --location $(Location) \ + --template-file $(TemplateFile) +- job: GovCloud + steps: + - task: AzureCLI@2 + inputs: + azureSubscription: $(GServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub create \ + --name $(DeploymentName) \ + --location $(GLocation) \ + --template-file $(TemplateFile) \ No newline at end of file From 69f534ff6d76bb8c62c6c410177d2a72c743f1a4 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 4 Oct 2021 20:56:33 -0400 Subject: [PATCH 003/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a027308ff..4dd857e23 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,7 @@ # https://aka.ms/yaml trigger: -- main +- mlz-azure-pipelines pool: vmImage: ubuntu-latest From 9d6490679131e71d8a08e78581a1bf666915e789 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 6 Oct 2021 17:16:16 -0400 Subject: [PATCH 004/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4dd857e23..a35e4ffae 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,7 +14,7 @@ variables: GServiceConnectionName: $(GAzureConnection) jobs: -- job: CommercialCloud +- job: CommercialCloud-bicep steps: - task: AzureCLI@2 inputs: @@ -26,7 +26,7 @@ jobs: --name $(DeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) -- job: GovCloud +- job: GovCloud-bicep steps: - task: AzureCLI@2 inputs: @@ -37,4 +37,24 @@ jobs: az deployment sub create \ --name $(DeploymentName) \ --location $(GLocation) \ - --template-file $(TemplateFile) \ No newline at end of file + --template-file $(TemplateFile) +- job: CommercialCloud-TF + steps: + - task: TerraformInstaller@0 + inputs: + terraformVersion: '0.12.3' + - task: TerraformTaskV2@2 + inputs: + provider: 'azurerm' + command: 'init' + backendServiceArm: 'CAzureConnection' + backendAzureRmResourceGroupName: 'mlzcicdtf' + backendAzureRmStorageAccountName: 'mlzcicdtfstore' + backendAzureRmContainerName: 'mlzcicdtfstorcontainer' + backendAzureRmKey: 'tf/terraform.tfstate' + - task: TerraformTaskV2@2 + inputs: + provider: 'azurerm' + command: 'apply' + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + environmentServiceNameAzureRM: 'CAzureConnection' \ No newline at end of file From 4228369b03dc2bd7e2cbd7253b16b78e87c60378 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 6 Oct 2021 17:17:54 -0400 Subject: [PATCH 005/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a35e4ffae..978e79a00 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,7 +14,7 @@ variables: GServiceConnectionName: $(GAzureConnection) jobs: -- job: CommercialCloud-bicep +- job: CommercialCloud_bicep steps: - task: AzureCLI@2 inputs: @@ -26,7 +26,7 @@ jobs: --name $(DeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) -- job: GovCloud-bicep +- job: GovCloud_bicep steps: - task: AzureCLI@2 inputs: @@ -38,7 +38,7 @@ jobs: --name $(DeploymentName) \ --location $(GLocation) \ --template-file $(TemplateFile) -- job: CommercialCloud-TF +- job: CommercialCloud_TF steps: - task: TerraformInstaller@0 inputs: From 75b76d8ccf4cd83726d4bf973ca34cee7b062fa9 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 6 Oct 2021 17:23:06 -0400 Subject: [PATCH 006/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 978e79a00..b98458e42 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,7 +14,7 @@ variables: GServiceConnectionName: $(GAzureConnection) jobs: -- job: CommercialCloud_bicep +- job: biCommercialCloud steps: - task: AzureCLI@2 inputs: @@ -26,7 +26,7 @@ jobs: --name $(DeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) -- job: GovCloud_bicep +- job: biGovCloud steps: - task: AzureCLI@2 inputs: @@ -37,24 +37,4 @@ jobs: az deployment sub create \ --name $(DeploymentName) \ --location $(GLocation) \ - --template-file $(TemplateFile) -- job: CommercialCloud_TF - steps: - - task: TerraformInstaller@0 - inputs: - terraformVersion: '0.12.3' - - task: TerraformTaskV2@2 - inputs: - provider: 'azurerm' - command: 'init' - backendServiceArm: 'CAzureConnection' - backendAzureRmResourceGroupName: 'mlzcicdtf' - backendAzureRmStorageAccountName: 'mlzcicdtfstore' - backendAzureRmContainerName: 'mlzcicdtfstorcontainer' - backendAzureRmKey: 'tf/terraform.tfstate' - - task: TerraformTaskV2@2 - inputs: - provider: 'azurerm' - command: 'apply' - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - environmentServiceNameAzureRM: 'CAzureConnection' \ No newline at end of file + --template-file $(TemplateFile) \ No newline at end of file From aad6f375bb9b7939e151c211fe2c9773e8632798 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 6 Oct 2021 17:32:24 -0400 Subject: [PATCH 007/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b98458e42..fbaf874c1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -37,4 +37,18 @@ jobs: az deployment sub create \ --name $(DeploymentName) \ --location $(GLocation) \ - --template-file $(TemplateFile) \ No newline at end of file + --template-file $(TemplateFile) +- job: CommercialCloud_TF + steps: + - task: TerraformInstaller@0 + inputs: + terraformVersion: '0.12.3' + - task: TerraformTaskV2@2 + inputs: + provider: 'azurerm' + command: 'init' + backendServiceArm: 'CAzureConnection' + backendAzureRmResourceGroupName: 'mlzcicdtf' + backendAzureRmStorageAccountName: 'mlzcicdtfstore' + backendAzureRmContainerName: 'mlzcicdtfstorcontainer' + backendAzureRmKey: 'tf/terraform.tfstate' From e311e6195f53e8926dfaf4a29265682ef7d0f71a Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 6 Oct 2021 19:00:26 -0400 Subject: [PATCH 008/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fbaf874c1..47a5352b7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,7 +14,7 @@ variables: GServiceConnectionName: $(GAzureConnection) jobs: -- job: biCommercialCloud +- job: bicepCommercialCloud steps: - task: AzureCLI@2 inputs: @@ -23,10 +23,10 @@ jobs: scriptLocation: 'inlineScript' inlineScript: | az deployment sub create \ - --name $(DeploymentName) \ + --name $(bDeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) -- job: biGovCloud +- job: bicepGovCloud steps: - task: AzureCLI@2 inputs: @@ -35,20 +35,18 @@ jobs: scriptLocation: 'inlineScript' inlineScript: | az deployment sub create \ - --name $(DeploymentName) \ + --name $(bDeploymentName) \ --location $(GLocation) \ --template-file $(TemplateFile) - job: CommercialCloud_TF steps: - task: TerraformInstaller@0 inputs: - terraformVersion: '0.12.3' - - task: TerraformTaskV2@2 + terraformVersion: 'latest' + - task: AzureCLI@2 inputs: - provider: 'azurerm' - command: 'init' - backendServiceArm: 'CAzureConnection' - backendAzureRmResourceGroupName: 'mlzcicdtf' - backendAzureRmStorageAccountName: 'mlzcicdtfstore' - backendAzureRmContainerName: 'mlzcicdtfstorcontainer' - backendAzureRmKey: 'tf/terraform.tfstate' + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'terraform init' + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From c9b2279351bedccc457e473e934e1075f90401e3 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 6 Oct 2021 19:02:32 -0400 Subject: [PATCH 009/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 47a5352b7..252be6ef0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -42,7 +42,7 @@ jobs: steps: - task: TerraformInstaller@0 inputs: - terraformVersion: 'latest' + terraformVersion: '2.71.0' - task: AzureCLI@2 inputs: azureSubscription: 'CAzureConnection' From 88fdd5b8a823dead402c4187be24c8ae9d13c0cc Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 6 Oct 2021 19:07:17 -0400 Subject: [PATCH 010/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 252be6ef0..4b45e7dd6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -42,7 +42,7 @@ jobs: steps: - task: TerraformInstaller@0 inputs: - terraformVersion: '2.71.0' + terraformVersion: '1.0.8' - task: AzureCLI@2 inputs: azureSubscription: 'CAzureConnection' From c9a9cc44b965dc6e4d2b16ec00c63515dcef743f Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 6 Oct 2021 19:26:48 -0400 Subject: [PATCH 011/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4b45e7dd6..54dd7c118 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -50,3 +50,10 @@ jobs: scriptLocation: 'inlineScript' inlineScript: 'terraform init' workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + - task: AzureCLI@2 + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'terraform apply' + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From 1258e39f6f225ec0b81a1bd9826ca90b0d0fd690 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 6 Oct 2021 22:31:50 -0400 Subject: [PATCH 012/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 54dd7c118..8e78abed8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -55,5 +55,5 @@ jobs: azureSubscription: 'CAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' - inlineScript: 'terraform apply' + inlineScript: 'terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false' workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From be5c7f78bfea7ec9236c10659e61a73a610d9f97 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 7 Oct 2021 16:49:29 -0400 Subject: [PATCH 013/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8e78abed8..c00fd5e37 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -53,7 +53,36 @@ jobs: - task: AzureCLI@2 inputs: azureSubscription: 'CAzureConnection' + scriptType: 'batch' + scriptLocation: 'inlineScript' + inlineScript: | + $ export ARM_CLIENT_ID=$(ClientId) + $ export ARM_CLIENT_SECRET=$(ClientSecret) + $ export ARM_SUBSCRIPTION_ID=$(subId) + $ export ARM_TENANT_ID=$(tenantId) + terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' +- job: GovCloud_TF + steps: + - task: TerraformInstaller@0 + inputs: + terraformVersion: '1.0.8' + - task: AzureCLI@2 + inputs: + azureSubscription: 'GAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' - inlineScript: 'terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false' + inlineScript: 'terraform init' workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + - task: AzureCLI@2 + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'batch' + scriptLocation: 'inlineScript' + inlineScript: | + $ export ARM_CLIENT_ID=$(GClientId) + $ export ARM_CLIENT_SECRET=$(GClientSecret) + $ export ARM_SUBSCRIPTION_ID=$(GSubId) + $ export ARM_TENANT_ID=$(GTenantId) + terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' \ No newline at end of file From 2780f32ffa98eacc00101363a4e858625a66c691 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 7 Oct 2021 16:55:17 -0400 Subject: [PATCH 014/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c00fd5e37..6d9564d07 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -56,10 +56,10 @@ jobs: scriptType: 'batch' scriptLocation: 'inlineScript' inlineScript: | - $ export ARM_CLIENT_ID=$(ClientId) - $ export ARM_CLIENT_SECRET=$(ClientSecret) - $ export ARM_SUBSCRIPTION_ID=$(subId) - $ export ARM_TENANT_ID=$(tenantId) + $ export ARM_CLIENT_ID=$(ClientId) ` + $ export ARM_CLIENT_SECRET=$(ClientSecret) ` + $ export ARM_SUBSCRIPTION_ID=$(subId) ` + $ export ARM_TENANT_ID=$(tenantId) ` terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - job: GovCloud_TF @@ -80,9 +80,9 @@ jobs: scriptType: 'batch' scriptLocation: 'inlineScript' inlineScript: | - $ export ARM_CLIENT_ID=$(GClientId) - $ export ARM_CLIENT_SECRET=$(GClientSecret) - $ export ARM_SUBSCRIPTION_ID=$(GSubId) - $ export ARM_TENANT_ID=$(GTenantId) + $ export ARM_CLIENT_ID=$(GClientId) ` + $ export ARM_CLIENT_SECRET=$(GClientSecret) ` + $ export ARM_SUBSCRIPTION_ID=$(GSubId) ` + $ export ARM_TENANT_ID=$(GTenantId) ` terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' \ No newline at end of file From 2aae9cca6c54afef61aa579dd8c4e51107c934ef Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 7 Oct 2021 17:08:02 -0400 Subject: [PATCH 015/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6d9564d07..0efa0c1b4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -50,18 +50,15 @@ jobs: scriptLocation: 'inlineScript' inlineScript: 'terraform init' workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + addSpnToEnvironment: true - task: AzureCLI@2 inputs: azureSubscription: 'CAzureConnection' - scriptType: 'batch' + scriptType: 'bash' scriptLocation: 'inlineScript' - inlineScript: | - $ export ARM_CLIENT_ID=$(ClientId) ` - $ export ARM_CLIENT_SECRET=$(ClientSecret) ` - $ export ARM_SUBSCRIPTION_ID=$(subId) ` - $ export ARM_TENANT_ID=$(tenantId) ` - terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false + inlineScript: terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + addSpnToEnvironment: true - job: GovCloud_TF steps: - task: TerraformInstaller@0 @@ -77,12 +74,8 @@ jobs: - task: AzureCLI@2 inputs: azureSubscription: 'GAzureConnection' - scriptType: 'batch' + scriptType: 'bash' scriptLocation: 'inlineScript' - inlineScript: | - $ export ARM_CLIENT_ID=$(GClientId) ` - $ export ARM_CLIENT_SECRET=$(GClientSecret) ` - $ export ARM_SUBSCRIPTION_ID=$(GSubId) ` - $ export ARM_TENANT_ID=$(GTenantId) ` - terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' \ No newline at end of file + inlineScript: terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + addSpnToEnvironment: true \ No newline at end of file From ec033bbcb41a022d7091a9dfa2c04c4b035b81ef Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 7 Oct 2021 17:30:08 -0400 Subject: [PATCH 016/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0efa0c1b4..aaad82e5f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -48,17 +48,24 @@ jobs: azureSubscription: 'CAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' - inlineScript: 'terraform init' - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(ClientId) + export ARM_CLIENT_SECRET=$(ClientSecret) + export ARM_SUBSCRIPTION_ID=$(subId) + export ARM_TENANT_ID=$(tenantId) + 'terraform init' + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + - task: AzureCLI@2 inputs: azureSubscription: 'CAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' + addSpnToEnvironment: true inlineScript: terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - addSpnToEnvironment: true + - job: GovCloud_TF steps: - task: TerraformInstaller@0 @@ -69,13 +76,20 @@ jobs: azureSubscription: 'GAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' - inlineScript: 'terraform init' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) + export ARM_CLIENT_SECRET=$(GClientSecret) + export ARM_SUBSCRIPTION_ID=$(GSubId) + export ARM_TENANT_ID=$(GTenantId) + 'terraform init' workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - task: AzureCLI@2 inputs: azureSubscription: 'GAzureConnection' scriptType: 'bash' + addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - addSpnToEnvironment: true \ No newline at end of file + \ No newline at end of file From 20f2e94965586385b12a628e940fb61b55d0e8ae Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 7 Oct 2021 17:34:28 -0400 Subject: [PATCH 017/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index aaad82e5f..5fd1289f9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -44,9 +44,10 @@ jobs: inputs: terraformVersion: '1.0.8' - task: AzureCLI@2 + displayName: "Terraform" inputs: azureSubscription: 'CAzureConnection' - scriptType: 'bash' + scriptType: 'batch' scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | @@ -54,7 +55,7 @@ jobs: export ARM_CLIENT_SECRET=$(ClientSecret) export ARM_SUBSCRIPTION_ID=$(subId) export ARM_TENANT_ID=$(tenantId) - 'terraform init' + terraform init workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - task: AzureCLI@2 @@ -74,7 +75,7 @@ jobs: - task: AzureCLI@2 inputs: azureSubscription: 'GAzureConnection' - scriptType: 'bash' + scriptType: 'batch' scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | @@ -82,7 +83,7 @@ jobs: export ARM_CLIENT_SECRET=$(GClientSecret) export ARM_SUBSCRIPTION_ID=$(GSubId) export ARM_TENANT_ID=$(GTenantId) - 'terraform init' + terraform init workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - task: AzureCLI@2 inputs: From ad6820a7e09d9f595ad2ec50e25a4430f41af546 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 7 Oct 2021 17:36:40 -0400 Subject: [PATCH 018/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5fd1289f9..64cdc5d4a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,14 +47,14 @@ jobs: displayName: "Terraform" inputs: azureSubscription: 'CAzureConnection' - scriptType: 'batch' + scriptType: 'bash' scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | - export ARM_CLIENT_ID=$(ClientId) - export ARM_CLIENT_SECRET=$(ClientSecret) - export ARM_SUBSCRIPTION_ID=$(subId) - export ARM_TENANT_ID=$(tenantId) + export ARM_CLIENT_ID=$(ClientId) ` + export ARM_CLIENT_SECRET=$(ClientSecret) ` + export ARM_SUBSCRIPTION_ID=$(subId) ` + export ARM_TENANT_ID=$(tenantId) ` terraform init workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' @@ -75,14 +75,14 @@ jobs: - task: AzureCLI@2 inputs: azureSubscription: 'GAzureConnection' - scriptType: 'batch' + scriptType: 'bash' scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | - export ARM_CLIENT_ID=$(GClientId) - export ARM_CLIENT_SECRET=$(GClientSecret) - export ARM_SUBSCRIPTION_ID=$(GSubId) - export ARM_TENANT_ID=$(GTenantId) + export ARM_CLIENT_ID=$(GClientId) ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + export ARM_TENANT_ID=$(GTenantId) ` terraform init workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - task: AzureCLI@2 From 4cf7d69c2b9a55f5cdff1c7860823ec2612e06eb Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 7 Oct 2021 17:38:53 -0400 Subject: [PATCH 019/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 64cdc5d4a..130ef4a6f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -64,7 +64,12 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' addSpnToEnvironment: true - inlineScript: terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false + inlineScript: | + export ARM_CLIENT_ID=$(ClientId) ` + export ARM_CLIENT_SECRET=$(ClientSecret) ` + export ARM_SUBSCRIPTION_ID=$(subId) ` + export ARM_TENANT_ID=$(tenantId) ` + terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - job: GovCloud_TF @@ -91,6 +96,11 @@ jobs: scriptType: 'bash' addSpnToEnvironment: true scriptLocation: 'inlineScript' - inlineScript: terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + export ARM_TENANT_ID=$(GTenantId) ` + terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' \ No newline at end of file From 1f1ea00e155aeb1fb85ffb7c66fcf515b9fbb537 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 7 Oct 2021 17:46:27 -0400 Subject: [PATCH 020/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 130ef4a6f..f6664cb5c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -55,7 +55,8 @@ jobs: export ARM_CLIENT_SECRET=$(ClientSecret) ` export ARM_SUBSCRIPTION_ID=$(subId) ` export ARM_TENANT_ID=$(tenantId) ` - terraform init + terraform init ` + terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - task: AzureCLI@2 From 07b67033c5a60a95a6070ee5c547059e0834e562 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 7 Oct 2021 17:48:16 -0400 Subject: [PATCH 021/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f6664cb5c..baf05297c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -55,7 +55,7 @@ jobs: export ARM_CLIENT_SECRET=$(ClientSecret) ` export ARM_SUBSCRIPTION_ID=$(subId) ` export ARM_TENANT_ID=$(tenantId) ` - terraform init ` + terraform init terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From b2f0c3959a8d1089144d68224e8f35b552f88afa Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 7 Oct 2021 18:26:22 -0400 Subject: [PATCH 022/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 140 +++++++++++++++++++++++--------------------- 1 file changed, 72 insertions(+), 68 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index baf05297c..a743a18c0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,30 +14,30 @@ variables: GServiceConnectionName: $(GAzureConnection) jobs: -- job: bicepCommercialCloud - steps: - - task: AzureCLI@2 - inputs: - azureSubscription: $(ServiceConnectionName) - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: | - az deployment sub create \ - --name $(bDeploymentName) \ - --location $(Location) \ - --template-file $(TemplateFile) -- job: bicepGovCloud - steps: - - task: AzureCLI@2 - inputs: - azureSubscription: $(GServiceConnectionName) - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: | - az deployment sub create \ - --name $(bDeploymentName) \ - --location $(GLocation) \ - --template-file $(TemplateFile) +#- job: bicepCommercialCloud +# steps: +# - task: AzureCLI@2 +# inputs: +# azureSubscription: $(ServiceConnectionName) +# scriptType: 'bash' +# scriptLocation: 'inlineScript' +# inlineScript: | +# az deployment sub create \ +# --name $(bDeploymentName) \ +# --location $(Location) \ +# --template-file $(TemplateFile) +#- job: bicepGovCloud +# steps: +# - task: AzureCLI@2 +# inputs: +# azureSubscription: $(GServiceConnectionName) +# scriptType: 'bash' +# scriptLocation: 'inlineScript' +# inlineScript: | +# az deployment sub create \ +# --name $(bDeploymentName) \ +# --location $(GLocation) \ +# --template-file $(TemplateFile) - job: CommercialCloud_TF steps: - task: TerraformInstaller@0 @@ -52,56 +52,60 @@ jobs: addSpnToEnvironment: true inlineScript: | export ARM_CLIENT_ID=$(ClientId) ` + echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(ClientSecret) ` + echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(subId) ` + echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(tenantId) ` + echo $ARM_TENANT_ID ` terraform init terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - - task: AzureCLI@2 - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - addSpnToEnvironment: true - inlineScript: | - export ARM_CLIENT_ID=$(ClientId) ` - export ARM_CLIENT_SECRET=$(ClientSecret) ` - export ARM_SUBSCRIPTION_ID=$(subId) ` - export ARM_TENANT_ID=$(tenantId) ` - terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' +# - task: AzureCLI@2 +# inputs: +# azureSubscription: 'CAzureConnection' +# scriptType: 'bash' +# scriptLocation: 'inlineScript' +# addSpnToEnvironment: true +# inlineScript: | +# export ARM_CLIENT_ID=$(ClientId) ` +# export ARM_CLIENT_SECRET=$(ClientSecret) ` +# export ARM_SUBSCRIPTION_ID=$(subId) ` +# export ARM_TENANT_ID=$(tenantId) ` +# terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false +# workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' -- job: GovCloud_TF - steps: - - task: TerraformInstaller@0 - inputs: - terraformVersion: '1.0.8' - - task: AzureCLI@2 - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - addSpnToEnvironment: true - inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - export ARM_TENANT_ID=$(GTenantId) ` - terraform init - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - - task: AzureCLI@2 - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - addSpnToEnvironment: true - scriptLocation: 'inlineScript' - inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - export ARM_TENANT_ID=$(GTenantId) ` - terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' +#- job: GovCloud_TF +# steps: +# - task: TerraformInstaller@0 +# inputs: +# terraformVersion: '1.0.8' +# - task: AzureCLI@2 +# inputs: +# azureSubscription: 'GAzureConnection' +# scriptType: 'bash' +# scriptLocation: 'inlineScript' +# addSpnToEnvironment: true +# inlineScript: | +# export ARM_CLIENT_ID=$(GClientId) ` +# export ARM_CLIENT_SECRET=$(GClientSecret) ` +# export ARM_SUBSCRIPTION_ID=$(GSubId) ` +# export ARM_TENANT_ID=$(GTenantId) ` +# terraform init +# workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' +# - task: AzureCLI@2 +# inputs: +# azureSubscription: 'GAzureConnection' +# scriptType: 'bash' +# addSpnToEnvironment: true +# scriptLocation: 'inlineScript' +# inlineScript: | +# export ARM_CLIENT_ID=$(GClientId) ` +# export ARM_CLIENT_SECRET=$(GClientSecret) ` +# export ARM_SUBSCRIPTION_ID=$(GSubId) ` +# export ARM_TENANT_ID=$(GTenantId) ` +# terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false +# workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' \ No newline at end of file From c864f040e91385b8a3ec86618ba26ab926277b5e Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Fri, 8 Oct 2021 06:48:00 -0400 Subject: [PATCH 023/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a743a18c0..02d95a6e1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -53,7 +53,7 @@ jobs: inlineScript: | export ARM_CLIENT_ID=$(ClientId) ` echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(ClientSecret) ` + export ARM_CLIENT_SECRET=$(ClientSecret1) ` echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(subId) ` echo $ARM_SUBSCRIPTION_ID ` From c7b356e91b9e535c05686a1b100aec46bc817376 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 11:02:37 -0400 Subject: [PATCH 024/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 02d95a6e1..c792a8fdb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -60,6 +60,7 @@ jobs: export ARM_TENANT_ID=$(tenantId) ` echo $ARM_TENANT_ID ` terraform init + terraform plan terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From 0774ae0bd6bf108bb6350c2a57f55560d0728699 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 11:08:50 -0400 Subject: [PATCH 025/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c792a8fdb..02d95a6e1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -60,7 +60,6 @@ jobs: export ARM_TENANT_ID=$(tenantId) ` echo $ARM_TENANT_ID ` terraform init - terraform plan terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From 3aaed430b28f42da0f85f99339a93da51bdc2e90 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 15:20:58 -0400 Subject: [PATCH 026/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 02d95a6e1..bd7e292f0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -58,9 +58,10 @@ jobs: export ARM_SUBSCRIPTION_ID=$(subId) ` echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(tenantId) ` - echo $ARM_TENANT_ID ` - terraform init + echo $ARM_TENANT_ID ` + terraform init terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false + terraform destroy -auto-approve workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' # - task: AzureCLI@2 From 1a15d0698930c33aea21d681da8e8a4bd7d029d2 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 15:38:02 -0400 Subject: [PATCH 027/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bd7e292f0..13d2d4adc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -59,9 +59,10 @@ jobs: echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(tenantId) ` echo $ARM_TENANT_ID ` - terraform init + terraform init + terraform plan -var "hub_subid=$(subid)" -auto-approve -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false - terraform destroy -auto-approve + terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' # - task: AzureCLI@2 From 9f9ea25f0365e72ff7520f50c922e75ea9f13a16 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 15:46:34 -0400 Subject: [PATCH 028/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 13d2d4adc..e4090683b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -60,7 +60,7 @@ jobs: export ARM_TENANT_ID=$(tenantId) ` echo $ARM_TENANT_ID ` terraform init - terraform plan -var "hub_subid=$(subid)" -auto-approve -input=false + terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From dae982dc7f1d088e3f4b90ccdbd4e70cbb38054c Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 16:24:07 -0400 Subject: [PATCH 029/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e4090683b..c4780fbbc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -62,7 +62,7 @@ jobs: terraform init terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false - terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false +# terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' # - task: AzureCLI@2 From 746c630e07ebb440d86916eb5300a61e456c9e21 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 16:32:35 -0400 Subject: [PATCH 030/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c4780fbbc..73b978a21 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -59,6 +59,7 @@ jobs: echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(tenantId) ` echo $ARM_TENANT_ID ` + terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false terraform init terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false From fd29cec24e9cafd5f1939019356e72a637fdceb1 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 16:35:31 -0400 Subject: [PATCH 031/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 73b978a21..352d64182 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -59,8 +59,8 @@ jobs: echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(tenantId) ` echo $ARM_TENANT_ID ` - terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false terraform init + terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false # terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false From 8d697d4e9b8e8e285be878e1cd799103f9607ed9 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 17:04:53 -0400 Subject: [PATCH 032/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 352d64182..500022e72 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -51,6 +51,11 @@ jobs: scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | + az group delete --name hub-rg + az group delete --name identity-rg + az group delete --name operations-rg + az group delete --name sharedServices-rg + az group delete --name NetworkWatcherRG export ARM_CLIENT_ID=$(ClientId) ` echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(ClientSecret1) ` @@ -60,7 +65,6 @@ jobs: export ARM_TENANT_ID=$(tenantId) ` echo $ARM_TENANT_ID ` terraform init - terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false # terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false From 4aa66b9fffe6230775066cdc070176133b966eae Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 17:18:44 -0400 Subject: [PATCH 033/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 500022e72..5c593a070 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -51,11 +51,6 @@ jobs: scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | - az group delete --name hub-rg - az group delete --name identity-rg - az group delete --name operations-rg - az group delete --name sharedServices-rg - az group delete --name NetworkWatcherRG export ARM_CLIENT_ID=$(ClientId) ` echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(ClientSecret1) ` @@ -67,7 +62,8 @@ jobs: terraform init terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false -# terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false + sleep 30 + terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' # - task: AzureCLI@2 From 78d3223735c2d3bf0bdf5c0ca419c841ee4db41b Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 19:20:23 -0400 Subject: [PATCH 034/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 134 +++++++++++++++++++++----------------------- 1 file changed, 63 insertions(+), 71 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5c593a070..8f840d265 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,30 +14,30 @@ variables: GServiceConnectionName: $(GAzureConnection) jobs: -#- job: bicepCommercialCloud -# steps: -# - task: AzureCLI@2 -# inputs: -# azureSubscription: $(ServiceConnectionName) -# scriptType: 'bash' -# scriptLocation: 'inlineScript' -# inlineScript: | -# az deployment sub create \ -# --name $(bDeploymentName) \ -# --location $(Location) \ -# --template-file $(TemplateFile) -#- job: bicepGovCloud -# steps: -# - task: AzureCLI@2 -# inputs: -# azureSubscription: $(GServiceConnectionName) -# scriptType: 'bash' -# scriptLocation: 'inlineScript' -# inlineScript: | -# az deployment sub create \ -# --name $(bDeploymentName) \ -# --location $(GLocation) \ -# --template-file $(TemplateFile) +- job: bicepCommercialCloud + steps: + - task: AzureCLI@2 + inputs: + azureSubscription: $(ServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub create \ + --name $(bDeploymentName) \ + --location $(Location) \ + --template-file $(TemplateFile) +- job: bicepGovCloud + steps: + - task: AzureCLI@2 + inputs: + azureSubscription: $(GServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub create \ + --name $(bDeploymentName) \ + --location $(GLocation) \ + --template-file $(TemplateFile) - job: CommercialCloud_TF steps: - task: TerraformInstaller@0 @@ -65,50 +65,42 @@ jobs: sleep 30 terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - -# - task: AzureCLI@2 -# inputs: -# azureSubscription: 'CAzureConnection' -# scriptType: 'bash' -# scriptLocation: 'inlineScript' -# addSpnToEnvironment: true -# inlineScript: | -# export ARM_CLIENT_ID=$(ClientId) ` -# export ARM_CLIENT_SECRET=$(ClientSecret) ` -# export ARM_SUBSCRIPTION_ID=$(subId) ` -# export ARM_TENANT_ID=$(tenantId) ` -# terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false -# workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - -#- job: GovCloud_TF -# steps: -# - task: TerraformInstaller@0 -# inputs: -# terraformVersion: '1.0.8' -# - task: AzureCLI@2 -# inputs: -# azureSubscription: 'GAzureConnection' -# scriptType: 'bash' -# scriptLocation: 'inlineScript' -# addSpnToEnvironment: true -# inlineScript: | -# export ARM_CLIENT_ID=$(GClientId) ` -# export ARM_CLIENT_SECRET=$(GClientSecret) ` -# export ARM_SUBSCRIPTION_ID=$(GSubId) ` -# export ARM_TENANT_ID=$(GTenantId) ` -# terraform init -# workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' -# - task: AzureCLI@2 -# inputs: -# azureSubscription: 'GAzureConnection' -# scriptType: 'bash' -# addSpnToEnvironment: true -# scriptLocation: 'inlineScript' -# inlineScript: | -# export ARM_CLIENT_ID=$(GClientId) ` -# export ARM_CLIENT_SECRET=$(GClientSecret) ` -# export ARM_SUBSCRIPTION_ID=$(GSubId) ` -# export ARM_TENANT_ID=$(GTenantId) ` -# terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false -# workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - \ No newline at end of file +- job: GovCloud_TF + steps: + - task: TerraformInstaller@0 + inputs: + terraformVersion: '1.0.8' + - task: AzureCLI@2 + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + export ARM_TENANT_ID=$(GTenantId) ` + terraform init + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + - task: AzureCLI@2 + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + addSpnToEnvironment: true + scriptLocation: 'inlineScript' + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) ` + echo $ARM_CLIENT_ID ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + echo $ARM_CLIENT_SECRET ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + echo $ARM_SUBSCRIPTION_ID ` + export ARM_TENANT_ID=$(GTenantId) ` + echo $ARM_TENANT_ID ` + terraform init + terraform plan -var "hub_subid=$(GSubid)" -input=false + terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false + sleep 30 + terraform destroy -var "hub_subid=$(GSubid)" -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From f156faba1406586bf69864f4304c1d5f00c4e742 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 19:31:17 -0400 Subject: [PATCH 035/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8f840d265..6b56fd754 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,6 +16,12 @@ variables: jobs: - job: bicepCommercialCloud steps: + - task: AzureCLI@2 + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - task: AzureCLI@2 inputs: azureSubscription: $(ServiceConnectionName) @@ -28,6 +34,12 @@ jobs: --template-file $(TemplateFile) - job: bicepGovCloud steps: + - task: AzureCLI@2 + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - task: AzureCLI@2 inputs: azureSubscription: $(GServiceConnectionName) From 367162f41f470d815ee5a3634b78479475583082 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 19:36:37 -0400 Subject: [PATCH 036/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 53 ++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6b56fd754..9f08fcb22 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -52,12 +52,23 @@ jobs: --template-file $(TemplateFile) - job: CommercialCloud_TF steps: - - task: TerraformInstaller@0 - inputs: + - task: AzureCLI@2 + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az group delete --name hub-rg -y + az group delete --name identity-rg -y + az group delete --name operations-rg -y + az group delete --name sharedServices-rg -y + az group delete --name NetworkWatcherRG -y + - task: TerraformInstaller@0 + inputs: terraformVersion: '1.0.8' - - task: AzureCLI@2 - displayName: "Terraform" - inputs: + - task: AzureCLI@2 + displayName: "Terraform" + inputs: azureSubscription: 'CAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' @@ -79,24 +90,22 @@ jobs: workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - job: GovCloud_TF steps: - - task: TerraformInstaller@0 - inputs: + - task: AzureCLI@2 + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az group delete --name hub-rg -y + az group delete --name identity-rg -y + az group delete --name operations-rg -y + az group delete --name sharedServices-rg -y + az group delete --name NetworkWatcherRG -y + - task: TerraformInstaller@0 + inputs: terraformVersion: '1.0.8' - - task: AzureCLI@2 - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - addSpnToEnvironment: true - inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - export ARM_TENANT_ID=$(GTenantId) ` - terraform init - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - - task: AzureCLI@2 - inputs: + - task: AzureCLI@2 + inputs: azureSubscription: 'GAzureConnection' scriptType: 'bash' addSpnToEnvironment: true From 2aea8b3af545292535a67aae0dc3a0c29334ad04 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 12 Oct 2021 19:52:00 -0400 Subject: [PATCH 037/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9f08fcb22..cbffe9c69 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,12 +17,14 @@ jobs: - job: bicepCommercialCloud steps: - task: AzureCLI@2 + displayName: "Cleanup Resources" inputs: azureSubscription: 'CAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - task: AzureCLI@2 + displayName: "Deploy MLZ Bicep" inputs: azureSubscription: $(ServiceConnectionName) scriptType: 'bash' @@ -35,12 +37,14 @@ jobs: - job: bicepGovCloud steps: - task: AzureCLI@2 + displayName: "Cleanup Resources" inputs: azureSubscription: 'GAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - task: AzureCLI@2 + displayName: "Deploy MLZ Bicep" inputs: azureSubscription: $(GServiceConnectionName) scriptType: 'bash' @@ -53,6 +57,7 @@ jobs: - job: CommercialCloud_TF steps: - task: AzureCLI@2 + displayName: "Cleanup Resources" inputs: azureSubscription: 'CAzureConnection' scriptType: 'bash' @@ -67,7 +72,7 @@ jobs: inputs: terraformVersion: '1.0.8' - task: AzureCLI@2 - displayName: "Terraform" + displayName: "Deploy MLZ Terraform" inputs: azureSubscription: 'CAzureConnection' scriptType: 'bash' @@ -91,6 +96,7 @@ jobs: - job: GovCloud_TF steps: - task: AzureCLI@2 + displayName: "Cleanup Resources" inputs: azureSubscription: 'GAzureConnection' scriptType: 'bash' @@ -105,6 +111,7 @@ jobs: inputs: terraformVersion: '1.0.8' - task: AzureCLI@2 + displayName: "Deploy MLZ Terraform" inputs: azureSubscription: 'GAzureConnection' scriptType: 'bash' From 7148088649fd640bc37b7c8712d2557249a5d8f4 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 13 Oct 2021 09:46:59 -0400 Subject: [PATCH 038/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cbffe9c69..b54440482 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -118,7 +118,8 @@ jobs: addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` + export ARM_ENVIRONMENT=$(CloudEnv) ` + export ARM_CLIENT_ID=$(GClientId) ` echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(GClientSecret) ` echo $ARM_CLIENT_SECRET ` From bb9d75fd07af31e23ec64474cdd13a01085cfc2b Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 13 Oct 2021 13:16:56 -0400 Subject: [PATCH 039/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b54440482..6dacf38be 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -118,7 +118,6 @@ jobs: addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: | - export ARM_ENVIRONMENT=$(CloudEnv) ` export ARM_CLIENT_ID=$(GClientId) ` echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(GClientSecret) ` @@ -126,10 +125,12 @@ jobs: export ARM_SUBSCRIPTION_ID=$(GSubId) ` echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(GTenantId) ` - echo $ARM_TENANT_ID ` - terraform init - terraform plan -var "hub_subid=$(GSubid)" -input=false - terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false + echo $ARM_TENANT_ID ` + export ARM_ENVIRONMENT=$(CloudEnv) ` + echo $ARM_ENVIRONMENT ` + terraform init + terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false + terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false sleep 30 terraform destroy -var "hub_subid=$(GSubid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From 95117e8c6b566f4dc4e55688075418e6ac9c8077 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 14 Oct 2021 11:33:56 -0400 Subject: [PATCH 040/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6dacf38be..0372a8197 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,6 +16,12 @@ variables: jobs: - job: bicepCommercialCloud steps: + - task: AzureCLI@2 + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' - task: AzureCLI@2 displayName: "Cleanup Resources" inputs: @@ -34,8 +40,16 @@ jobs: --name $(bDeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) + - job: bicepGovCloud steps: + - task: AzureCLI@2 + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' + - task: AzureCLI@2 displayName: "Cleanup Resources" inputs: @@ -111,6 +125,7 @@ jobs: inputs: terraformVersion: '1.0.8' - task: AzureCLI@2 + name: TerraformApplyGov displayName: "Deploy MLZ Terraform" inputs: azureSubscription: 'GAzureConnection' @@ -133,4 +148,4 @@ jobs: terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false sleep 30 terraform destroy -var "hub_subid=$(GSubid)" -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From f7f4172429a4da053402f85ed7e1e51f68b7a4c0 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 14 Oct 2021 15:09:55 -0400 Subject: [PATCH 041/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0372a8197..d0a6aaf87 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -70,18 +70,18 @@ jobs: --template-file $(TemplateFile) - job: CommercialCloud_TF steps: - - task: AzureCLI@2 - displayName: "Cleanup Resources" - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: | - az group delete --name hub-rg -y - az group delete --name identity-rg -y - az group delete --name operations-rg -y - az group delete --name sharedServices-rg -y - az group delete --name NetworkWatcherRG -y +# - task: AzureCLI@2 +# displayName: "Cleanup Resources" +# inputs: +# azureSubscription: 'CAzureConnection' +# scriptType: 'bash' +# scriptLocation: 'inlineScript' +# inlineScript: | +# az group delete --name hub-rg -y +# az group delete --name identity-rg -y +# az group delete --name operations-rg -y +# az group delete --name sharedServices-rg -y +# az group delete --name NetworkWatcherRG -y - task: TerraformInstaller@0 inputs: terraformVersion: '1.0.8' @@ -109,18 +109,18 @@ jobs: workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - job: GovCloud_TF steps: - - task: AzureCLI@2 - displayName: "Cleanup Resources" - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: | - az group delete --name hub-rg -y - az group delete --name identity-rg -y - az group delete --name operations-rg -y - az group delete --name sharedServices-rg -y - az group delete --name NetworkWatcherRG -y +# - task: AzureCLI@2 +# displayName: "Cleanup Resources" +# inputs: +# azureSubscription: 'GAzureConnection' +# scriptType: 'bash' +# scriptLocation: 'inlineScript' +# inlineScript: | +# az group delete --name hub-rg -y +# az group delete --name identity-rg -y +# az group delete --name operations-rg -y +# az group delete --name sharedServices-rg -y +# az group delete --name NetworkWatcherRG -y - task: TerraformInstaller@0 inputs: terraformVersion: '1.0.8' From 129607275788a5528d52a7509e2be8bdd2e297f5 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 14 Oct 2021 17:47:00 -0400 Subject: [PATCH 042/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 70 ++++++++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 26 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d0a6aaf87..045d18fc5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -70,18 +70,6 @@ jobs: --template-file $(TemplateFile) - job: CommercialCloud_TF steps: -# - task: AzureCLI@2 -# displayName: "Cleanup Resources" -# inputs: -# azureSubscription: 'CAzureConnection' -# scriptType: 'bash' -# scriptLocation: 'inlineScript' -# inlineScript: | -# az group delete --name hub-rg -y -# az group delete --name identity-rg -y -# az group delete --name operations-rg -y -# az group delete --name sharedServices-rg -y -# az group delete --name NetworkWatcherRG -y - task: TerraformInstaller@0 inputs: terraformVersion: '1.0.8' @@ -104,23 +92,30 @@ jobs: terraform init terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false - sleep 30 + terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + - task: AzureCLI@2 + displayName: "Teardown MLZ Terraform" + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(ClientId) ` + echo $ARM_CLIENT_ID ` + export ARM_CLIENT_SECRET=$(ClientSecret1) ` + echo $ARM_CLIENT_SECRET ` + export ARM_SUBSCRIPTION_ID=$(subId) ` + echo $ARM_SUBSCRIPTION_ID ` + export ARM_TENANT_ID=$(tenantId) ` + echo $ARM_TENANT_ID ` + terraform init + terraform plan -var "hub_subid=$(subid)" -input=false terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - job: GovCloud_TF steps: -# - task: AzureCLI@2 -# displayName: "Cleanup Resources" -# inputs: -# azureSubscription: 'GAzureConnection' -# scriptType: 'bash' -# scriptLocation: 'inlineScript' -# inlineScript: | -# az group delete --name hub-rg -y -# az group delete --name identity-rg -y -# az group delete --name operations-rg -y -# az group delete --name sharedServices-rg -y -# az group delete --name NetworkWatcherRG -y - task: TerraformInstaller@0 inputs: terraformVersion: '1.0.8' @@ -146,6 +141,29 @@ jobs: terraform init terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false - sleep 30 + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + - task: AzureCLI@2 + name: TerraformTeardonwGov + displayName: "Teardown MLZ Terraform" + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + addSpnToEnvironment: true + scriptLocation: 'inlineScript' + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) ` + echo $ARM_CLIENT_ID ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + echo $ARM_CLIENT_SECRET ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + echo $ARM_SUBSCRIPTION_ID ` + export ARM_TENANT_ID=$(GTenantId) ` + echo $ARM_TENANT_ID ` + export ARM_ENVIRONMENT=$(CloudEnv) ` + echo $ARM_ENVIRONMENT ` + terraform init + terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false terraform destroy -var "hub_subid=$(GSubid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + + From ec68421705af69d9fdf3890bdf58b61261f1cc32 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 14 Oct 2021 18:49:40 -0400 Subject: [PATCH 043/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 045d18fc5..9d7995330 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,6 +22,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' + enabled: false - task: AzureCLI@2 displayName: "Cleanup Resources" inputs: @@ -29,6 +30,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' + enabled: false - task: AzureCLI@2 displayName: "Deploy MLZ Bicep" inputs: @@ -40,7 +42,7 @@ jobs: --name $(bDeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) - + enabled: false - job: bicepGovCloud steps: - task: AzureCLI@2 @@ -49,7 +51,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' - + enabled: false - task: AzureCLI@2 displayName: "Cleanup Resources" inputs: @@ -57,6 +59,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' + enabled: false - task: AzureCLI@2 displayName: "Deploy MLZ Bicep" inputs: @@ -68,6 +71,7 @@ jobs: --name $(bDeploymentName) \ --location $(GLocation) \ --template-file $(TemplateFile) + enabled: false - job: CommercialCloud_TF steps: - task: TerraformInstaller@0 @@ -92,7 +96,7 @@ jobs: terraform init terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false - terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false +# terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - task: AzureCLI@2 displayName: "Teardown MLZ Terraform" @@ -111,7 +115,6 @@ jobs: export ARM_TENANT_ID=$(tenantId) ` echo $ARM_TENANT_ID ` terraform init - terraform plan -var "hub_subid=$(subid)" -input=false terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - job: GovCloud_TF @@ -142,6 +145,7 @@ jobs: terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + enabled: false - task: AzureCLI@2 name: TerraformTeardonwGov displayName: "Teardown MLZ Terraform" @@ -162,8 +166,8 @@ jobs: export ARM_ENVIRONMENT=$(CloudEnv) ` echo $ARM_ENVIRONMENT ` terraform init - terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false terraform destroy -var "hub_subid=$(GSubid)" -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + enabled: false From 47d2fc4fa461f54cf8a737192bb84572c7d09913 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 14 Oct 2021 20:31:13 -0400 Subject: [PATCH 044/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9d7995330..52f48062f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,7 +22,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' - enabled: false + enabled: true - task: AzureCLI@2 displayName: "Cleanup Resources" inputs: @@ -30,7 +30,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - enabled: false + enabled: true - task: AzureCLI@2 displayName: "Deploy MLZ Bicep" inputs: @@ -42,7 +42,7 @@ jobs: --name $(bDeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) - enabled: false + enabled: true - job: bicepGovCloud steps: - task: AzureCLI@2 @@ -51,7 +51,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' - enabled: false + enabled: true - task: AzureCLI@2 displayName: "Cleanup Resources" inputs: @@ -59,7 +59,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - enabled: false + enabled: true - task: AzureCLI@2 displayName: "Deploy MLZ Bicep" inputs: @@ -71,7 +71,7 @@ jobs: --name $(bDeploymentName) \ --location $(GLocation) \ --template-file $(TemplateFile) - enabled: false + enabled: true - job: CommercialCloud_TF steps: - task: TerraformInstaller@0 @@ -98,6 +98,7 @@ jobs: terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false # terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + enabled: true - task: AzureCLI@2 displayName: "Teardown MLZ Terraform" inputs: @@ -117,6 +118,7 @@ jobs: terraform init terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + enabled: true - job: GovCloud_TF steps: - task: TerraformInstaller@0 @@ -145,7 +147,7 @@ jobs: terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - enabled: false + enabled: true - task: AzureCLI@2 name: TerraformTeardonwGov displayName: "Teardown MLZ Terraform" @@ -168,6 +170,6 @@ jobs: terraform init terraform destroy -var "hub_subid=$(GSubid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - enabled: false + enabled: true From 5dc010e81d983872bd9f75945962152260959ad2 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 14 Oct 2021 21:39:06 -0400 Subject: [PATCH 045/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 52f48062f..3d16f8baa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,7 +22,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' - enabled: true + enabled: false - task: AzureCLI@2 displayName: "Cleanup Resources" inputs: @@ -30,7 +30,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - enabled: true + enabled: false - task: AzureCLI@2 displayName: "Deploy MLZ Bicep" inputs: @@ -42,7 +42,7 @@ jobs: --name $(bDeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) - enabled: true + enabled: false - job: bicepGovCloud steps: - task: AzureCLI@2 @@ -51,7 +51,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' - enabled: true + enabled: false - task: AzureCLI@2 displayName: "Cleanup Resources" inputs: @@ -59,7 +59,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - enabled: true + enabled: false - task: AzureCLI@2 displayName: "Deploy MLZ Bicep" inputs: @@ -71,7 +71,7 @@ jobs: --name $(bDeploymentName) \ --location $(GLocation) \ --template-file $(TemplateFile) - enabled: true + enabled: false - job: CommercialCloud_TF steps: - task: TerraformInstaller@0 @@ -96,9 +96,9 @@ jobs: terraform init terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false -# terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - enabled: true + useGlobalConfig: true + enabled: false - task: AzureCLI@2 displayName: "Teardown MLZ Terraform" inputs: @@ -118,7 +118,8 @@ jobs: terraform init terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - enabled: true + useGlobalConfig: true + enabled: false - job: GovCloud_TF steps: - task: TerraformInstaller@0 @@ -146,7 +147,8 @@ jobs: terraform init terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true enabled: true - task: AzureCLI@2 name: TerraformTeardonwGov @@ -170,6 +172,5 @@ jobs: terraform init terraform destroy -var "hub_subid=$(GSubid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true enabled: true - - From 22bb7451b6c8b4b3e31e263f31bcd389747a062a Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 14 Oct 2021 22:14:32 -0400 Subject: [PATCH 046/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3d16f8baa..383bcb8e7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -159,6 +159,7 @@ jobs: addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: | + az ad signed-in-user show export ARM_CLIENT_ID=$(GClientId) ` echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(GClientSecret) ` @@ -170,7 +171,7 @@ jobs: export ARM_ENVIRONMENT=$(CloudEnv) ` echo $ARM_ENVIRONMENT ` terraform init - terraform destroy -var "hub_subid=$(GSubid)" -auto-approve -input=false + terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true enabled: true From a0820a81f12999b2d5019db3bdd40196da0ccd2b Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 14 Oct 2021 22:19:39 -0400 Subject: [PATCH 047/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 383bcb8e7..968afcc3a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -150,6 +150,7 @@ jobs: workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true enabled: true + continueOnError: true - task: AzureCLI@2 name: TerraformTeardonwGov displayName: "Teardown MLZ Terraform" From 20da94c77a55fade3df64a025ba7e859d86e73b9 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 14 Oct 2021 23:36:05 -0400 Subject: [PATCH 048/132] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 968afcc3a..b1d1fe282 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,7 +22,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' - enabled: false + enabled: true - task: AzureCLI@2 displayName: "Cleanup Resources" inputs: @@ -30,7 +30,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - enabled: false + enabled: true - task: AzureCLI@2 displayName: "Deploy MLZ Bicep" inputs: @@ -42,7 +42,7 @@ jobs: --name $(bDeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) - enabled: false + enabled: true - job: bicepGovCloud steps: - task: AzureCLI@2 @@ -51,7 +51,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' - enabled: false + enabled: true - task: AzureCLI@2 displayName: "Cleanup Resources" inputs: @@ -59,7 +59,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - enabled: false + enabled: true - task: AzureCLI@2 displayName: "Deploy MLZ Bicep" inputs: @@ -71,7 +71,7 @@ jobs: --name $(bDeploymentName) \ --location $(GLocation) \ --template-file $(TemplateFile) - enabled: false + enabled: true - job: CommercialCloud_TF steps: - task: TerraformInstaller@0 @@ -98,7 +98,7 @@ jobs: terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true - enabled: false + enabled: true - task: AzureCLI@2 displayName: "Teardown MLZ Terraform" inputs: @@ -119,7 +119,7 @@ jobs: terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true - enabled: false + enabled: true - job: GovCloud_TF steps: - task: TerraformInstaller@0 From 04b637a8028b7d2f94df41942e5fed52e021ab15 Mon Sep 17 00:00:00 2001 From: Shawn Gibbs Date: Mon, 18 Oct 2021 09:13:19 -0400 Subject: [PATCH 049/132] Mlz azure pipelines naming changes (#463) * add random for naming and delete script * moved delete script --- src/build/delete.sh | 17 ++++++++ src/terraform/mlz/main.tf | 76 +++++++++++++++++++--------------- src/terraform/mlz/variables.tf | 14 +++++-- 3 files changed, 70 insertions(+), 37 deletions(-) create mode 100644 src/build/delete.sh diff --git a/src/build/delete.sh b/src/build/delete.sh new file mode 100644 index 000000000..5589dc3a8 --- /dev/null +++ b/src/build/delete.sh @@ -0,0 +1,17 @@ +# Steps through current logged in az cli subscriptions and deletes resource groups based on first arg, +# as filter as a job by not waiting for them to complete. +# Then steps through each diagnostic setting at subscription level with similar filter, +# resets az cli account to a specific subscription to be able to continue to use command line. +# Usage: ./delete.sh "" "" +for subscription in `az account list -o tsv`; do + az account set --subscription $subscription + for rgname in `az group list --query "[? contains(name,'$1')][].{name:name}" -o tsv`; do + echo Deleting ${rgname} + az group delete -n ${rgname} --yes --no-wait + done + for setting in `az monitor diagnostic-settings subscription list --query "value[? contains(@.name, '$1')].name" -o tsv`; do + echo Deleting ${setting} + az monitor diagnostic-settings delete --name $setting --resource "/subscriptions/${subscription}" + done +done +az account set --subscription $2 \ No newline at end of file diff --git a/src/terraform/mlz/main.tf b/src/terraform/mlz/main.tf index 7a446ca61..a81489eff 100644 --- a/src/terraform/mlz/main.tf +++ b/src/terraform/mlz/main.tf @@ -119,37 +119,47 @@ locals { ################################ ### STAGE 0: Scaffolding ### ################################ - +resource "random_id" "random" { + keepers = { + # Generate a new id each time we change resourePrefix variable + resourcePrefix = "${var.resourcePrefix}" + } + byte_length = 8 +} resource "azurerm_resource_group" "hub" { provider = azurerm.hub + depends_on = [random_id.random] - location = var.location - name = var.hub_rgname - tags = var.tags + location = var.location + name = "${var.resourcePrefix}-${random_id.random.hex}-${var.hub_rgname}" + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } resource "azurerm_resource_group" "tier0" { provider = azurerm.tier0 + depends_on = [random_id.random] location = var.location - name = var.tier0_rgname - tags = var.tags + name = "${var.resourcePrefix}-${random_id.random.hex}-${var.tier0_rgname}" + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } resource "azurerm_resource_group" "tier1" { provider = azurerm.tier1 + depends_on = [random_id.random] location = var.location - name = var.tier1_rgname - tags = var.tags + name = "${var.resourcePrefix}-${random_id.random.hex}-${var.tier1_rgname}" + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } resource "azurerm_resource_group" "tier2" { provider = azurerm.tier2 + depends_on = [random_id.random] location = var.location - name = var.tier2_rgname - tags = var.tags + name = "${var.resourcePrefix}-${random_id.random.hex}-${var.tier2_rgname}" + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } ################################ @@ -173,7 +183,7 @@ resource "azurerm_log_analytics_workspace" "laws" { location = var.location sku = "PerGB2018" retention_in_days = "30" - tags = var.tags + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } resource "azurerm_log_analytics_solution" "laws_sentinel" { @@ -190,7 +200,7 @@ resource "azurerm_log_analytics_solution" "laws_sentinel" { publisher = "Microsoft" product = "OMSGallery/SecurityInsights" } - tags = var.tags + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } ############################### @@ -203,14 +213,14 @@ module "hub-network" { source = "../modules/hub" location = var.location - resource_group_name = var.hub_rgname + resource_group_name = azurerm_resource_group.hub.name vnet_name = var.hub_vnetname vnet_address_space = var.hub_vnet_address_space client_address_space = var.hub_client_address_space management_address_space = var.hub_management_address_space log_analytics_workspace_resource_id = azurerm_log_analytics_workspace.laws.id - tags = var.tags + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } module "firewall" { @@ -238,7 +248,7 @@ module "firewall" { management_publicip_name = var.management_publicip_name log_analytics_workspace_resource_id = azurerm_log_analytics_workspace.laws.id - tags = var.tags + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } module "spoke-network-t0" { @@ -254,11 +264,11 @@ module "spoke-network-t0" { laws_workspace_id = azurerm_log_analytics_workspace.laws.workspace_id laws_resource_id = azurerm_log_analytics_workspace.laws.id - spoke_rgname = var.tier0_rgname + spoke_rgname = azurerm_resource_group.tier0.name spoke_vnetname = var.tier0_vnetname spoke_vnet_address_space = var.tier0_vnet_address_space subnets = var.tier0_subnets - tags = var.tags + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } resource "azurerm_virtual_network_peering" "t0-to-hub" { @@ -266,7 +276,7 @@ resource "azurerm_virtual_network_peering" "t0-to-hub" { depends_on = [azurerm_resource_group.tier0, module.spoke-network-t0, module.hub-network, module.firewall] name = "${var.tier0_vnetname}-to-${var.hub_vnetname}" - resource_group_name = var.tier0_rgname + resource_group_name = azurerm_resource_group.tier0.name virtual_network_name = var.tier0_vnetname remote_virtual_network_id = module.hub-network.virtual_network_id allow_virtual_network_access = true @@ -278,7 +288,7 @@ resource "azurerm_virtual_network_peering" "hub-to-t0" { depends_on = [azurerm_resource_group.hub, module.spoke-network-t0, module.hub-network, module.firewall] name = "${var.hub_vnetname}-to-${var.tier0_vnetname}" - resource_group_name = var.hub_rgname + resource_group_name = azurerm_resource_group.hub.name virtual_network_name = var.hub_vnetname remote_virtual_network_id = module.spoke-network-t0.virtual_network_id allow_virtual_network_access = true @@ -298,11 +308,11 @@ module "spoke-network-t1" { laws_workspace_id = azurerm_log_analytics_workspace.laws.workspace_id laws_resource_id = azurerm_log_analytics_workspace.laws.id - spoke_rgname = var.tier1_rgname + spoke_rgname = azurerm_resource_group.tier1.name spoke_vnetname = var.tier1_vnetname spoke_vnet_address_space = var.tier1_vnet_address_space subnets = var.tier1_subnets - tags = var.tags + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } resource "azurerm_virtual_network_peering" "t1-to-hub" { @@ -310,7 +320,7 @@ resource "azurerm_virtual_network_peering" "t1-to-hub" { depends_on = [azurerm_resource_group.tier1, module.spoke-network-t1, module.hub-network, module.firewall] name = "${var.tier1_vnetname}-to-${var.hub_vnetname}" - resource_group_name = var.tier1_rgname + resource_group_name = azurerm_resource_group.tier1.name virtual_network_name = var.tier1_vnetname remote_virtual_network_id = module.hub-network.virtual_network_id allow_virtual_network_access = true @@ -322,7 +332,7 @@ resource "azurerm_virtual_network_peering" "hub-to-t1" { depends_on = [azurerm_resource_group.hub, module.spoke-network-t1, module.hub-network, module.firewall] name = "${var.hub_vnetname}-to-${var.tier1_vnetname}" - resource_group_name = var.hub_rgname + resource_group_name = azurerm_resource_group.hub.name virtual_network_name = var.hub_vnetname remote_virtual_network_id = module.spoke-network-t1.virtual_network_id allow_virtual_network_access = true @@ -342,11 +352,11 @@ module "spoke-network-t2" { laws_workspace_id = azurerm_log_analytics_workspace.laws.workspace_id laws_resource_id = azurerm_log_analytics_workspace.laws.id - spoke_rgname = var.tier2_rgname + spoke_rgname = azurerm_resource_group.tier2.name spoke_vnetname = var.tier2_vnetname spoke_vnet_address_space = var.tier2_vnet_address_space subnets = var.tier2_subnets - tags = var.tags + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } resource "azurerm_virtual_network_peering" "t2-to-hub" { @@ -354,7 +364,7 @@ resource "azurerm_virtual_network_peering" "t2-to-hub" { depends_on = [azurerm_resource_group.tier2, module.spoke-network-t2, module.hub-network, module.firewall] name = "${var.tier2_vnetname}-to-${var.hub_vnetname}" - resource_group_name = var.tier2_rgname + resource_group_name = azurerm_resource_group.tier2.name virtual_network_name = var.tier2_vnetname remote_virtual_network_id = module.hub-network.virtual_network_id allow_virtual_network_access = true @@ -366,7 +376,7 @@ resource "azurerm_virtual_network_peering" "hub-to-t2" { depends_on = [azurerm_resource_group.hub, module.spoke-network-t2, module.hub-network, module.firewall] name = "${var.hub_vnetname}-to-${var.tier2_vnetname}" - resource_group_name = var.hub_rgname + resource_group_name = azurerm_resource_group.hub.name virtual_network_name = var.hub_vnetname remote_virtual_network_id = module.spoke-network-t2.virtual_network_id allow_virtual_network_access = true @@ -390,7 +400,7 @@ module "jumpbox-subnet" { name = var.jumpbox_subnet.name location = var.location - resource_group_name = var.hub_rgname + resource_group_name = azurerm_resource_group.hub.name virtual_network_name = var.hub_vnetname address_prefixes = var.jumpbox_subnet.address_prefixes service_endpoints = lookup(var.jumpbox_subnet, "service_endpoints", []) @@ -408,7 +418,7 @@ module "jumpbox-subnet" { log_analytics_workspace_id = azurerm_log_analytics_workspace.laws.workspace_id log_analytics_workspace_location = var.location log_analytics_workspace_resource_id = azurerm_log_analytics_workspace.laws.id - tags = var.tags + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } module "bastion-host" { @@ -418,13 +428,13 @@ module "bastion-host" { depends_on = [azurerm_resource_group.hub, module.hub-network, module.firewall, module.jumpbox-subnet] source = "../modules/bastion" - resource_group_name = var.hub_rgname + resource_group_name = azurerm_resource_group.hub.name virtual_network_name = var.hub_vnetname bastion_host_name = var.bastion_host_name subnet_address_prefix = var.bastion_address_space public_ip_name = var.bastion_public_ip_name ipconfig_name = var.bastion_ipconfig_name - tags = var.tags + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } module "jumpbox" { @@ -434,7 +444,7 @@ module "jumpbox" { depends_on = [azurerm_resource_group.hub, module.hub-network, module.firewall, module.jumpbox-subnet] source = "../modules/jumpbox" - resource_group_name = var.hub_rgname + resource_group_name = azurerm_resource_group.hub.name virtual_network_name = var.hub_vnetname subnet_name = var.jumpbox_subnet.name location = var.location @@ -457,7 +467,7 @@ module "jumpbox" { linux_offer = var.jumpbox_linux_vm_offer linux_sku = var.jumpbox_linux_vm_sku linux_image_version = var.jumpbox_linux_vm_version - tags = var.tags + tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) } ##################################### diff --git a/src/terraform/mlz/variables.tf b/src/terraform/mlz/variables.tf index e8ee28f0b..15542badd 100644 --- a/src/terraform/mlz/variables.tf +++ b/src/terraform/mlz/variables.tf @@ -23,6 +23,12 @@ variable "location" { default = "East US" } +variable "resourcePrefix" { + description = "A name for the deployment. It defaults to dev." + type = string + default = "mlz" +} + variable "tags" { description = "A map of key value pairs to apply as tags to resources provisioned in this deployment" type = map(string) @@ -43,7 +49,7 @@ variable "hub_subid" { variable "hub_rgname" { description = "Resource Group for the deployment" type = string - default = "hub-rg" + default = "hub" } variable "hub_vnetname" { @@ -312,7 +318,7 @@ variable "tier0_subid" { variable "tier0_rgname" { description = "Resource Group for the deployment" type = string - default = "identity-rg" + default = "identity" } variable "tier0_vnetname" { @@ -405,7 +411,7 @@ variable "tier1_subid" { variable "tier1_rgname" { description = "Resource Group for the deployment" type = string - default = "operations-rg" + default = "operations" } variable "tier1_vnetname" { @@ -510,7 +516,7 @@ variable "tier2_subid" { variable "tier2_rgname" { description = "Resource Group for the deployment" type = string - default = "sharedServices-rg" + default = "sharedServices" } variable "tier2_vnetname" { From 4c4e61522a83ae43d0982952c9b445a8d10eee54 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Sun, 24 Oct 2021 21:49:07 -0400 Subject: [PATCH 050/132] PR & Nightly Build pipelines --- .../PRValidationBuild/azure-pipelines.yml | 89 +++++++++++ .github/workflows/nightly/azure-pipelines.yml | 138 ++++++++++++++++++ 2 files changed, 227 insertions(+) create mode 100644 .github/workflows/PRValidationBuild/azure-pipelines.yml create mode 100644 .github/workflows/nightly/azure-pipelines.yml diff --git a/.github/workflows/PRValidationBuild/azure-pipelines.yml b/.github/workflows/PRValidationBuild/azure-pipelines.yml new file mode 100644 index 000000000..c46cb0d00 --- /dev/null +++ b/.github/workflows/PRValidationBuild/azure-pipelines.yml @@ -0,0 +1,89 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- mlz-azure-pipelines + +pool: + vmImage: ubuntu-latest + +variables: + ServiceConnectionName: $(CAzureConnection) + GServiceConnectionName: $(GAzureConnection) + +jobs: +- job: bicepCommercialCloud + steps: + - task: AzureCLI@2 + displayName: "Commercial Cloud Deployments Bicep" + inputs: + azureSubscription: $(ServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub what-if \ + --name $(bDeploymentName) \ + --location $(Location) \ + --template-file $(TemplateFile) + --result-format FullResourcePayloads + +- job: bicepGovCloud + steps: + - task: AzureCLI@2 + displayName: "Gov Cloud Deployments Bicep" + inputs: + azureSubscription: $(GServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub what-if \ + --name $(bDeploymentName) \ + --location $(GLocation) \ + --template-file $(TemplateFile) + --result-format FullResourcePayloads + +- job: CommercialCloud_TF + steps: + - task: TerraformInstaller@0 + inputs: + terraformVersion: '1.0.8' + - task: AzureCLI@2 + displayName: "Commercial Cloud Deployments Terraform" + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(ClientId) ` + export ARM_CLIENT_SECRET=$(ClientSecret1) ` + export ARM_SUBSCRIPTION_ID=$(subId) ` + export ARM_TENANT_ID=$(tenantId) ` + terraform init + terraform plan -var "hub_subid=$(subid)" -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + + +- job: GovCloud_TF + steps: + + - task: TerraformInstaller@0 + inputs: + terraformVersion: '1.0.8' + - task: AzureCLI@2 + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + export ARM_TENANT_ID=$(GTenantId) ` + terraform init + terraform plan -var "hub_subid=$(GSubid)" -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + diff --git a/.github/workflows/nightly/azure-pipelines.yml b/.github/workflows/nightly/azure-pipelines.yml new file mode 100644 index 000000000..0bad6ff2c --- /dev/null +++ b/.github/workflows/nightly/azure-pipelines.yml @@ -0,0 +1,138 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- mlz-azure-pipelines + +pool: + vmImage: ubuntu-latest + +variables: + ServiceConnectionName: $(CAzureConnection) + GServiceConnectionName: $(GAzureConnection) + +jobs: +- job: bicepCommercialCloud + steps: + - task: AzureCLI@2 + displayName: " Cleanup Resources" + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' + - task: AzureCLI@2 + displayName: "Commercial Cloud Deployments Bicep" + inputs: + azureSubscription: $(ServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub create \ + --name $(bDeploymentName) \ + --location $(Location) \ + --template-file $(TemplateFile) + +- job: bicepGovCloud + steps: + - task: AzureCLI@2 + displayName: " Cleanup Gov Cloud Resources bicep" + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' + - task: AzureCLI@2 + displayName: "Gov Cloud Deployments Bicep" + inputs: + azureSubscription: $(GServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub create \ + --name $(bDeploymentName) \ + --location $(GLocation) \ + --template-file $(TemplateFile) + +- job: CommercialCloud_TF + steps: + - task: AzureCLI@2 + displayName: "Cleanup Commercial Resources" + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az group delete --name hub-rg -y + az group delete --name identity-rg -y + az group delete --name operations-rg -y + az group delete --name sharedServices-rg -y + az group delete --name NetworkWatcherRG -y + - task: TerraformInstaller@0 + inputs: + terraformVersion: '1.0.8' + - task: AzureCLI@2 + displayName: "Commercial Cloud Deployments Terraform" + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(ClientId) ` + echo $ARM_CLIENT_ID ` + export ARM_CLIENT_SECRET=$(ClientSecret1) ` + echo $ARM_CLIENT_SECRET ` + export ARM_SUBSCRIPTION_ID=$(subId) ` + echo $ARM_SUBSCRIPTION_ID ` + export ARM_TENANT_ID=$(tenantId) ` + echo $ARM_TENANT_ID ` + terraform init + terraform plan -var "hub_subid=$(subid)" -input=false + terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false + sleep 30 + terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + + +- job: GovCloud_TF + steps: + - task: AzureCLI@2 + displayName: "Cleanup Resources" + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az group delete --name hub-rg -y + az group delete --name identity-rg -y + az group delete --name operations-rg -y + az group delete --name sharedServices-rg -y + az group delete --name NetworkWatcherRG -y + - task: TerraformInstaller@0 + inputs: + terraformVersion: '1.0.8' + - task: AzureCLI@2 + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) ` + echo $ARM_CLIENT_ID ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + echo $ARM_CLIENT_SECRET ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + echo $ARM_SUBSCRIPTION_ID ` + export ARM_TENANT_ID=$(GTenantId) ` + echo $ARM_TENANT_ID ` + terraform init + terraform plan -var "hub_subid=$(GSubid)" -input=false + terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false + sleep 30 + terraform destroy -var "hub_subid=$(GSubid)" -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + From 84aeb7653709057f24ebce14d54537dffcb7bfcb Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 25 Oct 2021 13:16:53 -0400 Subject: [PATCH 051/132] Update azure-pipelines.yml for Azure Pipelines --- .github/workflows/PRValidationBuild/azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PRValidationBuild/azure-pipelines.yml b/.github/workflows/PRValidationBuild/azure-pipelines.yml index c46cb0d00..ac0d7c7d0 100644 --- a/.github/workflows/PRValidationBuild/azure-pipelines.yml +++ b/.github/workflows/PRValidationBuild/azure-pipelines.yml @@ -27,7 +27,7 @@ jobs: --name $(bDeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) - --result-format FullResourcePayloads + --result-format - job: bicepGovCloud steps: @@ -42,7 +42,7 @@ jobs: --name $(bDeploymentName) \ --location $(GLocation) \ --template-file $(TemplateFile) - --result-format FullResourcePayloads + --result-format - job: CommercialCloud_TF steps: From 86497234261e2e1ff6243c7574ad3705708010a6 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 25 Oct 2021 13:27:38 -0400 Subject: [PATCH 052/132] Update azure-pipelines.yml for Azure Pipelines --- .github/workflows/PRValidationBuild/azure-pipelines.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/PRValidationBuild/azure-pipelines.yml b/.github/workflows/PRValidationBuild/azure-pipelines.yml index ac0d7c7d0..ac8b281ed 100644 --- a/.github/workflows/PRValidationBuild/azure-pipelines.yml +++ b/.github/workflows/PRValidationBuild/azure-pipelines.yml @@ -27,7 +27,6 @@ jobs: --name $(bDeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) - --result-format - job: bicepGovCloud steps: @@ -42,8 +41,7 @@ jobs: --name $(bDeploymentName) \ --location $(GLocation) \ --template-file $(TemplateFile) - --result-format - + - job: CommercialCloud_TF steps: - task: TerraformInstaller@0 From 7e4dea86efe63de39cff72a71be76b7322630aee Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 25 Oct 2021 13:38:57 -0400 Subject: [PATCH 053/132] Update azure-pipelines.yml for Azure Pipelines --- .github/workflows/PRValidationBuild/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PRValidationBuild/azure-pipelines.yml b/.github/workflows/PRValidationBuild/azure-pipelines.yml index ac8b281ed..47d9ef2b4 100644 --- a/.github/workflows/PRValidationBuild/azure-pipelines.yml +++ b/.github/workflows/PRValidationBuild/azure-pipelines.yml @@ -56,7 +56,7 @@ jobs: addSpnToEnvironment: true inlineScript: | export ARM_CLIENT_ID=$(ClientId) ` - export ARM_CLIENT_SECRET=$(ClientSecret1) ` + export ARM_CLIENT_SECRET=$(ClientSecret) ` export ARM_SUBSCRIPTION_ID=$(subId) ` export ARM_TENANT_ID=$(tenantId) ` terraform init From c545c149b9d67505c6b9d9b793867170a71bb0f0 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 25 Oct 2021 14:06:48 -0400 Subject: [PATCH 054/132] Update azure-pipelines.yml for Azure Pipelines --- .../PRValidationBuild/azure-pipelines.yml | 56 ++++++++++++------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/.github/workflows/PRValidationBuild/azure-pipelines.yml b/.github/workflows/PRValidationBuild/azure-pipelines.yml index 47d9ef2b4..a8e29ea76 100644 --- a/.github/workflows/PRValidationBuild/azure-pipelines.yml +++ b/.github/workflows/PRValidationBuild/azure-pipelines.yml @@ -17,7 +17,7 @@ jobs: - job: bicepCommercialCloud steps: - task: AzureCLI@2 - displayName: "Commercial Cloud Deployments Bicep" + displayName: "Deploy MLZ Bicep" inputs: azureSubscription: $(ServiceConnectionName) scriptType: 'bash' @@ -27,11 +27,11 @@ jobs: --name $(bDeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) - + enabled: true - job: bicepGovCloud - steps: + steps: - task: AzureCLI@2 - displayName: "Gov Cloud Deployments Bicep" + displayName: "Deploy MLZ Bicep" inputs: azureSubscription: $(GServiceConnectionName) scriptType: 'bash' @@ -41,47 +41,63 @@ jobs: --name $(bDeploymentName) \ --location $(GLocation) \ --template-file $(TemplateFile) - + enabled: true - job: CommercialCloud_TF steps: - - task: TerraformInstaller@0 - inputs: + - task: TerraformInstaller@0 + inputs: terraformVersion: '1.0.8' - - task: AzureCLI@2 - displayName: "Commercial Cloud Deployments Terraform" - inputs: + - task: AzureCLI@2 + displayName: "Deploy MLZ Terraform" + inputs: azureSubscription: 'CAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | export ARM_CLIENT_ID=$(ClientId) ` + echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(ClientSecret) ` + echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(subId) ` + echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(tenantId) ` + echo $ARM_TENANT_ID ` terraform init terraform plan -var "hub_subid=$(subid)" -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - - + useGlobalConfig: true + enabled: true + + - job: GovCloud_TF steps: - - - task: TerraformInstaller@0 - inputs: + - task: TerraformInstaller@0 + inputs: terraformVersion: '1.0.8' - - task: AzureCLI@2 - inputs: + - task: AzureCLI@2 + name: TerraformApplyGov + displayName: "Deploy MLZ Terraform" + inputs: azureSubscription: 'GAzureConnection' scriptType: 'bash' - scriptLocation: 'inlineScript' addSpnToEnvironment: true + scriptLocation: 'inlineScript' inlineScript: | export ARM_CLIENT_ID=$(GClientId) ` + echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(GClientSecret) ` + echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(GSubId) ` + echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(GTenantId) ` - terraform init - terraform plan -var "hub_subid=$(GSubid)" -input=false + echo $ARM_TENANT_ID ` + export ARM_ENVIRONMENT=$(CloudEnv) ` + echo $ARM_ENVIRONMENT ` + terraform init + terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true + enabled: true + \ No newline at end of file From 33987b6a084cf74fa564db54cc2f97f9680cde6a Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 25 Oct 2021 14:20:34 -0400 Subject: [PATCH 055/132] Rename azure-pipelines.yml to mlz-pr-azure-pipelines.yml --- .../{azure-pipelines.yml => mlz-pr-azure-pipelines.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/PRValidationBuild/{azure-pipelines.yml => mlz-pr-azure-pipelines.yml} (99%) diff --git a/.github/workflows/PRValidationBuild/azure-pipelines.yml b/.github/workflows/PRValidationBuild/mlz-pr-azure-pipelines.yml similarity index 99% rename from .github/workflows/PRValidationBuild/azure-pipelines.yml rename to .github/workflows/PRValidationBuild/mlz-pr-azure-pipelines.yml index a8e29ea76..14a76d4cc 100644 --- a/.github/workflows/PRValidationBuild/azure-pipelines.yml +++ b/.github/workflows/PRValidationBuild/mlz-pr-azure-pipelines.yml @@ -100,4 +100,4 @@ jobs: useGlobalConfig: true enabled: true - \ No newline at end of file + From 30203d5b19e4b18e483e6d2c38848d92a27c83cd Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 25 Oct 2021 17:47:30 -0400 Subject: [PATCH 056/132] Update azure-pipelines.yml for Azure Pipelines --- .github/workflows/nightly/azure-pipelines.yml | 160 +++++++++++------- 1 file changed, 101 insertions(+), 59 deletions(-) diff --git a/.github/workflows/nightly/azure-pipelines.yml b/.github/workflows/nightly/azure-pipelines.yml index 0bad6ff2c..cae6c297c 100644 --- a/.github/workflows/nightly/azure-pipelines.yml +++ b/.github/workflows/nightly/azure-pipelines.yml @@ -17,14 +17,7 @@ jobs: - job: bicepCommercialCloud steps: - task: AzureCLI@2 - displayName: " Cleanup Resources" - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - - task: AzureCLI@2 - displayName: "Commercial Cloud Deployments Bicep" + displayName: "Deploy MLZ Bicep" inputs: azureSubscription: $(ServiceConnectionName) scriptType: 'bash' @@ -34,18 +27,27 @@ jobs: --name $(bDeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) - -- job: bicepGovCloud - steps: + --parameters resourcePrefix="cicdbicep" + enabled: true - task: AzureCLI@2 - displayName: " Cleanup Gov Cloud Resources bicep" inputs: - azureSubscription: 'GAzureConnection' + azureSubscription: 'CAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' - inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' + inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''cicdbicep''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' + enabled: true - task: AzureCLI@2 - displayName: "Gov Cloud Deployments Bicep" + displayName: "Cleanup Resources" + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az group list -o table | grep ''cicdbicep'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' + enabled: true +- job: bicepGovCloud + steps: + - task: AzureCLI@2 + displayName: "Deploy MLZ Bicep" inputs: azureSubscription: $(GServiceConnectionName) scriptType: 'bash' @@ -55,27 +57,31 @@ jobs: --name $(bDeploymentName) \ --location $(GLocation) \ --template-file $(TemplateFile) - + --parameters resourcePrefix="cicdbicep" + enabled: true + - task: AzureCLI@2 + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''cicdbicep''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' + enabled: true + - task: AzureCLI@2 + displayName: "Cleanup Resources" + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az group list -o table | grep ''cicdbicep'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' + enabled: true - job: CommercialCloud_TF steps: - - task: AzureCLI@2 - displayName: "Cleanup Commercial Resources" - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: | - az group delete --name hub-rg -y - az group delete --name identity-rg -y - az group delete --name operations-rg -y - az group delete --name sharedServices-rg -y - az group delete --name NetworkWatcherRG -y - - task: TerraformInstaller@0 - inputs: + - task: TerraformInstaller@0 + inputs: terraformVersion: '1.0.8' - - task: AzureCLI@2 - displayName: "Commercial Cloud Deployments Terraform" - inputs: + - task: AzureCLI@2 + displayName: "Deploy MLZ Terraform" + inputs: azureSubscription: 'CAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' @@ -83,7 +89,7 @@ jobs: inlineScript: | export ARM_CLIENT_ID=$(ClientId) ` echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(ClientSecret1) ` + export ARM_CLIENT_SECRET=$(ClientSecret) ` echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(subId) ` echo $ARM_SUBSCRIPTION_ID ` @@ -92,35 +98,71 @@ jobs: terraform init terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false - sleep 30 - terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - - -- job: GovCloud_TF - steps: - - task: AzureCLI@2 - displayName: "Cleanup Resources" - inputs: + useGlobalConfig: true + enabled: true + - task: AzureCLI@2 + displayName: "Teardown MLZ Terraform" + inputs: azureSubscription: 'CAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' + addSpnToEnvironment: true inlineScript: | - az group delete --name hub-rg -y - az group delete --name identity-rg -y - az group delete --name operations-rg -y - az group delete --name sharedServices-rg -y - az group delete --name NetworkWatcherRG -y - - task: TerraformInstaller@0 - inputs: + export ARM_CLIENT_ID=$(ClientId) ` + echo $ARM_CLIENT_ID ` + export ARM_CLIENT_SECRET=$(ClientSecret1) ` + echo $ARM_CLIENT_SECRET ` + export ARM_SUBSCRIPTION_ID=$(subId) ` + echo $ARM_SUBSCRIPTION_ID ` + export ARM_TENANT_ID=$(tenantId) ` + echo $ARM_TENANT_ID ` + terraform init + terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true + enabled: true +- job: GovCloud_TF + steps: + - task: TerraformInstaller@0 + inputs: terraformVersion: '1.0.8' - - task: AzureCLI@2 - inputs: + - task: AzureCLI@2 + name: TerraformApplyGov + displayName: "Deploy MLZ Terraform" + inputs: azureSubscription: 'GAzureConnection' scriptType: 'bash' + addSpnToEnvironment: true scriptLocation: 'inlineScript' + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) ` + echo $ARM_CLIENT_ID ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + echo $ARM_CLIENT_SECRET ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + echo $ARM_SUBSCRIPTION_ID ` + export ARM_TENANT_ID=$(GTenantId) ` + echo $ARM_TENANT_ID ` + export ARM_ENVIRONMENT=$(CloudEnv) ` + echo $ARM_ENVIRONMENT ` + terraform init + terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false + terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true + enabled: true + continueOnError: true + - task: AzureCLI@2 + name: TerraformTeardonwGov + displayName: "Teardown MLZ Terraform" + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' addSpnToEnvironment: true + scriptLocation: 'inlineScript' inlineScript: | + az ad signed-in-user show export ARM_CLIENT_ID=$(GClientId) ` echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(GClientSecret) ` @@ -128,11 +170,11 @@ jobs: export ARM_SUBSCRIPTION_ID=$(GSubId) ` echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(GTenantId) ` - echo $ARM_TENANT_ID ` - terraform init - terraform plan -var "hub_subid=$(GSubid)" -input=false - terraform apply -var "hub_subid=$(GSubid)" -auto-approve -input=false - sleep 30 - terraform destroy -var "hub_subid=$(GSubid)" -auto-approve -input=false + echo $ARM_TENANT_ID ` + export ARM_ENVIRONMENT=$(CloudEnv) ` + echo $ARM_ENVIRONMENT ` + terraform init + terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - + useGlobalConfig: true + enabled: true From 49f4704e372dc614e135555ffe8d38e7a2c51d79 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 25 Oct 2021 19:58:18 -0400 Subject: [PATCH 057/132] Update azure-pipelines.yml for Azure Pipelines --- .github/workflows/nightly/azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly/azure-pipelines.yml b/.github/workflows/nightly/azure-pipelines.yml index cae6c297c..6b1ab88ce 100644 --- a/.github/workflows/nightly/azure-pipelines.yml +++ b/.github/workflows/nightly/azure-pipelines.yml @@ -26,7 +26,7 @@ jobs: az deployment sub create \ --name $(bDeploymentName) \ --location $(Location) \ - --template-file $(TemplateFile) + --template-file $(TemplateFile)\ --parameters resourcePrefix="cicdbicep" enabled: true - task: AzureCLI@2 @@ -56,7 +56,7 @@ jobs: az deployment sub create \ --name $(bDeploymentName) \ --location $(GLocation) \ - --template-file $(TemplateFile) + --template-file $(TemplateFile)\ --parameters resourcePrefix="cicdbicep" enabled: true - task: AzureCLI@2 From 0dc6625826570e9c71b50f7366f3272e791d83db Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 25 Oct 2021 20:59:51 -0400 Subject: [PATCH 058/132] Update azure-pipelines.yml for Azure Pipelines --- .github/workflows/nightly/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly/azure-pipelines.yml b/.github/workflows/nightly/azure-pipelines.yml index 6b1ab88ce..af843cac7 100644 --- a/.github/workflows/nightly/azure-pipelines.yml +++ b/.github/workflows/nightly/azure-pipelines.yml @@ -111,7 +111,7 @@ jobs: inlineScript: | export ARM_CLIENT_ID=$(ClientId) ` echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(ClientSecret1) ` + export ARM_CLIENT_SECRET=$(ClientSecret) ` echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(subId) ` echo $ARM_SUBSCRIPTION_ID ` From 5745d3e9e3e27a3cf40d8c7669ec2be420b42c40 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 25 Oct 2021 22:50:17 -0400 Subject: [PATCH 059/132] Update azure-pipelines.yml for Azure Pipelines --- .github/workflows/nightly/azure-pipelines.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/nightly/azure-pipelines.yml b/.github/workflows/nightly/azure-pipelines.yml index af843cac7..d8b5845d8 100644 --- a/.github/workflows/nightly/azure-pipelines.yml +++ b/.github/workflows/nightly/azure-pipelines.yml @@ -88,13 +88,9 @@ jobs: addSpnToEnvironment: true inlineScript: | export ARM_CLIENT_ID=$(ClientId) ` - echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(ClientSecret) ` - echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(subId) ` - echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(tenantId) ` - echo $ARM_TENANT_ID ` terraform init terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false @@ -110,13 +106,9 @@ jobs: addSpnToEnvironment: true inlineScript: | export ARM_CLIENT_ID=$(ClientId) ` - echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(ClientSecret) ` - echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(subId) ` - echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(tenantId) ` - echo $ARM_TENANT_ID ` terraform init terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' @@ -137,15 +129,10 @@ jobs: scriptLocation: 'inlineScript' inlineScript: | export ARM_CLIENT_ID=$(GClientId) ` - echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(GClientSecret) ` - echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(GSubId) ` - echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(GTenantId) ` - echo $ARM_TENANT_ID ` export ARM_ENVIRONMENT=$(CloudEnv) ` - echo $ARM_ENVIRONMENT ` terraform init terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false @@ -164,15 +151,10 @@ jobs: inlineScript: | az ad signed-in-user show export ARM_CLIENT_ID=$(GClientId) ` - echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(GClientSecret) ` - echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(GSubId) ` - echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(GTenantId) ` - echo $ARM_TENANT_ID ` export ARM_ENVIRONMENT=$(CloudEnv) ` - echo $ARM_ENVIRONMENT ` terraform init terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From 770d53d1ccefbfa133dd7ce6c24f1b472ec33fe7 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 27 Oct 2021 20:07:16 -0400 Subject: [PATCH 060/132] Nightly deployments of /main to AzureCloud and AzureUsGovernment #49 --- .../mlz-bicep-azurecloud-pipelines.yml | 45 +++++ .../mlz-bicep-azuregov-pipelines.yml | 45 +++++ .../mlz-tf-azurecloud-pipelines.yml | 55 ++++++ .../mlz-tf-azuregov-pipelines.yml | 61 ++++++ .../mlz-pr-bicep-azurecloud-pipelines.yml | 29 +++ .../mlz-pr-bicep-azuregov-pipelines.yml | 30 +++ .../mlz-pr-tf-azurecloud-pipelines.yml | 43 +++++ .../prbuild/mlz-pr-tf-azuregov-pipelines.yml | 47 +++++ .../mlz-pr-azure-pipelines.yml | 103 ---------- .github/workflows/nightly/azure-pipelines.yml | 162 ---------------- azure-pipelines.yml | 178 ------------------ 11 files changed, 355 insertions(+), 443 deletions(-) create mode 100644 .azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml create mode 100644 .azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml create mode 100644 .azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml create mode 100644 .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml create mode 100644 .azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml create mode 100644 .azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml create mode 100644 .azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml create mode 100644 .azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml delete mode 100644 .github/workflows/PRValidationBuild/mlz-pr-azure-pipelines.yml delete mode 100644 .github/workflows/nightly/azure-pipelines.yml delete mode 100644 azure-pipelines.yml diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml new file mode 100644 index 000000000..cc1f90807 --- /dev/null +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -0,0 +1,45 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- mlz-azure-pipelines + +pool: + vmImage: ubuntu-latest + +variables: + ServiceConnectionName: $(CAzureConnection) + +jobs: +- job: bicepCommercialCloud + steps: + - task: AzureCLI@2 + displayName: "Deploy MLZ Bicep" + inputs: + azureSubscription: $(ServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub create \ + --name $(bDeploymentName) \ + --location $(Location) \ + --template-file $(TemplateFile)\ + --parameters resourcePrefix="cicdbicep" + + - task: AzureCLI@2 + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''cicdbicep''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' + + - task: AzureCLI@2 + displayName: "Cleanup Resources" + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az group list -o table | grep ''cicdbicep'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' + diff --git a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml new file mode 100644 index 000000000..47b3bb20b --- /dev/null +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -0,0 +1,45 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- mlz-azure-pipelines + +pool: + vmImage: ubuntu-latest + +variables: + GServiceConnectionName: $(GAzureConnection) + +jobs: +- job: bicepGovCloud + steps: + - task: AzureCLI@2 + displayName: "Deploy MLZ Bicep" + inputs: + azureSubscription: $(GServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub create \ + --name $(bDeploymentName) \ + --location $(GLocation) \ + --template-file $(TemplateFile)\ + --parameters resourcePrefix="cicdbicep" + + - task: AzureCLI@2 + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''cicdbicep''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' + + - task: AzureCLI@2 + displayName: "Cleanup Resources" + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: 'az group list -o table | grep ''cicdbicep'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' + \ No newline at end of file diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml new file mode 100644 index 000000000..05e92c01f --- /dev/null +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -0,0 +1,55 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- mlz-azure-pipelines + +pool: + vmImage: ubuntu-latest + +variables: + ServiceConnectionName: $(CAzureConnection) + +jobs: +- job: CommercialCloud_TF + steps: + - task: TerraformInstaller@0 + inputs: + terraformVersion: '1.0.8' + - task: AzureCLI@2 + displayName: "Deploy MLZ Terraform" + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(ClientId) ` + export ARM_CLIENT_SECRET=$(ClientSecret) ` + export ARM_SUBSCRIPTION_ID=$(subId) ` + export ARM_TENANT_ID=$(tenantId) ` + terraform init + terraform plan -var "hub_subid=$(subid)" -input=false + terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true + + - task: AzureCLI@2 + displayName: "Teardown MLZ Terraform" + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(ClientId) ` + export ARM_CLIENT_SECRET=$(ClientSecret) ` + export ARM_SUBSCRIPTION_ID=$(subId) ` + export ARM_TENANT_ID=$(tenantId) ` + terraform init + terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true + diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml new file mode 100644 index 000000000..f511ed7c7 --- /dev/null +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -0,0 +1,61 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- mlz-azure-pipelines + +pool: + vmImage: ubuntu-latest + +variables: + GServiceConnectionName: $(GAzureConnection) + +jobs: +- job: GovCloud_TF + steps: + - task: TerraformInstaller@0 + inputs: + terraformVersion: '1.0.8' + - task: AzureCLI@2 + name: TerraformApplyGov + displayName: "Deploy MLZ Terraform" + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + addSpnToEnvironment: true + scriptLocation: 'inlineScript' + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + export ARM_TENANT_ID=$(GTenantId) ` + export ARM_ENVIRONMENT=$(CloudEnv) ` + terraform init + terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false + terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true + + continueOnError: true + - task: AzureCLI@2 + name: TerraformTeardonwGov + displayName: "Teardown MLZ Terraform" + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + addSpnToEnvironment: true + scriptLocation: 'inlineScript' + inlineScript: | + az ad signed-in-user show + export ARM_CLIENT_ID=$(GClientId) ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + export ARM_TENANT_ID=$(GTenantId) ` + export ARM_ENVIRONMENT=$(CloudEnv) ` + terraform init + terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true + diff --git a/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml new file mode 100644 index 000000000..2995ff5ba --- /dev/null +++ b/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml @@ -0,0 +1,29 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- mlz-azure-pipelines + +pool: + vmImage: ubuntu-latest + +variables: + ServiceConnectionName: $(CAzureConnection) + +jobs: +- job: bicepCommercialCloud + steps: + - task: AzureCLI@2 + displayName: "Deploy MLZ Bicep" + inputs: + azureSubscription: $(ServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub what-if \ + --name $(bDeploymentName) \ + --location $(Location) \ + --template-file $(TemplateFile) + diff --git a/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml b/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml new file mode 100644 index 000000000..c6c5b4268 --- /dev/null +++ b/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml @@ -0,0 +1,30 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- mlz-azure-pipelines + +pool: + vmImage: ubuntu-latest + +variables: + + GServiceConnectionName: $(GAzureConnection) + +jobs: +- job: bicepGovCloud + steps: + - task: AzureCLI@2 + displayName: "Deploy MLZ Bicep" + inputs: + azureSubscription: $(GServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub what-if \ + --name $(bDeploymentName) \ + --location $(GLocation) \ + --template-file $(TemplateFile) + diff --git a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml new file mode 100644 index 000000000..7c09bf8da --- /dev/null +++ b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml @@ -0,0 +1,43 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- mlz-azure-pipelines + +pool: + vmImage: ubuntu-latest + +variables: + ServiceConnectionName: $(CAzureConnection) + +jobs: +- job: CommercialCloud_TF + steps: + - task: TerraformInstaller@0 + inputs: + terraformVersion: '1.0.8' + - task: AzureCLI@2 + displayName: "Deploy MLZ Terraform" + inputs: + azureSubscription: 'CAzureConnection' + scriptType: 'bash' + scriptLocation: 'inlineScript' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(ClientId) ` + echo $ARM_CLIENT_ID ` + export ARM_CLIENT_SECRET=$(ClientSecret) ` + echo $ARM_CLIENT_SECRET ` + export ARM_SUBSCRIPTION_ID=$(subId) ` + echo $ARM_SUBSCRIPTION_ID ` + export ARM_TENANT_ID=$(tenantId) ` + echo $ARM_TENANT_ID ` + terraform init + terraform plan -var "hub_subid=$(subid)" -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true + + + diff --git a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml new file mode 100644 index 000000000..621c45ed9 --- /dev/null +++ b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml @@ -0,0 +1,47 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- mlz-azure-pipelines + +pool: + vmImage: ubuntu-latest + +variables: + GServiceConnectionName: $(GAzureConnection) + +jobs: + +- job: GovCloud_TF + steps: + - task: TerraformInstaller@0 + inputs: + terraformVersion: '1.0.8' + - task: AzureCLI@2 + name: TerraformApplyGov + displayName: "Deploy MLZ Terraform" + inputs: + azureSubscription: 'GAzureConnection' + scriptType: 'bash' + addSpnToEnvironment: true + scriptLocation: 'inlineScript' + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) ` + echo $ARM_CLIENT_ID ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + echo $ARM_CLIENT_SECRET ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + echo $ARM_SUBSCRIPTION_ID ` + export ARM_TENANT_ID=$(GTenantId) ` + echo $ARM_TENANT_ID ` + export ARM_ENVIRONMENT=$(CloudEnv) ` + echo $ARM_ENVIRONMENT ` + terraform init + terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true + + + diff --git a/.github/workflows/PRValidationBuild/mlz-pr-azure-pipelines.yml b/.github/workflows/PRValidationBuild/mlz-pr-azure-pipelines.yml deleted file mode 100644 index 14a76d4cc..000000000 --- a/.github/workflows/PRValidationBuild/mlz-pr-azure-pipelines.yml +++ /dev/null @@ -1,103 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: -- mlz-azure-pipelines - -pool: - vmImage: ubuntu-latest - -variables: - ServiceConnectionName: $(CAzureConnection) - GServiceConnectionName: $(GAzureConnection) - -jobs: -- job: bicepCommercialCloud - steps: - - task: AzureCLI@2 - displayName: "Deploy MLZ Bicep" - inputs: - azureSubscription: $(ServiceConnectionName) - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: | - az deployment sub what-if \ - --name $(bDeploymentName) \ - --location $(Location) \ - --template-file $(TemplateFile) - enabled: true -- job: bicepGovCloud - steps: - - task: AzureCLI@2 - displayName: "Deploy MLZ Bicep" - inputs: - azureSubscription: $(GServiceConnectionName) - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: | - az deployment sub what-if \ - --name $(bDeploymentName) \ - --location $(GLocation) \ - --template-file $(TemplateFile) - enabled: true -- job: CommercialCloud_TF - steps: - - task: TerraformInstaller@0 - inputs: - terraformVersion: '1.0.8' - - task: AzureCLI@2 - displayName: "Deploy MLZ Terraform" - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - addSpnToEnvironment: true - inlineScript: | - export ARM_CLIENT_ID=$(ClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(ClientSecret) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(subId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(tenantId) ` - echo $ARM_TENANT_ID ` - terraform init - terraform plan -var "hub_subid=$(subid)" -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - enabled: true - - -- job: GovCloud_TF - steps: - - task: TerraformInstaller@0 - inputs: - terraformVersion: '1.0.8' - - task: AzureCLI@2 - name: TerraformApplyGov - displayName: "Deploy MLZ Terraform" - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - addSpnToEnvironment: true - scriptLocation: 'inlineScript' - inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(GTenantId) ` - echo $ARM_TENANT_ID ` - export ARM_ENVIRONMENT=$(CloudEnv) ` - echo $ARM_ENVIRONMENT ` - terraform init - terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - enabled: true - - diff --git a/.github/workflows/nightly/azure-pipelines.yml b/.github/workflows/nightly/azure-pipelines.yml deleted file mode 100644 index d8b5845d8..000000000 --- a/.github/workflows/nightly/azure-pipelines.yml +++ /dev/null @@ -1,162 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: -- mlz-azure-pipelines - -pool: - vmImage: ubuntu-latest - -variables: - ServiceConnectionName: $(CAzureConnection) - GServiceConnectionName: $(GAzureConnection) - -jobs: -- job: bicepCommercialCloud - steps: - - task: AzureCLI@2 - displayName: "Deploy MLZ Bicep" - inputs: - azureSubscription: $(ServiceConnectionName) - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: | - az deployment sub create \ - --name $(bDeploymentName) \ - --location $(Location) \ - --template-file $(TemplateFile)\ - --parameters resourcePrefix="cicdbicep" - enabled: true - - task: AzureCLI@2 - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''cicdbicep''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' - enabled: true - - task: AzureCLI@2 - displayName: "Cleanup Resources" - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: 'az group list -o table | grep ''cicdbicep'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - enabled: true -- job: bicepGovCloud - steps: - - task: AzureCLI@2 - displayName: "Deploy MLZ Bicep" - inputs: - azureSubscription: $(GServiceConnectionName) - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: | - az deployment sub create \ - --name $(bDeploymentName) \ - --location $(GLocation) \ - --template-file $(TemplateFile)\ - --parameters resourcePrefix="cicdbicep" - enabled: true - - task: AzureCLI@2 - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''cicdbicep''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' - enabled: true - - task: AzureCLI@2 - displayName: "Cleanup Resources" - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: 'az group list -o table | grep ''cicdbicep'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - enabled: true -- job: CommercialCloud_TF - steps: - - task: TerraformInstaller@0 - inputs: - terraformVersion: '1.0.8' - - task: AzureCLI@2 - displayName: "Deploy MLZ Terraform" - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - addSpnToEnvironment: true - inlineScript: | - export ARM_CLIENT_ID=$(ClientId) ` - export ARM_CLIENT_SECRET=$(ClientSecret) ` - export ARM_SUBSCRIPTION_ID=$(subId) ` - export ARM_TENANT_ID=$(tenantId) ` - terraform init - terraform plan -var "hub_subid=$(subid)" -input=false - terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - enabled: true - - task: AzureCLI@2 - displayName: "Teardown MLZ Terraform" - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - addSpnToEnvironment: true - inlineScript: | - export ARM_CLIENT_ID=$(ClientId) ` - export ARM_CLIENT_SECRET=$(ClientSecret) ` - export ARM_SUBSCRIPTION_ID=$(subId) ` - export ARM_TENANT_ID=$(tenantId) ` - terraform init - terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - enabled: true -- job: GovCloud_TF - steps: - - task: TerraformInstaller@0 - inputs: - terraformVersion: '1.0.8' - - task: AzureCLI@2 - name: TerraformApplyGov - displayName: "Deploy MLZ Terraform" - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - addSpnToEnvironment: true - scriptLocation: 'inlineScript' - inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - export ARM_TENANT_ID=$(GTenantId) ` - export ARM_ENVIRONMENT=$(CloudEnv) ` - terraform init - terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false - terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - enabled: true - continueOnError: true - - task: AzureCLI@2 - name: TerraformTeardonwGov - displayName: "Teardown MLZ Terraform" - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - addSpnToEnvironment: true - scriptLocation: 'inlineScript' - inlineScript: | - az ad signed-in-user show - export ARM_CLIENT_ID=$(GClientId) ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - export ARM_TENANT_ID=$(GTenantId) ` - export ARM_ENVIRONMENT=$(CloudEnv) ` - terraform init - terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - enabled: true diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index b1d1fe282..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,178 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: -- mlz-azure-pipelines - -pool: - vmImage: ubuntu-latest - -variables: - ServiceConnectionName: $(CAzureConnection) - GServiceConnectionName: $(GAzureConnection) - -jobs: -- job: bicepCommercialCloud - steps: - - task: AzureCLI@2 - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' - enabled: true - - task: AzureCLI@2 - displayName: "Cleanup Resources" - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - enabled: true - - task: AzureCLI@2 - displayName: "Deploy MLZ Bicep" - inputs: - azureSubscription: $(ServiceConnectionName) - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: | - az deployment sub create \ - --name $(bDeploymentName) \ - --location $(Location) \ - --template-file $(TemplateFile) - enabled: true -- job: bicepGovCloud - steps: - - task: AzureCLI@2 - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' - enabled: true - - task: AzureCLI@2 - displayName: "Cleanup Resources" - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - enabled: true - - task: AzureCLI@2 - displayName: "Deploy MLZ Bicep" - inputs: - azureSubscription: $(GServiceConnectionName) - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: | - az deployment sub create \ - --name $(bDeploymentName) \ - --location $(GLocation) \ - --template-file $(TemplateFile) - enabled: true -- job: CommercialCloud_TF - steps: - - task: TerraformInstaller@0 - inputs: - terraformVersion: '1.0.8' - - task: AzureCLI@2 - displayName: "Deploy MLZ Terraform" - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - addSpnToEnvironment: true - inlineScript: | - export ARM_CLIENT_ID=$(ClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(ClientSecret1) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(subId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(tenantId) ` - echo $ARM_TENANT_ID ` - terraform init - terraform plan -var "hub_subid=$(subid)" -input=false - terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - enabled: true - - task: AzureCLI@2 - displayName: "Teardown MLZ Terraform" - inputs: - azureSubscription: 'CAzureConnection' - scriptType: 'bash' - scriptLocation: 'inlineScript' - addSpnToEnvironment: true - inlineScript: | - export ARM_CLIENT_ID=$(ClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(ClientSecret1) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(subId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(tenantId) ` - echo $ARM_TENANT_ID ` - terraform init - terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - enabled: true -- job: GovCloud_TF - steps: - - task: TerraformInstaller@0 - inputs: - terraformVersion: '1.0.8' - - task: AzureCLI@2 - name: TerraformApplyGov - displayName: "Deploy MLZ Terraform" - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - addSpnToEnvironment: true - scriptLocation: 'inlineScript' - inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(GTenantId) ` - echo $ARM_TENANT_ID ` - export ARM_ENVIRONMENT=$(CloudEnv) ` - echo $ARM_ENVIRONMENT ` - terraform init - terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false - terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - enabled: true - continueOnError: true - - task: AzureCLI@2 - name: TerraformTeardonwGov - displayName: "Teardown MLZ Terraform" - inputs: - azureSubscription: 'GAzureConnection' - scriptType: 'bash' - addSpnToEnvironment: true - scriptLocation: 'inlineScript' - inlineScript: | - az ad signed-in-user show - export ARM_CLIENT_ID=$(GClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(GTenantId) ` - echo $ARM_TENANT_ID ` - export ARM_ENVIRONMENT=$(CloudEnv) ` - echo $ARM_ENVIRONMENT ` - terraform init - terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - enabled: true From 80b70f5c485a16348488fdc2c78248d1ffecc49c Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 27 Oct 2021 23:12:48 -0400 Subject: [PATCH 061/132] Update bicepAzureCloud --- .../nightlybuild/mlz-bicep-azurecloud-pipelines.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml index cc1f90807..750e74a83 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -1,7 +1,5 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml + # Copyright (c) Microsoft Corporation. + # Licensed under the MIT License. trigger: - mlz-azure-pipelines @@ -27,6 +25,7 @@ jobs: --location $(Location) \ --template-file $(TemplateFile)\ --parameters resourcePrefix="cicdbicep" + enabled: false - task: AzureCLI@2 inputs: From e642406b72e7c3842312709ef4c7ea1994fc9a08 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 27 Oct 2021 23:16:51 -0400 Subject: [PATCH 062/132] Update mlz-bicep-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml index 750e74a83..c6cc0e7e9 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -25,7 +25,6 @@ jobs: --location $(Location) \ --template-file $(TemplateFile)\ --parameters resourcePrefix="cicdbicep" - enabled: false - task: AzureCLI@2 inputs: From 25f253d542e64ab6e7c7cf79f05f9c5245ddacdd Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 14:30:12 -0400 Subject: [PATCH 063/132] Set up CI with Azure Pipelines [skip ci] --- .azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml index 47b3bb20b..d6aac99f9 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -1,7 +1,5 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml + # Copyright (c) Microsoft Corporation. + # Licensed under the MIT License. trigger: - mlz-azure-pipelines From f5a3f7bdc3c2803b611ff0e86747b609a4d5bd04 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 17:10:21 -0400 Subject: [PATCH 064/132] Update mlz-tf-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml index 05e92c01f..79c48e59e 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -1,7 +1,5 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml + # Copyright (c) Microsoft Corporation. + # Licensed under the MIT License. trigger: - mlz-azure-pipelines From 40f93267695755428514e14c504f9299bc76cd8d Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 17:12:20 -0400 Subject: [PATCH 065/132] Update mlz-pr-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml index 621c45ed9..c8e85c80d 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml @@ -1,7 +1,5 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml + # Copyright (c) Microsoft Corporation. + # Licensed under the MIT License. trigger: - mlz-azure-pipelines From d139e29aa1e3857b873593eb15bff5d56d03a23c Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 17:16:41 -0400 Subject: [PATCH 066/132] Update mlz-bicep-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml index d6aac99f9..dcaf904cc 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -8,7 +8,7 @@ pool: vmImage: ubuntu-latest variables: - GServiceConnectionName: $(GAzureConnection) + GServiceConnectionName: $(GovConnection) jobs: - job: bicepGovCloud @@ -28,7 +28,7 @@ jobs: - task: AzureCLI@2 inputs: - azureSubscription: 'GAzureConnection' + azureSubscription: $(GServiceConnectionName) scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''cicdbicep''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' @@ -36,7 +36,7 @@ jobs: - task: AzureCLI@2 displayName: "Cleanup Resources" inputs: - azureSubscription: 'GAzureConnection' + azureSubscription: $(GServiceConnectionName) scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''cicdbicep'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' From b7baa2cb815fc49d09c210b084ee7e70018b53cb Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 17:20:16 -0400 Subject: [PATCH 067/132] Update mlz-pr-tf-azuregov-pipelines.yml for Azure Pipelines --- .../prbuild/mlz-pr-tf-azuregov-pipelines.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml index c8e85c80d..d4de9bb89 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml @@ -26,16 +26,11 @@ jobs: addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(GTenantId) ` - echo $ARM_TENANT_ID ` - export ARM_ENVIRONMENT=$(CloudEnv) ` - echo $ARM_ENVIRONMENT ` + export ARM_CLIENT_ID=$(GClientId) ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + export ARM_TENANT_ID=$(GTenantId) ` + export ARM_ENVIRONMENT=$(CloudEnv) ` terraform init terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From 1802e3cd1057308e81e9073077bd2e27f874dc8c Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 17:22:10 -0400 Subject: [PATCH 068/132] Update mlz-bicep-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml index dcaf904cc..42a9217a3 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -8,7 +8,7 @@ pool: vmImage: ubuntu-latest variables: - GServiceConnectionName: $(GovConnection) + GServiceConnectionName: $(GAzureConnection) jobs: - job: bicepGovCloud From df3588beb9937fdd2f392cd7fd856fce11e87b31 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 17:29:22 -0400 Subject: [PATCH 069/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index f511ed7c7..40bf0b008 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -36,8 +36,7 @@ jobs: terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - + useGlobalConfig: true continueOnError: true - task: AzureCLI@2 name: TerraformTeardonwGov @@ -58,4 +57,3 @@ jobs: terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true - From b5a67ea29637239234d4af117b2e5abf103b604f Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 17:32:48 -0400 Subject: [PATCH 070/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 40bf0b008..d17b82c8c 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -1,7 +1,5 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml + # Copyright (c) Microsoft Corporation. + # Licensed under the MIT License. trigger: - mlz-azure-pipelines From 767ff65d824b0e5b74e27255fb4615db38829558 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 17:44:12 -0400 Subject: [PATCH 071/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index d17b82c8c..6a571eb1c 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -20,7 +20,7 @@ jobs: name: TerraformApplyGov displayName: "Deploy MLZ Terraform" inputs: - azureSubscription: 'GAzureConnection' + azureSubscription: $(GAzureConnection) scriptType: 'bash' addSpnToEnvironment: true scriptLocation: 'inlineScript' @@ -40,7 +40,7 @@ jobs: name: TerraformTeardonwGov displayName: "Teardown MLZ Terraform" inputs: - azureSubscription: 'GAzureConnection' + azureSubscription: $(GAzureConnection) scriptType: 'bash' addSpnToEnvironment: true scriptLocation: 'inlineScript' From 8ed27bb007151c8f9fffd58ec94dc8f7d8d73717 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 17:48:09 -0400 Subject: [PATCH 072/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 6a571eb1c..442a4f2f8 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -45,7 +45,6 @@ jobs: addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: | - az ad signed-in-user show export ARM_CLIENT_ID=$(GClientId) ` export ARM_CLIENT_SECRET=$(GClientSecret) ` export ARM_SUBSCRIPTION_ID=$(GSubId) ` From 81ad76a58eae8902b630515926c6f2d506770037 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 17:57:30 -0400 Subject: [PATCH 073/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .../nightlybuild/mlz-tf-azuregov-pipelines.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 442a4f2f8..fcbf05088 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -26,12 +26,17 @@ jobs: scriptLocation: 'inlineScript' inlineScript: | export ARM_CLIENT_ID=$(GClientId) ` + echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(GClientSecret) ` + echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(GSubId) ` + echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(GTenantId) ` + echo $ARM_TENANT_ID ` export ARM_ENVIRONMENT=$(CloudEnv) ` + echo $ARM_ENVIRONMENT ` terraform init - terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false + terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true @@ -46,10 +51,15 @@ jobs: scriptLocation: 'inlineScript' inlineScript: | export ARM_CLIENT_ID=$(GClientId) ` + echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(GClientSecret) ` + echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(GSubId) ` + echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(GTenantId) ` + echo $ARM_TENANT_ID ` export ARM_ENVIRONMENT=$(CloudEnv) ` + echo $ARM_ENVIRONMENT ` terraform init terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From d9d5d80863bd74c9ec3bc990d0645b9d1ba6bdf6 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 22:21:45 -0400 Subject: [PATCH 074/132] Update mlz-tf-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml index 79c48e59e..c23349eb3 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -19,7 +19,7 @@ jobs: - task: AzureCLI@2 displayName: "Deploy MLZ Terraform" inputs: - azureSubscription: 'CAzureConnection' + azureSubscription: $(CAzureConnection) scriptType: 'bash' scriptLocation: 'inlineScript' addSpnToEnvironment: true @@ -37,7 +37,7 @@ jobs: - task: AzureCLI@2 displayName: "Teardown MLZ Terraform" inputs: - azureSubscription: 'CAzureConnection' + azureSubscription: $(CAzureConnection) scriptType: 'bash' scriptLocation: 'inlineScript' addSpnToEnvironment: true From 6d4be1c208ef305222ae96872169a3380ffbfe45 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 22:27:03 -0400 Subject: [PATCH 075/132] Update mlz-tf-azurecloud-pipelines.yml for Azure Pipelines --- .../nightlybuild/mlz-tf-azurecloud-pipelines.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml index c23349eb3..49b75c6f3 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -25,15 +25,19 @@ jobs: addSpnToEnvironment: true inlineScript: | export ARM_CLIENT_ID=$(ClientId) ` + echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(ClientSecret) ` + echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(subId) ` + echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(tenantId) ` + echo $ARM_TENANT_ID ` terraform init terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true - + continueOnError: true - task: AzureCLI@2 displayName: "Teardown MLZ Terraform" inputs: @@ -43,9 +47,13 @@ jobs: addSpnToEnvironment: true inlineScript: | export ARM_CLIENT_ID=$(ClientId) ` + echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(ClientSecret) ` + echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(subId) ` + echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(tenantId) ` + echo $ARM_TENANT_ID ` terraform init terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From bbb30c7e1ee9b220b3135d4c632f8316028a6501 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 22:52:41 -0400 Subject: [PATCH 076/132] Set up CI with Azure Pipelines [skip ci] --- .azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml index 7c09bf8da..ce50990ce 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml @@ -21,7 +21,7 @@ jobs: - task: AzureCLI@2 displayName: "Deploy MLZ Terraform" inputs: - azureSubscription: 'CAzureConnection' + azureSubscription: $(CAzureConnection) scriptType: 'bash' scriptLocation: 'inlineScript' addSpnToEnvironment: true From 1654b9d808e7b08012a6f2be1360f14646b5a3c2 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 22:58:49 -0400 Subject: [PATCH 077/132] Update mlz-pr-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml index d4de9bb89..6cb7e5b91 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml @@ -21,7 +21,7 @@ jobs: name: TerraformApplyGov displayName: "Deploy MLZ Terraform" inputs: - azureSubscription: 'GAzureConnection' + azureSubscription: $(GAzureConnection) scriptType: 'bash' addSpnToEnvironment: true scriptLocation: 'inlineScript' From 935d284b53c49a45e55c25ce0a6f9f0825277fd4 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 23:01:24 -0400 Subject: [PATCH 078/132] Update mlz-pr-tf-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml index ce50990ce..36ba18357 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml @@ -1,7 +1,5 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml + # Copyright (c) Microsoft Corporation. + # Licensed under the MIT License. trigger: - mlz-azure-pipelines From b9a3a3bf3288c9ab318e472becad608a3732cce6 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 23:01:50 -0400 Subject: [PATCH 079/132] Update mlz-pr-bicep-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml index 2995ff5ba..f0015c892 100644 --- a/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml @@ -1,7 +1,5 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml + # Copyright (c) Microsoft Corporation. + # Licensed under the MIT License. trigger: - mlz-azure-pipelines From 86780d828fc707c8be5eee127392435ba61e22d8 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 23:02:24 -0400 Subject: [PATCH 080/132] Update mlz-pr-bicep-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml b/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml index c6c5b4268..9f806d7c3 100644 --- a/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml @@ -1,7 +1,5 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml + # Copyright (c) Microsoft Corporation. + # Licensed under the MIT License. trigger: - mlz-azure-pipelines From caa2aa55cd522e32c2dac20e02f4949de198dfc3 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 23:06:37 -0400 Subject: [PATCH 081/132] Update mlz-pr-tf-azuregov-pipelines.yml for Azure Pipelines --- .../prbuild/mlz-pr-tf-azuregov-pipelines.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml index 6cb7e5b91..b006497f0 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml @@ -26,13 +26,13 @@ jobs: addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - export ARM_TENANT_ID=$(GTenantId) ` - export ARM_ENVIRONMENT=$(CloudEnv) ` + export ARM_CLIENT_ID=$(GClientId) ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + export ARM_TENANT_ID=$(GTenantId) ` + export ARM_ENVIRONMENT=$(CloudEnv) ` terraform init - terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false + terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true From 3f8b2c7524cadf019cdc60a1555e77641557c698 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Thu, 28 Oct 2021 23:08:48 -0400 Subject: [PATCH 082/132] Update mlz-pr-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml index b006497f0..760f3f799 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml @@ -27,10 +27,15 @@ jobs: scriptLocation: 'inlineScript' inlineScript: | export ARM_CLIENT_ID=$(GClientId) ` + echo $ARM_CLIENT_ID ` export ARM_CLIENT_SECRET=$(GClientSecret) ` + echo $ARM_CLIENT_SECRET ` export ARM_SUBSCRIPTION_ID=$(GSubId) ` + echo $ARM_SUBSCRIPTION_ID ` export ARM_TENANT_ID=$(GTenantId) ` + echo $ARM_TENANT_ID ` export ARM_ENVIRONMENT=$(CloudEnv) ` + echo $ARM_ENVIRONMENT ` terraform init terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From f30a52dac73730e914ff3aa0dcf77bab5757cc7f Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Fri, 29 Oct 2021 00:02:33 -0400 Subject: [PATCH 083/132] Update README.md --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index 5e721a9c2..60887dcf5 100644 --- a/README.md +++ b/README.md @@ -99,3 +99,37 @@ trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. + +
+

Nightly Build Status

+ + + + + + + + + + + + + + + + + +
Deployment Type + Azure Cloud + + Azure Government +
bicep + bicep Azure Cloud + + bicep Azure Cloud +
Terraform + bicep Azure Cloud + + bicep Azure Cloud +
+ From aa592b118b9e7edd24e58195b24cf94a20514664 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 14:59:04 -0400 Subject: [PATCH 084/132] Update mlz-bicep-azurecloud-pipelines.yml for Azure Pipelines --- .../nightlybuild/mlz-bicep-azurecloud-pipelines.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml index c6cc0e7e9..22362a901 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -23,15 +23,14 @@ jobs: az deployment sub create \ --name $(bDeploymentName) \ --location $(Location) \ - --template-file $(TemplateFile)\ - --parameters resourcePrefix="cicdbicep" + --template-file $(TemplateFile) - task: AzureCLI@2 inputs: azureSubscription: 'CAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' - inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''cicdbicep''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' + inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' - task: AzureCLI@2 displayName: "Cleanup Resources" @@ -39,5 +38,5 @@ jobs: azureSubscription: 'CAzureConnection' scriptType: 'bash' scriptLocation: 'inlineScript' - inlineScript: 'az group list -o table | grep ''cicdbicep'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' + inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' From 43350417870b64a52093d2a3ced71ac438906236 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 15:29:21 -0400 Subject: [PATCH 085/132] Update mlz-bicep-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml index 42a9217a3..6ae6a4213 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -24,14 +24,12 @@ jobs: --name $(bDeploymentName) \ --location $(GLocation) \ --template-file $(TemplateFile)\ - --parameters resourcePrefix="cicdbicep" - - task: AzureCLI@2 inputs: azureSubscription: $(GServiceConnectionName) scriptType: 'bash' scriptLocation: 'inlineScript' - inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''cicdbicep''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' + inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' - task: AzureCLI@2 displayName: "Cleanup Resources" @@ -39,5 +37,5 @@ jobs: azureSubscription: $(GServiceConnectionName) scriptType: 'bash' scriptLocation: 'inlineScript' - inlineScript: 'az group list -o table | grep ''cicdbicep'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' + inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' \ No newline at end of file From ad297b50a4d03ce8686b975e7ac91526a582d421 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 17:17:35 -0400 Subject: [PATCH 086/132] Update mlz-bicep-azurecloud-pipelines.yml for Azure Pipelines --- .../nightlybuild/mlz-bicep-azurecloud-pipelines.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml index 22362a901..b850e4c6c 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -1,8 +1,11 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. - -trigger: -- mlz-azure-pipelines +schedules: + - cron: "0 0 * * *" + displayName: "Nightly - mlz bicep azure cloud" + branches: + include: + - main pool: vmImage: ubuntu-latest @@ -27,7 +30,7 @@ jobs: - task: AzureCLI@2 inputs: - azureSubscription: 'CAzureConnection' + azureSubscription: $(ServiceConnectionName) scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' @@ -35,7 +38,7 @@ jobs: - task: AzureCLI@2 displayName: "Cleanup Resources" inputs: - azureSubscription: 'CAzureConnection' + azureSubscription: $(ServiceConnectionName) scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' From 348428d3ae2d0a3df647cd338070b201bffe5793 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 17:20:24 -0400 Subject: [PATCH 087/132] Update mlz-bicep-azuregov-pipelines.yml for Azure Pipelines --- .../nightlybuild/mlz-bicep-azuregov-pipelines.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml index 6ae6a4213..7edd65294 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -1,8 +1,13 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -trigger: -- mlz-azure-pipelines +schedules: + - cron: "0 0 * * *" + displayName: "Nightly - mlz bicep azure US Gov Cloud" + branches: + include: + - main + pool: vmImage: ubuntu-latest From 6f68d4274717f233f4d3fbeb0583063ea72406b0 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 17:21:26 -0400 Subject: [PATCH 088/132] Update mlz-tf-azurecloud-pipelines.yml for Azure Pipelines --- .../nightlybuild/mlz-tf-azurecloud-pipelines.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml index 49b75c6f3..4a5f21b1c 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -1,8 +1,13 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -trigger: -- mlz-azure-pipelines +schedules: + - cron: "0 3 * * *" + displayName: "Nightly - mlz Terraform azure cloud" + branches: + include: + - main + pool: vmImage: ubuntu-latest From 00aef56c306235774468f89f31cb2126aa6c1222 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 17:23:01 -0400 Subject: [PATCH 089/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index fcbf05088..9d59c0852 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -1,8 +1,11 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. - -trigger: -- mlz-azure-pipelines +schedules: + - cron: "0 3 * * *" + displayName: "Nightly - mlz Terraform azure US Gov cloud" + branches: + include: + - main pool: vmImage: ubuntu-latest From 8f79c54e85a250cda0500842a3a022eb251f319c Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 17:27:05 -0400 Subject: [PATCH 090/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .../mlz-tf-azuregov-pipelines.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 9d59c0852..3893004e8 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -28,18 +28,13 @@ jobs: addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(GTenantId) ` - echo $ARM_TENANT_ID ` - export ARM_ENVIRONMENT=$(CloudEnv) ` - echo $ARM_ENVIRONMENT ` - terraform init - terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false + export ARM_CLIENT_ID=$(GClientId) \ + export ARM_CLIENT_SECRET=$(GClientSecret) \ + export ARM_SUBSCRIPTION_ID=$(GSubId) \ + export ARM_TENANT_ID=$(GTenantId) \ + export ARM_ENVIRONMENT=$(CloudEnv) \ + terraform init \ + terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false \ terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true From 2c9a81001d48f58428bc4e59402f6f8401662bff Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 17:28:15 -0400 Subject: [PATCH 091/132] Update mlz-pr-tf-azurecloud-pipelines.yml for Azure Pipelines --- .../prbuild/mlz-pr-tf-azurecloud-pipelines.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml index 36ba18357..8fbeb6a7e 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml @@ -24,15 +24,11 @@ jobs: scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | - export ARM_CLIENT_ID=$(ClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(ClientSecret) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(subId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(tenantId) ` - echo $ARM_TENANT_ID ` - terraform init + export ARM_CLIENT_ID=$(ClientId) \ + export ARM_CLIENT_SECRET=$(ClientSecret) \ + export ARM_SUBSCRIPTION_ID=$(subId) \ + export ARM_TENANT_ID=$(tenantId) \ + terraform init \ terraform plan -var "hub_subid=$(subid)" -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true From 877d5d5263a7d3afae77d66d9f3946533271a212 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 17:30:16 -0400 Subject: [PATCH 092/132] Update mlz-pr-tf-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml index 8fbeb6a7e..6554def27 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml @@ -28,7 +28,7 @@ jobs: export ARM_CLIENT_SECRET=$(ClientSecret) \ export ARM_SUBSCRIPTION_ID=$(subId) \ export ARM_TENANT_ID=$(tenantId) \ - terraform init \ + terraform init terraform plan -var "hub_subid=$(subid)" -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true From 96f9dbaff861ea110e35a525a42d2ab92f1fc01f Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 17:32:43 -0400 Subject: [PATCH 093/132] Update mlz-pr-tf-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml index 6554def27..75c1cbde5 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml @@ -28,6 +28,7 @@ jobs: export ARM_CLIENT_SECRET=$(ClientSecret) \ export ARM_SUBSCRIPTION_ID=$(subId) \ export ARM_TENANT_ID=$(tenantId) \ + echo terraform init terraform plan -var "hub_subid=$(subid)" -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From ecac5b20a5029850b09a5225b52cc8b599792266 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 17:35:18 -0400 Subject: [PATCH 094/132] Update mlz-tf-azurecloud-pipelines.yml for Azure Pipelines --- .../mlz-tf-azurecloud-pipelines.yml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml index 4a5f21b1c..a2069b6c5 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -29,14 +29,14 @@ jobs: scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | - export ARM_CLIENT_ID=$(ClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(ClientSecret) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(subId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(tenantId) ` - echo $ARM_TENANT_ID ` + export ARM_CLIENT_ID=$(ClientId) \ + echo + export ARM_CLIENT_SECRET=$(ClientSecret)\ + echo + export ARM_SUBSCRIPTION_ID=$(subId) \ + echo + export ARM_TENANT_ID=$(tenantId) \ + echo terraform init terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false @@ -51,14 +51,14 @@ jobs: scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | - export ARM_CLIENT_ID=$(ClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(ClientSecret) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(subId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(tenantId) ` - echo $ARM_TENANT_ID ` + export ARM_CLIENT_ID=$(ClientId) \ + echo + export ARM_CLIENT_SECRET=$(ClientSecret) \ + echo + export ARM_SUBSCRIPTION_ID=$(subId) \ + echo + export ARM_TENANT_ID=$(tenantId) \ + echo terraform init terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From 43eaa07fcb8d7d85b8dc788d9491817b270ded9e Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 17:36:25 -0400 Subject: [PATCH 095/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .../nightlybuild/mlz-tf-azuregov-pipelines.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 3893004e8..d3f8d0711 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -33,6 +33,7 @@ jobs: export ARM_SUBSCRIPTION_ID=$(GSubId) \ export ARM_TENANT_ID=$(GTenantId) \ export ARM_ENVIRONMENT=$(CloudEnv) \ + echo terraform init \ terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false \ terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false @@ -48,16 +49,12 @@ jobs: addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(GTenantId) ` - echo $ARM_TENANT_ID ` - export ARM_ENVIRONMENT=$(CloudEnv) ` - echo $ARM_ENVIRONMENT ` + export ARM_CLIENT_ID=$(GClientId) \ + export ARM_CLIENT_SECRET=$(GClientSecret) \ + export ARM_SUBSCRIPTION_ID=$(GSubId) \ + export ARM_TENANT_ID=$(GTenantId) \ + export ARM_ENVIRONMENT=$(CloudEnv) \ + echo terraform init terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From d3d3d948cef8ed655805af0bfcf566e7601d1b65 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 17:39:35 -0400 Subject: [PATCH 096/132] Update mlz-tf-azurecloud-pipelines.yml for Azure Pipelines --- .../mlz-tf-azurecloud-pipelines.yml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml index a2069b6c5..560369d8e 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -29,14 +29,14 @@ jobs: scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | - export ARM_CLIENT_ID=$(ClientId) \ - echo - export ARM_CLIENT_SECRET=$(ClientSecret)\ - echo - export ARM_SUBSCRIPTION_ID=$(subId) \ - echo - export ARM_TENANT_ID=$(tenantId) \ - echo + export ARM_CLIENT_ID=$(ClientId) ` + echo ` + export ARM_CLIENT_SECRET=$(ClientSecret) ` + echo ` + export ARM_SUBSCRIPTION_ID=$(subId) ` + echo ` + export ARM_TENANT_ID=$(tenantId) ` + echo ` terraform init terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false @@ -51,14 +51,14 @@ jobs: scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | - export ARM_CLIENT_ID=$(ClientId) \ - echo - export ARM_CLIENT_SECRET=$(ClientSecret) \ - echo - export ARM_SUBSCRIPTION_ID=$(subId) \ - echo - export ARM_TENANT_ID=$(tenantId) \ - echo + export ARM_CLIENT_ID=$(ClientId) ` + echo ` + export ARM_CLIENT_SECRET=$(ClientSecret) ` + echo ` + export ARM_SUBSCRIPTION_ID=$(subId) ` + echo ` + export ARM_TENANT_ID=$(tenantId) ` + echo ` terraform init terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From 10397946368399753d56b7fd36347e7a44a35762 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 17:41:29 -0400 Subject: [PATCH 097/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .../mlz-tf-azuregov-pipelines.yml | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index d3f8d0711..9da63139c 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -28,12 +28,16 @@ jobs: addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: | - export ARM_CLIENT_ID=$(GClientId) \ - export ARM_CLIENT_SECRET=$(GClientSecret) \ - export ARM_SUBSCRIPTION_ID=$(GSubId) \ - export ARM_TENANT_ID=$(GTenantId) \ - export ARM_ENVIRONMENT=$(CloudEnv) \ - echo + export ARM_CLIENT_ID=$(GClientId) ` + echo ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + echo ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + echo ` + export ARM_TENANT_ID=$(GTenantId) ` + echo ` + export ARM_ENVIRONMENT=$(CloudEnv) ` + echo ` terraform init \ terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false \ terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false @@ -49,11 +53,15 @@ jobs: addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: | - export ARM_CLIENT_ID=$(GClientId) \ - export ARM_CLIENT_SECRET=$(GClientSecret) \ - export ARM_SUBSCRIPTION_ID=$(GSubId) \ - export ARM_TENANT_ID=$(GTenantId) \ - export ARM_ENVIRONMENT=$(CloudEnv) \ + export ARM_CLIENT_ID=$(GClientId) ` + echo ` + export ARM_CLIENT_SECRET=$(GClientSecret) ` + echo ` + export ARM_SUBSCRIPTION_ID=$(GSubId) ` + echo ` + export ARM_TENANT_ID=$(GTenantId) ` + echo ` + export ARM_ENVIRONMENT=$(CloudEnv) ` echo terraform init terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false From 0a8bdc8bea6dcb09685516e459480fefe431ec65 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 18:12:34 -0400 Subject: [PATCH 098/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 9da63139c..39cd07586 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -38,7 +38,7 @@ jobs: echo ` export ARM_ENVIRONMENT=$(CloudEnv) ` echo ` - terraform init \ + terraform init terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false \ terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' @@ -62,7 +62,7 @@ jobs: export ARM_TENANT_ID=$(GTenantId) ` echo ` export ARM_ENVIRONMENT=$(CloudEnv) ` - echo + echo ` terraform init terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' From 5fda9a4da7f18cf3187c44529b3bfbb7dab848d0 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Mon, 1 Nov 2021 18:18:25 -0400 Subject: [PATCH 099/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 39cd07586..806bf77c5 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -39,7 +39,7 @@ jobs: export ARM_ENVIRONMENT=$(CloudEnv) ` echo ` terraform init - terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false \ + terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true From 3d9b8a7c907d9d110bc2feb27cdc44383bff19a8 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 2 Nov 2021 09:19:42 -0400 Subject: [PATCH 100/132] Update mlz-bicep-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml index b850e4c6c..a104b0939 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -1,11 +1,12 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. schedules: - - cron: "0 0 * * *" + - cron: "0 10 * * *" displayName: "Nightly - mlz bicep azure cloud" branches: include: - main + always: true pool: vmImage: ubuntu-latest From 43905721107a8d49087ea1d40d1ba5f8ea762a07 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 2 Nov 2021 09:22:26 -0400 Subject: [PATCH 101/132] Update mlz-bicep-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml index a104b0939..67d7423e2 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. schedules: - - cron: "0 10 * * *" + - cron: "30 13 * * *" displayName: "Nightly - mlz bicep azure cloud" branches: include: From 89e51b0c8b2a1bcc62cad48cf36ffacb0199b92d Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 2 Nov 2021 09:23:02 -0400 Subject: [PATCH 102/132] Update mlz-bicep-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml index 7edd65294..fdab8aa44 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -2,12 +2,12 @@ # Licensed under the MIT License. schedules: - - cron: "0 0 * * *" + - cron: "30 13 * * *" displayName: "Nightly - mlz bicep azure US Gov Cloud" branches: include: - main - + always: true pool: vmImage: ubuntu-latest From ec4bff6bca552c5723b1e9c1176d988535ec36e8 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 2 Nov 2021 09:23:44 -0400 Subject: [PATCH 103/132] Update mlz-tf-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml index 560369d8e..e638d8412 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -2,12 +2,12 @@ # Licensed under the MIT License. schedules: - - cron: "0 3 * * *" + - cron: "30 14 * * *" displayName: "Nightly - mlz Terraform azure cloud" branches: include: - main - + always: true pool: vmImage: ubuntu-latest From 362508d03a3b1a68e1869c0b180d306beb0ece5e Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Tue, 2 Nov 2021 09:24:17 -0400 Subject: [PATCH 104/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 806bf77c5..8fddb4da7 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -1,12 +1,12 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. schedules: - - cron: "0 3 * * *" + - cron: "30 14 * * *" displayName: "Nightly - mlz Terraform azure US Gov cloud" branches: include: - main - + always: true pool: vmImage: ubuntu-latest From 51d4a74489d2d0dbfcaa9e634a64033d0404e1c6 Mon Sep 17 00:00:00 2001 From: Glenn Musa <4622125+glennmusa@users.noreply.github.com> Date: Tue, 2 Nov 2021 10:17:28 -0400 Subject: [PATCH 105/132] Execute `export` commands individually on Terraform plan and apply pipelines (#499) --- .../mlz-tf-azurecloud-pipelines.yml | 35 +++++++------------ .../mlz-pr-tf-azurecloud-pipelines.yml | 24 ++++++------- 2 files changed, 24 insertions(+), 35 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml index e638d8412..c3c55b37c 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -1,4 +1,4 @@ - # Copyright (c) Microsoft Corporation. + # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. schedules: @@ -14,7 +14,7 @@ pool: variables: ServiceConnectionName: $(CAzureConnection) - + jobs: - job: CommercialCloud_TF steps: @@ -29,16 +29,12 @@ jobs: scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | - export ARM_CLIENT_ID=$(ClientId) ` - echo ` - export ARM_CLIENT_SECRET=$(ClientSecret) ` - echo ` - export ARM_SUBSCRIPTION_ID=$(subId) ` - echo ` - export ARM_TENANT_ID=$(tenantId) ` - echo ` - terraform init - terraform plan -var "hub_subid=$(subid)" -input=false + export ARM_CLIENT_ID=$(ClientId) + export ARM_CLIENT_SECRET=$(ClientSecret) + export ARM_SUBSCRIPTION_ID=$(subId) + export ARM_TENANT_ID=$(tenantId) + terraform init + terraform plan -var "hub_subid=$(subid)" -input=false terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true @@ -51,16 +47,11 @@ jobs: scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | - export ARM_CLIENT_ID=$(ClientId) ` - echo ` - export ARM_CLIENT_SECRET=$(ClientSecret) ` - echo ` - export ARM_SUBSCRIPTION_ID=$(subId) ` - echo ` - export ARM_TENANT_ID=$(tenantId) ` - echo ` - terraform init + export ARM_CLIENT_ID=$(ClientId) + export ARM_CLIENT_SECRET=$(ClientSecret) + export ARM_SUBSCRIPTION_ID=$(subId) + export ARM_TENANT_ID=$(tenantId) + terraform init terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true - diff --git a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml index 75c1cbde5..a601b79cd 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml @@ -2,14 +2,16 @@ # Licensed under the MIT License. trigger: -- mlz-azure-pipelines + branches: + include: + - mlz-azure-pipelines pool: vmImage: ubuntu-latest variables: ServiceConnectionName: $(CAzureConnection) - + jobs: - job: CommercialCloud_TF steps: @@ -17,22 +19,18 @@ jobs: inputs: terraformVersion: '1.0.8' - task: AzureCLI@2 - displayName: "Deploy MLZ Terraform" + displayName: "Terraform Plan" inputs: azureSubscription: $(CAzureConnection) scriptType: 'bash' scriptLocation: 'inlineScript' addSpnToEnvironment: true inlineScript: | - export ARM_CLIENT_ID=$(ClientId) \ - export ARM_CLIENT_SECRET=$(ClientSecret) \ - export ARM_SUBSCRIPTION_ID=$(subId) \ - export ARM_TENANT_ID=$(tenantId) \ - echo - terraform init - terraform plan -var "hub_subid=$(subid)" -input=false + export ARM_CLIENT_ID=$(ClientId) + export ARM_CLIENT_SECRET=$(ClientSecret) + export ARM_SUBSCRIPTION_ID=$(subId) + export ARM_TENANT_ID=$(tenantId) + terraform init + terraform plan -var "hub_subid=$(subid)" -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true - - - From f9f4b8facbec9100a739f63131bafdb9b8b6734f Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 17:33:25 -0400 Subject: [PATCH 106/132] Update mlz-bicep-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml index 67d7423e2..c88459f6c 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. schedules: - - cron: "30 13 * * *" + - cron: "0 0 * * *" displayName: "Nightly - mlz bicep azure cloud" branches: include: From 543a2e2acbc708f2bff3e26c384a976264871d69 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 18:03:19 -0400 Subject: [PATCH 107/132] Update mlz-bicep-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml index fdab8aa44..a006d2118 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -2,7 +2,7 @@ # Licensed under the MIT License. schedules: - - cron: "30 13 * * *" + - cron: "0 0 * * *" displayName: "Nightly - mlz bicep azure US Gov Cloud" branches: include: From 2b665ad9bbd853422bb541007eb8b1272d1e298b Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 18:04:08 -0400 Subject: [PATCH 108/132] Update mlz-tf-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml index c3c55b37c..0a5753b1f 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -2,7 +2,7 @@ # Licensed under the MIT License. schedules: - - cron: "30 14 * * *" + - cron: "0 2 * * *" displayName: "Nightly - mlz Terraform azure cloud" branches: include: From 6df89664e40338e731899f55df174981bd00b966 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 18:04:59 -0400 Subject: [PATCH 109/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 8fddb4da7..24e0c9f03 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. schedules: - - cron: "30 14 * * *" + - cron: "0 2 * * *" displayName: "Nightly - mlz Terraform azure US Gov cloud" branches: include: From 5660ecca5aa0d2ef50656d0a68c9faa5062181d9 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 20:50:05 -0400 Subject: [PATCH 110/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 24e0c9f03..50d4d4ae1 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -1,12 +1,12 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. schedules: - - cron: "0 2 * * *" - displayName: "Nightly - mlz Terraform azure US Gov cloud" + - cron: '0 1 * * *' + displayName: Nightly mlz Terraform azure US Gov cloud branches: include: - main - always: true + always: 'true' pool: vmImage: ubuntu-latest From 86cf9ae0e3afc4de951f20ade86ea4138568e96b Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 21:26:20 -0400 Subject: [PATCH 111/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 50d4d4ae1..d9550043b 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. schedules: - - cron: '0 1 * * *' + - cron: '30 21 * * *' displayName: Nightly mlz Terraform azure US Gov cloud branches: include: From e070f4aa24e494f48f74d5796c4243a8fdfa9613 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 21:38:00 -0400 Subject: [PATCH 112/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index d9550043b..fed747fff 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. schedules: - - cron: '30 21 * * *' + - cron: '40 1 * * *' displayName: Nightly mlz Terraform azure US Gov cloud branches: include: From ce68bdea44139d0e84683a41006b32e5f507de12 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 21:48:04 -0400 Subject: [PATCH 113/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index fed747fff..940febd18 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. schedules: - - cron: '40 1 * * *' + - cron: '50 1 * * *' displayName: Nightly mlz Terraform azure US Gov cloud branches: include: From fc7c9c0d361b3d99470a57a106a1d5737bfc9dea Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 21:49:24 -0400 Subject: [PATCH 114/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 940febd18..ea0626206 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -1,8 +1,9 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. + schedules: - cron: '50 1 * * *' - displayName: Nightly mlz Terraform azure US Gov cloud + displayName: Nightly branches: include: - main From 06ca20b3e3f3f3db36163570bf64b04165d1c1d4 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 21:52:52 -0400 Subject: [PATCH 115/132] Update mlz-tf-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index ea0626206..21b87b478 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -2,11 +2,11 @@ # Licensed under the MIT License. schedules: - - cron: '50 1 * * *' + - cron: '55 1 * * *' displayName: Nightly branches: include: - - main + - mlz-azure-pipelines always: 'true' pool: vmImage: ubuntu-latest From a9aa6636d476743de97c20ee955fc6ba40b3cff3 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 21:59:20 -0400 Subject: [PATCH 116/132] Update mlz-tf-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml index 0a5753b1f..e7b9439a9 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -6,7 +6,7 @@ schedules: displayName: "Nightly - mlz Terraform azure cloud" branches: include: - - main + - mlz-azure-pipelines always: true pool: From 6b0656c01516807115b46bfec0ff4b39cb00bb42 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 22:00:01 -0400 Subject: [PATCH 117/132] Update mlz-bicep-azuregov-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml index a006d2118..fb1f45441 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -2,11 +2,11 @@ # Licensed under the MIT License. schedules: - - cron: "0 0 * * *" + - cron: "0 4 * * *" displayName: "Nightly - mlz bicep azure US Gov Cloud" branches: include: - - main + - mlz-azure-pipelines always: true pool: From 2f6127aafb62cbdb0f1466daa3697138d05b09a1 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Wed, 3 Nov 2021 22:00:29 -0400 Subject: [PATCH 118/132] Update mlz-bicep-azurecloud-pipelines.yml for Azure Pipelines --- .azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml index c88459f6c..be0e07c8f 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -1,11 +1,11 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. schedules: - - cron: "0 0 * * *" + - cron: "0 4 * * *" displayName: "Nightly - mlz bicep azure cloud" branches: include: - - main + - mlz-azure-pipelines always: true pool: From 008cc5dc83910b78ba586acd27007221d5072626 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Fri, 5 Nov 2021 09:42:04 -0400 Subject: [PATCH 119/132] Add nightly and PR validation pipelines in Azure DevOps #437 --- .../mlz-bicep-azurecloud-pipelines.yml | 1 + .../mlz-bicep-azuregov-pipelines.yml | 1 + .../mlz-tf-azurecloud-pipelines.yml | 1 + .../mlz-tf-azuregov-pipelines.yml | 33 +++++++------------ .../mlz-pr-bicep-azurecloud-pipelines.yml | 1 + .../mlz-pr-bicep-azuregov-pipelines.yml | 1 + .../mlz-pr-tf-azurecloud-pipelines.yml | 1 + .../prbuild/mlz-pr-tf-azuregov-pipelines.yml | 1 + 8 files changed, 19 insertions(+), 21 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml index be0e07c8f..19ed6c9b3 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -5,6 +5,7 @@ schedules: displayName: "Nightly - mlz bicep azure cloud" branches: include: + - main - mlz-azure-pipelines always: true diff --git a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml index fb1f45441..4e0de521b 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -6,6 +6,7 @@ schedules: displayName: "Nightly - mlz bicep azure US Gov Cloud" branches: include: + - main - mlz-azure-pipelines always: true diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml index e7b9439a9..247f63189 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -6,6 +6,7 @@ schedules: displayName: "Nightly - mlz Terraform azure cloud" branches: include: + - main - mlz-azure-pipelines always: true diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 21b87b478..2aac28a81 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -3,9 +3,10 @@ schedules: - cron: '55 1 * * *' - displayName: Nightly + displayName: "Nightly - mlz Terraform azure US Gov cloud" branches: include: + - main - mlz-azure-pipelines always: 'true' pool: @@ -29,16 +30,11 @@ jobs: addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - echo ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - echo ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - echo ` - export ARM_TENANT_ID=$(GTenantId) ` - echo ` - export ARM_ENVIRONMENT=$(CloudEnv) ` - echo ` + export ARM_CLIENT_ID=$(GClientId) + export ARM_CLIENT_SECRET=$(GClientSecret) + export ARM_SUBSCRIPTION_ID=$(GSubId) + export ARM_TENANT_ID=$(GTenantId) + export ARM_ENVIRONMENT=$(CloudEnv) terraform init terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false @@ -54,16 +50,11 @@ jobs: addSpnToEnvironment: true scriptLocation: 'inlineScript' inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - echo ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - echo ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - echo ` - export ARM_TENANT_ID=$(GTenantId) ` - echo ` - export ARM_ENVIRONMENT=$(CloudEnv) ` - echo ` + export ARM_CLIENT_ID=$(GClientId) + export ARM_CLIENT_SECRET=$(GClientSecret) + export ARM_SUBSCRIPTION_ID=$(GSubId) + export ARM_TENANT_ID=$(GTenantId) + export ARM_ENVIRONMENT=$(CloudEnv) terraform init terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' diff --git a/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml index f0015c892..d493e7fe6 100644 --- a/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml @@ -2,6 +2,7 @@ # Licensed under the MIT License. trigger: +- main - mlz-azure-pipelines pool: diff --git a/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml b/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml index 9f806d7c3..1d16396fe 100644 --- a/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml @@ -2,6 +2,7 @@ # Licensed under the MIT License. trigger: +- main - mlz-azure-pipelines pool: diff --git a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml index a601b79cd..ce875ffd3 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml @@ -4,6 +4,7 @@ trigger: branches: include: + - main - mlz-azure-pipelines pool: diff --git a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml index 760f3f799..0aa7c1c3e 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml @@ -2,6 +2,7 @@ # Licensed under the MIT License. trigger: +- main - mlz-azure-pipelines pool: From f91167c1342d93160c6679685ac010a4b53f464f Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Fri, 5 Nov 2021 19:24:33 -0400 Subject: [PATCH 120/132] Update README.md removed the html table tags --- README.md | 43 +++++++++++-------------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 31dddcfd1..5fe7662e7 100644 --- a/README.md +++ b/README.md @@ -116,36 +116,15 @@ trademarks or logos is subject to and must follow Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. -
-

Nightly Build Status

- - - - - - - - - - - - - - - - - -
Deployment Type - Azure Cloud - - Azure Government -
bicep - bicep Azure Cloud - - bicep Azure Cloud -
Terraform - bicep Azure Cloud - - bicep Azure Cloud -
+ +## Nightly Build Status + + +|Deployment Type|Azure Cloud| Azure Government| +|-------------|--------------|-----------------| +|Bicep| bicep Azure Cloud |bicep Azure Cloud| +|Terraform| bicep Azure Cloud |bicep Azure Cloud| + + + From 4b80aabb312e813404236d8c96e67f7bbd4641a6 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Fri, 5 Nov 2021 19:32:20 -0400 Subject: [PATCH 121/132] Update README.md updated the image based on github guidance --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5fe7662e7..6b1a9876e 100644 --- a/README.md +++ b/README.md @@ -122,8 +122,8 @@ Any use of third-party trademarks or logos are subject to those third-party's po |Deployment Type|Azure Cloud| Azure Government| |-------------|--------------|-----------------| -|Bicep| bicep Azure Cloud |bicep Azure Cloud| -|Terraform| bicep Azure Cloud |bicep Azure Cloud| +|Bicep| [![Build Status](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_apis/build/status/missionlz/mlz.bicep.azurecloud.nightly.build?branchName=mlz-azure-pipelines)](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_build/latest?definitionId=470&branchName=mlz-azure-pipelines)|[![Build Status](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_apis/build/status/missionlz/mlz.bicep.azuregov.nightly.build?branchName=mlz-azure-pipelines)](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_build/latest?definitionId=483&branchName=mlz-azure-pipelines)| +|Terraform| [![Build Status](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_apis/build/status/missionlz/mlz.tf.azurecloud.nightly.build?branchName=mlz-azure-pipelines)](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_build/latest?definitionId=484&branchName=mlz-azure-pipelines) |[![Build Status](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_apis/build/status/missionlz/mlz.tf.azuregov.nightly.build?branchName=mlz-azure-pipelines)](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_build/latest?definitionId=485&branchName=mlz-azure-pipelines)| From b591368ec4d5c83aa86cc30697e7314c57f3e14d Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Fri, 5 Nov 2021 19:38:49 -0400 Subject: [PATCH 122/132] Update delete.sh added #!/usr/bin/env bash --- src/build/delete.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/build/delete.sh b/src/build/delete.sh index 5589dc3a8..dadec9ac3 100644 --- a/src/build/delete.sh +++ b/src/build/delete.sh @@ -3,6 +3,7 @@ # Then steps through each diagnostic setting at subscription level with similar filter, # resets az cli account to a specific subscription to be able to continue to use command line. # Usage: ./delete.sh "" "" +#!/usr/bin/env bash for subscription in `az account list -o tsv`; do az account set --subscription $subscription for rgname in `az group list --query "[? contains(name,'$1')][].{name:name}" -o tsv`; do @@ -14,4 +15,4 @@ for subscription in `az account list -o tsv`; do az monitor diagnostic-settings delete --name $setting --resource "/subscriptions/${subscription}" done done -az account set --subscription $2 \ No newline at end of file +az account set --subscription $2 From b1511420e3b258961ad0055d5d1c43be63f07520 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Fri, 5 Nov 2021 19:42:50 -0400 Subject: [PATCH 123/132] Update delete.sh moved #!/usr/bin/env bash to first line --- src/build/delete.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/build/delete.sh b/src/build/delete.sh index dadec9ac3..368f35806 100644 --- a/src/build/delete.sh +++ b/src/build/delete.sh @@ -1,9 +1,10 @@ +#!/usr/bin/env bash # Steps through current logged in az cli subscriptions and deletes resource groups based on first arg, # as filter as a job by not waiting for them to complete. # Then steps through each diagnostic setting at subscription level with similar filter, # resets az cli account to a specific subscription to be able to continue to use command line. # Usage: ./delete.sh "" "" -#!/usr/bin/env bash + for subscription in `az account list -o tsv`; do az account set --subscription $subscription for rgname in `az group list --query "[? contains(name,'$1')][].{name:name}" -o tsv`; do From 6e4e1ff4f26fb62ccf3781ad3b7a2704b64a2ca3 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Fri, 5 Nov 2021 19:49:39 -0400 Subject: [PATCH 124/132] Update delete.sh --- src/build/delete.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/build/delete.sh b/src/build/delete.sh index 368f35806..695cb1a44 100644 --- a/src/build/delete.sh +++ b/src/build/delete.sh @@ -6,7 +6,7 @@ # Usage: ./delete.sh "" "" for subscription in `az account list -o tsv`; do - az account set --subscription $subscription + az account set --subscription "${subscription" for rgname in `az group list --query "[? contains(name,'$1')][].{name:name}" -o tsv`; do echo Deleting ${rgname} az group delete -n ${rgname} --yes --no-wait @@ -16,4 +16,4 @@ for subscription in `az account list -o tsv`; do az monitor diagnostic-settings delete --name $setting --resource "/subscriptions/${subscription}" done done -az account set --subscription $2 +# az account set --subscription $2 From d976997dac76754aeb3c35099ee0e1597db593ed Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Fri, 5 Nov 2021 19:55:06 -0400 Subject: [PATCH 125/132] Update delete.sh --- src/build/delete.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/build/delete.sh b/src/build/delete.sh index 695cb1a44..fe997ff87 100644 --- a/src/build/delete.sh +++ b/src/build/delete.sh @@ -6,14 +6,14 @@ # Usage: ./delete.sh "" "" for subscription in `az account list -o tsv`; do - az account set --subscription "${subscription" + az account set --subscription "${subscription}" for rgname in `az group list --query "[? contains(name,'$1')][].{name:name}" -o tsv`; do echo Deleting ${rgname} az group delete -n ${rgname} --yes --no-wait done for setting in `az monitor diagnostic-settings subscription list --query "value[? contains(@.name, '$1')].name" -o tsv`; do echo Deleting ${setting} - az monitor diagnostic-settings delete --name $setting --resource "/subscriptions/${subscription}" + az monitor diagnostic-settings delete --name $setting --resource /subscriptions/${subscription} done done # az account set --subscription $2 From 5c94126765db34012fbfbd7bb0fe2686411aeee5 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Fri, 5 Nov 2021 19:59:42 -0400 Subject: [PATCH 126/132] Update delete.sh --- src/build/delete.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/build/delete.sh b/src/build/delete.sh index fe997ff87..dcfffdece 100644 --- a/src/build/delete.sh +++ b/src/build/delete.sh @@ -5,15 +5,15 @@ # resets az cli account to a specific subscription to be able to continue to use command line. # Usage: ./delete.sh "" "" -for subscription in `az account list -o tsv`; do +for subscription in $(az account list -o tsv); do az account set --subscription "${subscription}" - for rgname in `az group list --query "[? contains(name,'$1')][].{name:name}" -o tsv`; do - echo Deleting ${rgname} - az group delete -n ${rgname} --yes --no-wait + for rgname in $(az group list --query "[? contains(name,'$1')][].{name:name}" -o tsv); do + echo Deleting "${rgname}" + az group delete -n "${rgname}" --yes --no-wait done - for setting in `az monitor diagnostic-settings subscription list --query "value[? contains(@.name, '$1')].name" -o tsv`; do - echo Deleting ${setting} - az monitor diagnostic-settings delete --name $setting --resource /subscriptions/${subscription} + for setting in $(az monitor diagnostic-settings subscription list --query "value[? contains(@.name, '$1')].name" -o tsv); do + echo Deleting "${setting}" + az monitor diagnostic-settings delete --name $setting --resource /subscriptions/"${subscription}" done done # az account set --subscription $2 From ea7f2ebc683986a3428f1b23c1deddbfdc707195 Mon Sep 17 00:00:00 2001 From: Vidya Bala Date: Fri, 5 Nov 2021 20:03:35 -0400 Subject: [PATCH 127/132] Update delete.sh --- src/build/delete.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/build/delete.sh b/src/build/delete.sh index dcfffdece..68c384f84 100644 --- a/src/build/delete.sh +++ b/src/build/delete.sh @@ -13,7 +13,7 @@ for subscription in $(az account list -o tsv); do done for setting in $(az monitor diagnostic-settings subscription list --query "value[? contains(@.name, '$1')].name" -o tsv); do echo Deleting "${setting}" - az monitor diagnostic-settings delete --name $setting --resource /subscriptions/"${subscription}" + az monitor diagnostic-settings delete --name "${setting}" --resource /subscriptions/"${subscription}" done done -# az account set --subscription $2 +az account set --subscription "$2" From 4213480e9b3bc90c2d8ecd0f91b60babb65334be Mon Sep 17 00:00:00 2001 From: Glenn Musa <4622125+glennmusa@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:04:47 +0000 Subject: [PATCH 128/132] format mlz main.tf --- src/terraform/mlz/main.tf | 47 ++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/terraform/mlz/main.tf b/src/terraform/mlz/main.tf index db49b444f..9a98ae159 100644 --- a/src/terraform/mlz/main.tf +++ b/src/terraform/mlz/main.tf @@ -126,40 +126,41 @@ resource "random_id" "random" { } byte_length = 8 } + resource "azurerm_resource_group" "hub" { - provider = azurerm.hub + provider = azurerm.hub depends_on = [random_id.random] - location = var.location - name = "${var.resourcePrefix}-${random_id.random.hex}-${var.hub_rgname}" - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + location = var.location + name = "${var.resourcePrefix}-${random_id.random.hex}-${var.hub_rgname}" + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } resource "azurerm_resource_group" "tier0" { - provider = azurerm.tier0 + provider = azurerm.tier0 depends_on = [random_id.random] location = var.location - name = "${var.resourcePrefix}-${random_id.random.hex}-${var.tier0_rgname}" - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + name = "${var.resourcePrefix}-${random_id.random.hex}-${var.tier0_rgname}" + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } resource "azurerm_resource_group" "tier1" { - provider = azurerm.tier1 + provider = azurerm.tier1 depends_on = [random_id.random] location = var.location - name = "${var.resourcePrefix}-${random_id.random.hex}-${var.tier1_rgname}" - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + name = "${var.resourcePrefix}-${random_id.random.hex}-${var.tier1_rgname}" + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } resource "azurerm_resource_group" "tier2" { - provider = azurerm.tier2 + provider = azurerm.tier2 depends_on = [random_id.random] location = var.location - name = "${var.resourcePrefix}-${random_id.random.hex}-${var.tier2_rgname}" - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + name = "${var.resourcePrefix}-${random_id.random.hex}-${var.tier2_rgname}" + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } ################################ @@ -183,7 +184,7 @@ resource "azurerm_log_analytics_workspace" "laws" { location = var.location sku = "PerGB2018" retention_in_days = "30" - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } resource "azurerm_log_analytics_solution" "laws_sentinel" { @@ -200,7 +201,7 @@ resource "azurerm_log_analytics_solution" "laws_sentinel" { publisher = "Microsoft" product = "OMSGallery/SecurityInsights" } - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } ############################### @@ -220,7 +221,7 @@ module "hub-network" { management_address_space = var.hub_management_address_space log_analytics_workspace_resource_id = azurerm_log_analytics_workspace.laws.id - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } module "firewall" { @@ -248,7 +249,7 @@ module "firewall" { management_publicip_name = var.management_publicip_name log_analytics_workspace_resource_id = azurerm_log_analytics_workspace.laws.id - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } module "spoke-network-t0" { @@ -268,7 +269,7 @@ module "spoke-network-t0" { spoke_vnetname = var.tier0_vnetname spoke_vnet_address_space = var.tier0_vnet_address_space subnets = var.tier0_subnets - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } resource "azurerm_virtual_network_peering" "t0-to-hub" { @@ -312,7 +313,7 @@ module "spoke-network-t1" { spoke_vnetname = var.tier1_vnetname spoke_vnet_address_space = var.tier1_vnet_address_space subnets = var.tier1_subnets - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } resource "azurerm_virtual_network_peering" "t1-to-hub" { @@ -356,7 +357,7 @@ module "spoke-network-t2" { spoke_vnetname = var.tier2_vnetname spoke_vnet_address_space = var.tier2_vnet_address_space subnets = var.tier2_subnets - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } resource "azurerm_virtual_network_peering" "t2-to-hub" { @@ -418,7 +419,7 @@ module "jumpbox-subnet" { log_analytics_workspace_id = azurerm_log_analytics_workspace.laws.workspace_id log_analytics_workspace_location = var.location log_analytics_workspace_resource_id = azurerm_log_analytics_workspace.laws.id - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } module "bastion-host" { @@ -434,7 +435,7 @@ module "bastion-host" { subnet_address_prefix = var.bastion_address_space public_ip_name = var.bastion_public_ip_name ipconfig_name = var.bastion_ipconfig_name - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } module "jumpbox" { @@ -467,7 +468,7 @@ module "jumpbox" { linux_offer = var.jumpbox_linux_vm_offer linux_sku = var.jumpbox_linux_vm_sku linux_image_version = var.jumpbox_linux_vm_version - tags = merge(var.tags,{"resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}"}) + tags = merge(var.tags, { "resourcePrefix" = "${var.resourcePrefix}-${random_id.random.hex}" }) } ##################################### From 71719ad1c36416bfa853be3271d0f11dabb49804 Mon Sep 17 00:00:00 2001 From: Glenn Musa <4622125+glennmusa@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:06:09 +0000 Subject: [PATCH 129/132] add copyright to a shell script --- src/build/delete.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/build/delete.sh b/src/build/delete.sh index 68c384f84..5584dc6ae 100644 --- a/src/build/delete.sh +++ b/src/build/delete.sh @@ -1,6 +1,11 @@ -#!/usr/bin/env bash +#!/bin/bash +# +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# # Steps through current logged in az cli subscriptions and deletes resource groups based on first arg, # as filter as a job by not waiting for them to complete. +# # Then steps through each diagnostic setting at subscription level with similar filter, # resets az cli account to a specific subscription to be able to continue to use command line. # Usage: ./delete.sh "" "" @@ -16,4 +21,5 @@ for subscription in $(az account list -o tsv); do az monitor diagnostic-settings delete --name "${setting}" --resource /subscriptions/"${subscription}" done done + az account set --subscription "$2" From d92d4800454ecc1af371a0b5dea642f76a8c37ff Mon Sep 17 00:00:00 2001 From: Glenn Musa <4622125+glennmusa@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:22:06 +0000 Subject: [PATCH 130/132] yaml linting --- .../mlz-bicep-azurecloud-pipelines.yml | 17 ++-- .../mlz-bicep-azuregov-pipelines.yml | 17 ++-- .../mlz-tf-azurecloud-pipelines.yml | 66 +++++++------- .../mlz-tf-azuregov-pipelines.yml | 86 +++++++++---------- .../mlz-pr-bicep-azurecloud-pipelines.yml | 7 +- .../mlz-pr-bicep-azuregov-pipelines.yml | 6 +- .../mlz-pr-tf-azurecloud-pipelines.yml | 30 +++---- .../prbuild/mlz-pr-tf-azuregov-pipelines.yml | 56 +++++------- 8 files changed, 134 insertions(+), 151 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml index 19ed6c9b3..c7c03520d 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -1,8 +1,9 @@ - # Copyright (c) Microsoft Corporation. - # Licensed under the MIT License. +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + schedules: - cron: "0 4 * * *" - displayName: "Nightly - mlz bicep azure cloud" + displayName: "Nightly - mlz bicep azure cloud" branches: include: - main @@ -13,8 +14,8 @@ pool: vmImage: ubuntu-latest variables: - ServiceConnectionName: $(CAzureConnection) - + ServiceConnectionName: $(CAzureConnection) + jobs: - job: bicepCommercialCloud steps: @@ -29,19 +30,17 @@ jobs: --name $(bDeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) - - task: AzureCLI@2 + displayName: "Clean up Subscription Diagnostics Settings" inputs: azureSubscription: $(ServiceConnectionName) scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(subId)"'' --name "$1)}''' - - task: AzureCLI@2 - displayName: "Cleanup Resources" + displayName: "Clean up Resources" inputs: azureSubscription: $(ServiceConnectionName) scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - diff --git a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml index 4e0de521b..95c60b7ff 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -1,9 +1,9 @@ - # Copyright (c) Microsoft Corporation. - # Licensed under the MIT License. +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. schedules: - cron: "0 4 * * *" - displayName: "Nightly - mlz bicep azure US Gov Cloud" + displayName: "Nightly - mlz bicep azure US Gov Cloud" branches: include: - main @@ -15,7 +15,7 @@ pool: variables: GServiceConnectionName: $(GAzureConnection) - + jobs: - job: bicepGovCloud steps: @@ -29,19 +29,18 @@ jobs: az deployment sub create \ --name $(bDeploymentName) \ --location $(GLocation) \ - --template-file $(TemplateFile)\ + --template-file $(TemplateFile) - task: AzureCLI@2 + displayName: "Clean up Subscription Diagnostics Settings" inputs: azureSubscription: $(GServiceConnectionName) scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: 'az monitor diagnostic-settings subscription list --query "value[? contains(@.name, ''$1'')].name" -o table |grep ''mlz''| awk ''{system(" az monitor diagnostic-settings delete --resource ''"/subscriptions/$(GSubId)"'' --name "$1)}''' - - task: AzureCLI@2 - displayName: "Cleanup Resources" + displayName: "Clean up Resources" inputs: azureSubscription: $(GServiceConnectionName) scriptType: 'bash' scriptLocation: 'inlineScript' - inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' - \ No newline at end of file + inlineScript: 'az group list -o table | grep ''mlz'' | awk ''{system("az group delete -y --no-wait -g "$1)}''' diff --git a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml index 247f63189..65e8ade96 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azurecloud-pipelines.yml @@ -1,9 +1,9 @@ - # Copyright (c) Microsoft Corporation. - # Licensed under the MIT License. +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. schedules: - cron: "0 2 * * *" - displayName: "Nightly - mlz Terraform azure cloud" + displayName: "Nightly - mlz Terraform azure cloud" branches: include: - main @@ -23,36 +23,36 @@ jobs: inputs: terraformVersion: '1.0.8' - task: AzureCLI@2 - displayName: "Deploy MLZ Terraform" - inputs: - azureSubscription: $(CAzureConnection) - scriptType: 'bash' - scriptLocation: 'inlineScript' - addSpnToEnvironment: true - inlineScript: | - export ARM_CLIENT_ID=$(ClientId) - export ARM_CLIENT_SECRET=$(ClientSecret) - export ARM_SUBSCRIPTION_ID=$(subId) - export ARM_TENANT_ID=$(tenantId) - terraform init - terraform plan -var "hub_subid=$(subid)" -input=false - terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true + displayName: "Apply MLZ Terraform" continueOnError: true + inputs: + azureSubscription: $(CAzureConnection) + scriptType: 'bash' + scriptLocation: 'inlineScript' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(ClientId) + export ARM_CLIENT_SECRET=$(ClientSecret) + export ARM_SUBSCRIPTION_ID=$(subId) + export ARM_TENANT_ID=$(tenantId) + terraform init + terraform plan -var "hub_subid=$(subid)" -input=false + terraform apply -var "hub_subid=$(subid)" -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true - task: AzureCLI@2 - displayName: "Teardown MLZ Terraform" + displayName: "Destroy MLZ Terraform" inputs: - azureSubscription: $(CAzureConnection) - scriptType: 'bash' - scriptLocation: 'inlineScript' - addSpnToEnvironment: true - inlineScript: | - export ARM_CLIENT_ID=$(ClientId) - export ARM_CLIENT_SECRET=$(ClientSecret) - export ARM_SUBSCRIPTION_ID=$(subId) - export ARM_TENANT_ID=$(tenantId) - terraform init - terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true + azureSubscription: $(CAzureConnection) + scriptType: 'bash' + scriptLocation: 'inlineScript' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(ClientId) + export ARM_CLIENT_SECRET=$(ClientSecret) + export ARM_SUBSCRIPTION_ID=$(subId) + export ARM_TENANT_ID=$(tenantId) + terraform init + terraform destroy -var "hub_subid=$(subid)" -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 2aac28a81..7d31ac6e0 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -1,5 +1,5 @@ - # Copyright (c) Microsoft Corporation. - # Licensed under the MIT License. +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. schedules: - cron: '55 1 * * *' @@ -14,48 +14,46 @@ pool: variables: GServiceConnectionName: $(GAzureConnection) - + jobs: - job: GovCloud_TF steps: - - task: TerraformInstaller@0 - inputs: - terraformVersion: '1.0.8' - - task: AzureCLI@2 - name: TerraformApplyGov - displayName: "Deploy MLZ Terraform" - inputs: - azureSubscription: $(GAzureConnection) - scriptType: 'bash' - addSpnToEnvironment: true - scriptLocation: 'inlineScript' - inlineScript: | - export ARM_CLIENT_ID=$(GClientId) - export ARM_CLIENT_SECRET=$(GClientSecret) - export ARM_SUBSCRIPTION_ID=$(GSubId) - export ARM_TENANT_ID=$(GTenantId) - export ARM_ENVIRONMENT=$(CloudEnv) - terraform init - terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false - terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - continueOnError: true - - task: AzureCLI@2 - name: TerraformTeardonwGov - displayName: "Teardown MLZ Terraform" - inputs: - azureSubscription: $(GAzureConnection) - scriptType: 'bash' - addSpnToEnvironment: true - scriptLocation: 'inlineScript' - inlineScript: | - export ARM_CLIENT_ID=$(GClientId) - export ARM_CLIENT_SECRET=$(GClientSecret) - export ARM_SUBSCRIPTION_ID=$(GSubId) - export ARM_TENANT_ID=$(GTenantId) - export ARM_ENVIRONMENT=$(CloudEnv) - terraform init - terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true + - task: TerraformInstaller@0 + inputs: + terraformVersion: '1.0.8' + - task: AzureCLI@2 + displayName: "Apply MLZ Terraform" + continueOnError: true + inputs: + azureSubscription: $(GAzureConnection) + scriptType: 'bash' + addSpnToEnvironment: true + scriptLocation: 'inlineScript' + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) + export ARM_CLIENT_SECRET=$(GClientSecret) + export ARM_SUBSCRIPTION_ID=$(GSubId) + export ARM_TENANT_ID=$(GTenantId) + export ARM_ENVIRONMENT=$(CloudEnv) + terraform init + terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false + terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true + - task: AzureCLI@2 + displayName: "Destroy MLZ Terraform" + inputs: + azureSubscription: $(GAzureConnection) + scriptType: 'bash' + addSpnToEnvironment: true + scriptLocation: 'inlineScript' + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) + export ARM_CLIENT_SECRET=$(GClientSecret) + export ARM_SUBSCRIPTION_ID=$(GSubId) + export ARM_TENANT_ID=$(GTenantId) + export ARM_ENVIRONMENT=$(CloudEnv) + terraform init + terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true diff --git a/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml index d493e7fe6..226ca7c84 100644 --- a/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-bicep-azurecloud-pipelines.yml @@ -1,5 +1,5 @@ - # Copyright (c) Microsoft Corporation. - # Licensed under the MIT License. +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. trigger: - main @@ -10,7 +10,7 @@ pool: variables: ServiceConnectionName: $(CAzureConnection) - + jobs: - job: bicepCommercialCloud steps: @@ -25,4 +25,3 @@ jobs: --name $(bDeploymentName) \ --location $(Location) \ --template-file $(TemplateFile) - diff --git a/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml b/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml index 1d16396fe..85bc5223d 100644 --- a/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-bicep-azuregov-pipelines.yml @@ -1,5 +1,5 @@ - # Copyright (c) Microsoft Corporation. - # Licensed under the MIT License. +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. trigger: - main @@ -9,7 +9,6 @@ pool: vmImage: ubuntu-latest variables: - GServiceConnectionName: $(GAzureConnection) jobs: @@ -26,4 +25,3 @@ jobs: --name $(bDeploymentName) \ --location $(GLocation) \ --template-file $(TemplateFile) - diff --git a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml index ce875ffd3..120bd0b67 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azurecloud-pipelines.yml @@ -1,5 +1,5 @@ - # Copyright (c) Microsoft Corporation. - # Licensed under the MIT License. +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. trigger: branches: @@ -22,16 +22,16 @@ jobs: - task: AzureCLI@2 displayName: "Terraform Plan" inputs: - azureSubscription: $(CAzureConnection) - scriptType: 'bash' - scriptLocation: 'inlineScript' - addSpnToEnvironment: true - inlineScript: | - export ARM_CLIENT_ID=$(ClientId) - export ARM_CLIENT_SECRET=$(ClientSecret) - export ARM_SUBSCRIPTION_ID=$(subId) - export ARM_TENANT_ID=$(tenantId) - terraform init - terraform plan -var "hub_subid=$(subid)" -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true + azureSubscription: $(CAzureConnection) + scriptType: 'bash' + scriptLocation: 'inlineScript' + addSpnToEnvironment: true + inlineScript: | + export ARM_CLIENT_ID=$(ClientId) + export ARM_CLIENT_SECRET=$(ClientSecret) + export ARM_SUBSCRIPTION_ID=$(subId) + export ARM_TENANT_ID=$(tenantId) + terraform init + terraform plan -var "hub_subid=$(subid)" -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true diff --git a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml index 0aa7c1c3e..40d8a0ffd 100644 --- a/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml +++ b/.azure-devops/prbuild/mlz-pr-tf-azuregov-pipelines.yml @@ -1,5 +1,5 @@ - # Copyright (c) Microsoft Corporation. - # Licensed under the MIT License. +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. trigger: - main @@ -10,37 +10,27 @@ pool: variables: GServiceConnectionName: $(GAzureConnection) - + jobs: - - job: GovCloud_TF steps: - - task: TerraformInstaller@0 - inputs: - terraformVersion: '1.0.8' - - task: AzureCLI@2 - name: TerraformApplyGov - displayName: "Deploy MLZ Terraform" - inputs: - azureSubscription: $(GAzureConnection) - scriptType: 'bash' - addSpnToEnvironment: true - scriptLocation: 'inlineScript' - inlineScript: | - export ARM_CLIENT_ID=$(GClientId) ` - echo $ARM_CLIENT_ID ` - export ARM_CLIENT_SECRET=$(GClientSecret) ` - echo $ARM_CLIENT_SECRET ` - export ARM_SUBSCRIPTION_ID=$(GSubId) ` - echo $ARM_SUBSCRIPTION_ID ` - export ARM_TENANT_ID=$(GTenantId) ` - echo $ARM_TENANT_ID ` - export ARM_ENVIRONMENT=$(CloudEnv) ` - echo $ARM_ENVIRONMENT ` - terraform init - terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true - - - + - task: TerraformInstaller@0 + inputs: + terraformVersion: '1.0.8' + - task: AzureCLI@2 + displayName: "Deploy MLZ Terraform" + inputs: + azureSubscription: $(GAzureConnection) + scriptType: 'bash' + addSpnToEnvironment: true + scriptLocation: 'inlineScript' + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) + export ARM_CLIENT_SECRET=$(GClientSecret) + export ARM_SUBSCRIPTION_ID=$(GSubId) + export ARM_TENANT_ID=$(GTenantId) + export ARM_ENVIRONMENT=$(CloudEnv) + terraform init + terraform plan -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true From 9bdf9727e95239a076bad040a39ee81d7b8a5059 Mon Sep 17 00:00:00 2001 From: Glenn Musa <4622125+glennmusa@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:37:06 +0000 Subject: [PATCH 131/132] correct tab on task --- .../mlz-tf-azuregov-pipelines.yml | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml index 7d31ac6e0..8f251b719 100644 --- a/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-tf-azuregov-pipelines.yml @@ -40,20 +40,20 @@ jobs: terraform apply -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' useGlobalConfig: true - - task: AzureCLI@2 - displayName: "Destroy MLZ Terraform" - inputs: - azureSubscription: $(GAzureConnection) - scriptType: 'bash' - addSpnToEnvironment: true - scriptLocation: 'inlineScript' - inlineScript: | - export ARM_CLIENT_ID=$(GClientId) - export ARM_CLIENT_SECRET=$(GClientSecret) - export ARM_SUBSCRIPTION_ID=$(GSubId) - export ARM_TENANT_ID=$(GTenantId) - export ARM_ENVIRONMENT=$(CloudEnv) - terraform init - terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false - workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' - useGlobalConfig: true + - task: AzureCLI@2 + displayName: "Destroy MLZ Terraform" + inputs: + azureSubscription: $(GAzureConnection) + scriptType: 'bash' + addSpnToEnvironment: true + scriptLocation: 'inlineScript' + inlineScript: | + export ARM_CLIENT_ID=$(GClientId) + export ARM_CLIENT_SECRET=$(GClientSecret) + export ARM_SUBSCRIPTION_ID=$(GSubId) + export ARM_TENANT_ID=$(GTenantId) + export ARM_ENVIRONMENT=$(CloudEnv) + terraform init + terraform destroy -var "hub_subid=$(GSubid)" -var metadata_host=$(MetadataHost) -var environment=$(CloudEnv) -var location=$(GLocation) -auto-approve -input=false + workingDirectory: '$(System.DefaultWorkingDirectory)/src/terraform/mlz' + useGlobalConfig: true From 33a0e9b87a9a914a20d29eb2802df4ca392ff58a Mon Sep 17 00:00:00 2001 From: Glenn Musa <4622125+glennmusa@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:39:58 +0000 Subject: [PATCH 132/132] remove whitespaces in root readme --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 6b1a9876e..ff019d8d4 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,6 @@ trademarks or logos is subject to and must follow Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. - ## Nightly Build Status @@ -125,6 +124,3 @@ Any use of third-party trademarks or logos are subject to those third-party's po |Bicep| [![Build Status](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_apis/build/status/missionlz/mlz.bicep.azurecloud.nightly.build?branchName=mlz-azure-pipelines)](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_build/latest?definitionId=470&branchName=mlz-azure-pipelines)|[![Build Status](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_apis/build/status/missionlz/mlz.bicep.azuregov.nightly.build?branchName=mlz-azure-pipelines)](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_build/latest?definitionId=483&branchName=mlz-azure-pipelines)| |Terraform| [![Build Status](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_apis/build/status/missionlz/mlz.tf.azurecloud.nightly.build?branchName=mlz-azure-pipelines)](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_build/latest?definitionId=484&branchName=mlz-azure-pipelines) |[![Build Status](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_apis/build/status/missionlz/mlz.tf.azuregov.nightly.build?branchName=mlz-azure-pipelines)](https://dev.azure.com/AZGlobal/Azure%20Global%20CAT%20Engineering/_build/latest?definitionId=485&branchName=mlz-azure-pipelines)| - - -