From 7fb3dc9cbe2f9605f798584c42a71a4975c1e0de Mon Sep 17 00:00:00 2001 From: Glenn Musa <4622125+glennmusa@users.noreply.github.com> Date: Thu, 16 Dec 2021 13:42:53 +0000 Subject: [PATCH 1/3] build the deploymentVariables file in azurecloud nightly --- .../nightlybuild/mlz-bicep-azurecloud-pipelines.yml | 12 ++++++++++++ .devcontainer/devcontainer.json | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml index a6399d25b..5a4bdb804 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -69,6 +69,18 @@ jobs: firewallPrivateIP=$(echo $deploymentoutput | jq '.firewallPrivateIP') \ && echo "##vso[task.setvariable variable=firewallPrivateIPAddress;]$firewallPrivateIP" + - task: AzureCLI@2 + displayName: "Generate deploymentVariables.json" + inputs: + azureSubscription: $(ServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub show \ + --name $(bDeploymentName) \ + --query properties.outputs \ + > $(Build.SourcesDirectory)/src/bicep/examples/deploymentVariables.json + - task: AzureCLI@2 displayName: "T3 Bicep Deployment" inputs: diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a9689b9ea..6f5313771 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -24,7 +24,8 @@ "github.vscode-pull-request-github", "timonwong.shellcheck", "ms-azuretools.vscode-bicep", - "bierner.markdown-preview-github-styles" + "bierner.markdown-preview-github-styles", + "ms-azure-devops.azure-pipelines" ], // Additional args to pass to the 'docker run' command From 274abd04d31d976fbf23e8887dbaf0e760e67b4a Mon Sep 17 00:00:00 2001 From: Glenn Musa <4622125+glennmusa@users.noreply.github.com> Date: Thu, 16 Dec 2021 14:06:00 +0000 Subject: [PATCH 2/3] add the deploymentVariables.json generation to gov cloud pipeline --- .../mlz-bicep-azurecloud-pipelines.yml | 24 +++++++++---------- .../mlz-bicep-azuregov-pipelines.yml | 12 ++++++++++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml index 5a4bdb804..ec28bdbf5 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azurecloud-pipelines.yml @@ -32,6 +32,18 @@ jobs: --template-file $(TemplateFile) \ --parameters resourcePrefix=$datetime + - task: AzureCLI@2 + displayName: "Generate deploymentVariables.json for all addons and examples" + inputs: + azureSubscription: $(ServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub show \ + --name $(bDeploymentName) \ + --query properties.outputs \ + > $(Build.SourcesDirectory)/src/bicep/examples/deploymentVariables.json + - task: AzureCLI@2 displayName: "Extract Values and Hydrate Variables for T3 Deployment" inputs: @@ -69,18 +81,6 @@ jobs: firewallPrivateIP=$(echo $deploymentoutput | jq '.firewallPrivateIP') \ && echo "##vso[task.setvariable variable=firewallPrivateIPAddress;]$firewallPrivateIP" - - task: AzureCLI@2 - displayName: "Generate deploymentVariables.json" - inputs: - azureSubscription: $(ServiceConnectionName) - scriptType: 'bash' - scriptLocation: 'inlineScript' - inlineScript: | - az deployment sub show \ - --name $(bDeploymentName) \ - --query properties.outputs \ - > $(Build.SourcesDirectory)/src/bicep/examples/deploymentVariables.json - - task: AzureCLI@2 displayName: "T3 Bicep Deployment" inputs: diff --git a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml index f33d9ccfc..22fec6fc9 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -32,6 +32,18 @@ jobs: --template-file $(TemplateFile) \ --parameters resourcePrefix=$datetime + - task: AzureCLI@2 + displayName: "Generate deploymentVariables.json for all addons and examples" + inputs: + azureSubscription: $(ServiceConnectionName) + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az deployment sub show \ + --name $(bDeploymentName) \ + --query properties.outputs \ + > $(Build.SourcesDirectory)/src/bicep/examples/deploymentVariables.json + - task: AzureCLI@2 displayName: "Extract Values and Hydrate Variables for T3 Deployment" inputs: From dda88d6362e48c695df8ca405195a92d6db61e85 Mon Sep 17 00:00:00 2001 From: Glenn Musa <4622125+glennmusa@users.noreply.github.com> Date: Thu, 16 Dec 2021 14:45:14 +0000 Subject: [PATCH 3/3] use the right service connection --- .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 22fec6fc9..f658df6e2 100644 --- a/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml +++ b/.azure-devops/nightlybuild/mlz-bicep-azuregov-pipelines.yml @@ -35,7 +35,7 @@ jobs: - task: AzureCLI@2 displayName: "Generate deploymentVariables.json for all addons and examples" inputs: - azureSubscription: $(ServiceConnectionName) + azureSubscription: $(GServiceConnectionName) scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: |