From 022cdf8e7d9833736d561d503d38c028b909c124 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Tue, 6 Dec 2022 13:38:47 +0100 Subject: [PATCH 01/39] Added missing param handover --- .github/actions/templates/publishModule/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index 7632bdafde..4fc0312cb5 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -150,6 +150,7 @@ runs: $functionInput = @{ TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" + publishLatest = $(publishLatest) } Write-Verbose "Invoke task with" -Verbose From 49fa2e37198df405d228993ecfaa62cbad011879 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Tue, 6 Dec 2022 13:44:29 +0100 Subject: [PATCH 02/39] Init --- .../pipelineTemplates/jobs.publishModule.yml | 13 ++++++------ .../templates/publishModule/action.yml | 4 ++-- ...ng started - Scenario 1 Consume library.md | 20 +++++++++---------- ...board module library and CI environment.md | 2 +- docs/wiki/Solution creation.md | 2 +- .../Find-ModuleInPrivateBicepRegistry.ps1 | 1 + .../Find-ModuleInTemplateSpecsRG.ps1 | 1 + .../Find-ModuleInUniversalArtifactsFeed.ps1 | 1 + ...s1 => Publish-ModuleToTemplateSpecsRG.ps1} | 4 ++-- ...ublish-ModuleToUniversalArtifactsFeed.ps1} | 4 ++-- 10 files changed, 28 insertions(+), 24 deletions(-) create mode 100644 utilities/pipelines/resourcePublish/Find-ModuleInPrivateBicepRegistry.ps1 create mode 100644 utilities/pipelines/resourcePublish/Find-ModuleInTemplateSpecsRG.ps1 create mode 100644 utilities/pipelines/resourcePublish/Find-ModuleInUniversalArtifactsFeed.ps1 rename utilities/pipelines/resourcePublish/{Publish-ModuleToTemplateSpec.ps1 => Publish-ModuleToTemplateSpecsRG.ps1} (91%) rename utilities/pipelines/resourcePublish/{Publish-ModuleToUniversalArtifactFeed.ps1 => Publish-ModuleToUniversalArtifactsFeed.ps1} (94%) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index d60dbb4247..16c65b4989 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -129,7 +129,7 @@ jobs: script: | # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToPublish.ps1') - . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToUniversalArtifactFeed.ps1') + . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToUniversalArtifactsFeed.ps1') #Prioritizing the bicep file $TemplateFilePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' 'deploy.bicep' @@ -161,10 +161,10 @@ jobs: BearerToken = $env:TOKEN } - Write-Verbose "Invoke Publish-ModuleToUniversalArtifactFeed with" -Verbose + Write-Verbose "Invoke Publish-ModuleToUniversalArtifactsFeed with" -Verbose Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose - Publish-ModuleToUniversalArtifactFeed @functionInput -Verbose + Publish-ModuleToUniversalArtifactsFeed @functionInput -Verbose Write-Host "##[endgroup]" } env: @@ -188,7 +188,7 @@ jobs: inline: | # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToPublish.ps1') - . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToTemplateSpec.ps1') + . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToTemplateSpecsRG.ps1') #Prioritizing the bicep file $TemplateFilePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' 'deploy.bicep' @@ -219,10 +219,10 @@ jobs: ModuleVersion = $ModuleToPublish.Version } - Write-Verbose "Invoke Publish-ModuleToTemplateSpec with" -Verbose + Write-Verbose "Invoke Publish-ModuleToTemplateSpecsRG with" -Verbose Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose - Publish-ModuleToTemplateSpec @functionInput -Verbose + Publish-ModuleToTemplateSpecsRG @functionInput -Verbose Write-Host "##[endgroup]" } @@ -258,6 +258,7 @@ jobs: $functionInput = @{ TemplateFilePath = $TemplateFilePath + publishLatest = $(publishLatest) } Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index 4fc0312cb5..d6832bd53c 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -102,7 +102,7 @@ runs: # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesToPublish.ps1') - . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToTemplateSpec.ps1') + . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToTemplateSpecsRG.ps1') $functionInput = @{ TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" @@ -130,7 +130,7 @@ runs: Write-Verbose "Invoke task with" -Verbose Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose - Publish-ModuleToTemplateSpec @functionInput -Verbose + Publish-ModuleToTemplateSpecsRG @functionInput -Verbose } Write-Output '::endgroup::' diff --git a/docs/wiki/Getting started - Scenario 1 Consume library.md b/docs/wiki/Getting started - Scenario 1 Consume library.md index 229a667770..566f2962b0 100644 --- a/docs/wiki/Getting started - Scenario 1 Consume library.md +++ b/docs/wiki/Getting started - Scenario 1 Consume library.md @@ -67,15 +67,15 @@ If you are not using a local repository, you'll also need to publish the modules
Modules publishing in Template Spec -The preferred method to publish modules to template-specs is to leverage CARML ready [CI environment](./The%20CI%20environment), however there maybe specific requirements for which this option is not applicable. As an alternative, the same [Publish-ModuleToTemplateSpec.ps1](https://github.com/Azure/ResourceModules/blob/main/utilities/pipelines/resourcePublish/Publish-ModuleToPrivateBicepRegistry.ps1) script leveraged by the publishing step of the CI environment pipeline can be executed locally. +The preferred method to publish modules to template-specs is to leverage CARML ready [CI environment](./The%20CI%20environment), however there maybe specific requirements for which this option is not applicable. As an alternative, the same [Publish-ModuleToTemplateSpecsRG.ps1](https://github.com/Azure/ResourceModules/blob/main/utilities/pipelines/resourcePublish/Publish-ModuleToPrivateBicepRegistry.ps1) script leveraged by the publishing step of the CI environment pipeline can be executed locally. To publish a module by running the script: 1. Let's suppose your updated library location is `'D:\ResourcesModules'`, open a Powershell session on your machine 1. Navigate to `'D:\ResourcesModules\utilities\pipelines\resourcePublish'` location - 1. Load the script `'Publish-ModuleToTemplateSpec.ps1'` executing: + 1. Load the script `'Publish-ModuleToTemplateSpecsRG.ps1'` executing: ```PowerShell - . .\Publish-ModuleToTemplateSpec.ps1 + . .\Publish-ModuleToTemplateSpecsRG.ps1 ``` 1. Run the script for the modules you need to publish, using the opportune parameters: - TemplateFilePath = the absolute path of the module to be published @@ -87,9 +87,9 @@ To publish a module by running the script: To publish the Keyvault module with version 0.4.740 on a Template Spec that will be created in the resource group 'artifact-rg' you can execute the following example: ```PowerShell - Publish-ModuleToTemplateSpec -TemplateFilePath "D:\ResourcesModules\modules\Microsoft.KeyVault\vaults\deploy.bicep" -ModuleVersion "0.4.740" -TemplateSpecsRgName 'artifact-rg' -TemplateSpecsRgLocation 'West Europe' -TemplateSpecsDescription 'CARML KV Template Spec' + Publish-ModuleToTemplateSpecsRG -TemplateFilePath "D:\ResourcesModules\modules\Microsoft.KeyVault\vaults\deploy.bicep" -ModuleVersion "0.4.740" -TemplateSpecsRgName 'artifact-rg' -TemplateSpecsRgLocation 'West Europe' -TemplateSpecsDescription 'CARML KV Template Spec' ``` - As the modules to be published are more than one a script that calls the `'Publish-ModuleToTemplateSpec'` function for each of the modules can be created. + As the modules to be published are more than one a script that calls the `'Publish-ModuleToTemplateSpecsRG'` function for each of the modules can be created. 1. Update your master template in order to use the new version of the published modules. @@ -132,15 +132,15 @@ To publish a module by running the script:
Modules publishing to Azure DevOps artifact feed -The preferred method to publish modules to Azure DevOps artifact feed is to leverage CARML ready [CI environment](./The%20CI%20environment), however there maybe specific requirements for which this option is not applicable. As an alternative, the same [Publish-ModuleToUniversalArtifactFeed.ps1](https://github.com/Azure/ResourceModules/blob/main/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactFeed.ps1) script leveraged by the publishing step of the CI environment pipeline can be executed locally. +The preferred method to publish modules to Azure DevOps artifact feed is to leverage CARML ready [CI environment](./The%20CI%20environment), however there maybe specific requirements for which this option is not applicable. As an alternative, the same [Publish-ModuleToUniversalArtifactsFeed.ps1](https://github.com/Azure/ResourceModules/blob/main/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactsFeed.ps1) script leveraged by the publishing step of the CI environment pipeline can be executed locally. To publish a module by running the script: 1. Let's suppose your updated library location is `'D:\ResourcesModules'`, open a Powershell session on your machine 1. Navigate to `'D:\ResourcesModules\utilities\pipelines\resourcePublish'` location - 1. Load the script `'Publish-ModuleToUniversalArtifactFeed.ps1'` executing: + 1. Load the script `'Publish-ModuleToUniversalArtifactsFeed.ps1'` executing: ```PowerShell - . .\Publish-ModuleToUniversalArtifactFeed.ps1 + . .\Publish-ModuleToUniversalArtifactsFeed.ps1 ``` 1. Run the script for the modules you need to publish, using the opportune parameters: - TemplateFilePath = the absolute path of the module to be published. @@ -152,9 +152,9 @@ To publish a module by running the script: To publish the Keyvault module with version 0.4.740 on an artifact feed called 'Artifacts', in the project 'IaC' on organization 'fabrikam' you can execute the following command: ```PowerShell - Publish-ModuleToUniversalArtifactFeed -TemplateFilePath "D:\ResourcesModules\modules\Microsoft.KeyVault\vaults\deploy.bicep" -ModuleVersion "0.4.740" -VstsOrganizationUri 'https://dev.azure.com/fabrikam' -VstsFeedProject 'IaC' -VstsFeedName 'Artifacts' + Publish-ModuleToUniversalArtifactsFeed -TemplateFilePath "D:\ResourcesModules\modules\Microsoft.KeyVault\vaults\deploy.bicep" -ModuleVersion "0.4.740" -VstsOrganizationUri 'https://dev.azure.com/fabrikam' -VstsFeedProject 'IaC' -VstsFeedName 'Artifacts' ``` - As the modules to be published are more than one a script that calls the `'Publish-ModuleToUniversalArtifactFeed'` function for each of the modules can be created. + As the modules to be published are more than one a script that calls the `'Publish-ModuleToUniversalArtifactsFeed'` function for each of the modules can be created. 1. Update your master template in order to use the new version of the published modules. diff --git a/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md b/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md index 1d2637456b..55cc4bc34f 100644 --- a/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md +++ b/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md @@ -361,7 +361,7 @@ This section will explain what is required to publish the modules to [Azure Arti #### Implementation Guidance -Each `./azuredevops/modulePipelines` YAML pipeline already calls [`/.azuredevops/pipelineTemplates/jobs.publishModule.yml`](https://github.com/Azure/ResourceModules/blob/main/.azuredevops/pipelineTemplates/jobs.publishModule.yml). This YAML template contains a method to `Publish module to artifacts feed` via [`utilities\pipelines\resourcePublish\Publish-ModuleToUniversalArtifactFeed.ps1`](https://github.com/Azure/ResourceModules/blob/main/utilities\pipelines\resourcePublish\Publish-ModuleToUniversalArtifactFeed.ps1). +Each `./azuredevops/modulePipelines` YAML pipeline already calls [`/.azuredevops/pipelineTemplates/jobs.publishModule.yml`](https://github.com/Azure/ResourceModules/blob/main/.azuredevops/pipelineTemplates/jobs.publishModule.yml). This YAML template contains a method to `Publish module to artifacts feed` via [`utilities\pipelines\resourcePublish\Publish-ModuleToUniversalArtifactsFeed.ps1`](https://github.com/Azure/ResourceModules/blob/main/utilities\pipelines\resourcePublish\Publish-ModuleToUniversalArtifactsFeed.ps1).
diff --git a/docs/wiki/Solution creation.md b/docs/wiki/Solution creation.md index 091490f18c..928b4ae77c 100644 --- a/docs/wiki/Solution creation.md +++ b/docs/wiki/Solution creation.md @@ -289,7 +289,7 @@ The example assumes you are using a [`bicepconfig.json`](https://docs.microsoft. The following example shows how you could orchestrate a deployment of multiple resources using template specs. In this example, we will deploy a resource group with a Network Security Group (NSG), and use them in a subsequent VNET deployment. -> **Note**: the preferred method to publish modules to template-specs is to leverage the [CI environment](./The%20CI%20environment) provided in this repository. However, this option may not be applicable to all scenarios (ref e.g., the [Consume library](./Getting%20started%20-%20Scenario%201%20Consume%20library) section). As an alternative, the same [Publish-ModuleToTemplateSpec.ps1](https://github.com/Azure/ResourceModules/blob/main/utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpec.ps1) script leveraged by the publishing step of the CI environment pipeline can also be run locally. +> **Note**: the preferred method to publish modules to template-specs is to leverage the [CI environment](./The%20CI%20environment) provided in this repository. However, this option may not be applicable to all scenarios (ref e.g., the [Consume library](./Getting%20started%20-%20Scenario%201%20Consume%20library) section). As an alternative, the same [Publish-ModuleToTemplateSpecsRG.ps1](https://github.com/Azure/ResourceModules/blob/main/utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpecsRG.ps1) script leveraged by the publishing step of the CI environment pipeline can also be run locally. ```bicep targetScope = 'subscription' diff --git a/utilities/pipelines/resourcePublish/Find-ModuleInPrivateBicepRegistry.ps1 b/utilities/pipelines/resourcePublish/Find-ModuleInPrivateBicepRegistry.ps1 new file mode 100644 index 0000000000..5f282702bb --- /dev/null +++ b/utilities/pipelines/resourcePublish/Find-ModuleInPrivateBicepRegistry.ps1 @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/utilities/pipelines/resourcePublish/Find-ModuleInTemplateSpecsRG.ps1 b/utilities/pipelines/resourcePublish/Find-ModuleInTemplateSpecsRG.ps1 new file mode 100644 index 0000000000..5f282702bb --- /dev/null +++ b/utilities/pipelines/resourcePublish/Find-ModuleInTemplateSpecsRG.ps1 @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/utilities/pipelines/resourcePublish/Find-ModuleInUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Find-ModuleInUniversalArtifactsFeed.ps1 new file mode 100644 index 0000000000..5f282702bb --- /dev/null +++ b/utilities/pipelines/resourcePublish/Find-ModuleInUniversalArtifactsFeed.ps1 @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpec.ps1 b/utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpecsRG.ps1 similarity index 91% rename from utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpec.ps1 rename to utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpecsRG.ps1 index df821bd8d8..77f1185066 100644 --- a/utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpec.ps1 +++ b/utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpecsRG.ps1 @@ -27,11 +27,11 @@ Mandatory. The description of the parent template spec. Example: 'iacs key vault' .EXAMPLE -Publish-ModuleToTemplateSpec -TemplateFilePath 'C:\modules\Microsoft.KeyVault\vaults\deploy.bicep' -ModuleVersion '3.0.0-alpha' -TemplateSpecsRgName 'artifacts-rg' -TemplateSpecsRgLocation 'West Europe' -TemplateSpecsDescription 'iacs key vault' +Publish-ModuleToTemplateSpecsRG -TemplateFilePath 'C:\modules\Microsoft.KeyVault\vaults\deploy.bicep' -ModuleVersion '3.0.0-alpha' -TemplateSpecsRgName 'artifacts-rg' -TemplateSpecsRgLocation 'West Europe' -TemplateSpecsDescription 'iacs key vault' Try to publish the KeyVault module with version 3.0.0-alpha to a template spec in resource group 'artifacts-rg'. #> -function Publish-ModuleToTemplateSpec { +function Publish-ModuleToTemplateSpecsRG { [CmdletBinding(SupportsShouldProcess)] param ( diff --git a/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactFeed.ps1 b/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactsFeed.ps1 similarity index 94% rename from utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactFeed.ps1 rename to utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactsFeed.ps1 index 0dd3549f87..6415ca4eba 100644 --- a/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactsFeed.ps1 @@ -60,11 +60,11 @@ Example: 'Artifacts'. Optional. The bearer token to use to authenticate the request. If not provided it MUST be existing in your environment as `$env:TOKEN` .EXAMPLE -Publish-ModuleToUniversalArtifactFeed -TemplateFilePath 'C:\modules\Microsoft.KeyVault\vaults\deploy.bicep' -ModuleVersion '3.0.0-alpha' -vstsOrganizationUri 'https://dev.azure.com/fabrikam' -VstsProject 'IaC' -VstsFeedName 'Artifacts' +Publish-ModuleToUniversalArtifactsFeed -TemplateFilePath 'C:\modules\Microsoft.KeyVault\vaults\deploy.bicep' -ModuleVersion '3.0.0-alpha' -vstsOrganizationUri 'https://dev.azure.com/fabrikam' -VstsProject 'IaC' -VstsFeedName 'Artifacts' Try to publish the KeyVault module with version 3.0.0-alpha to a Universal Package Feed called 'Artifacts' under the project 'IaC'. #> -function Publish-ModuleToUniversalArtifactFeed { +function Publish-ModuleToUniversalArtifactsFeed { [CmdletBinding(SupportsShouldProcess)] param ( From 659c3f05fba80808aad270a3d9155080b28a06cd Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Tue, 6 Dec 2022 13:56:24 +0100 Subject: [PATCH 03/39] Further updates --- .../pipelineTemplates/jobs.publishModule.yml | 60 +++++++++++++------ .../templates/publishModule/action.yml | 40 +++++++++---- .../Find-ModuleInPrivateBicepRegistry.ps1 | 1 - .../Find-ModuleInTemplateSpecsRG.ps1 | 1 - .../Find-ModuleInUniversalArtifactsFeed.ps1 | 1 - ...ModulesMissingFromPrivateBicepRegistry.ps1 | 9 +++ .../Get-ModulesMissingFromTemplateSpecsRG.ps1 | 9 +++ ...dulesMissingFromUniversalArtifactsFeed.ps1 | 9 +++ .../resourcePublish/Get-ModulesToPublish.ps1 | 26 ++++---- 9 files changed, 110 insertions(+), 46 deletions(-) delete mode 100644 utilities/pipelines/resourcePublish/Find-ModuleInPrivateBicepRegistry.ps1 delete mode 100644 utilities/pipelines/resourcePublish/Find-ModuleInTemplateSpecsRG.ps1 delete mode 100644 utilities/pipelines/resourcePublish/Find-ModuleInUniversalArtifactsFeed.ps1 create mode 100644 utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 create mode 100644 utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 create mode 100644 utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 16c65b4989..501101fad8 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -130,6 +130,7 @@ jobs: # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToPublish.ps1') . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToUniversalArtifactsFeed.ps1') + . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesMissingFromUniversalArtifactsFeed.ps1') #Prioritizing the bicep file $TemplateFilePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' 'deploy.bicep' @@ -145,19 +146,26 @@ jobs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose # Get the modified child resources - $ModulesToPublish = Get-ModulesToPublish @functionInput -Verbose + $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + + # Add all modules that don't exist in the target location + foreach($missingModule in (Get-ModulesMissingFromUniversalArtifactsFeed -TemplateFilePath $TemplateFilePath)) { + if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { + $modulesToPublish += $missingModule + } + } # Publish the modified child resources - foreach ($ModuleToPublish in $ModulesToPublish) { - $RelPath = (($ModuleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] - Write-Host "##[group]$(' - [{0}] [{1}]' -f $RelPath, $ModuleToPublish.Version)" + foreach ($moduleToPublish in $modulesToPublish) { + $RelPath = (($moduleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] + Write-Host "##[group]$(' - [{0}] [{1}]' -f $RelPath, $moduleToPublish.Version)" $functionInput = @{ - TemplateFilePath = $ModuleToPublish.TemplateFilePath + TemplateFilePath = $moduleToPublish.TemplateFilePath VstsOrganizationUri = '${{ parameters.vstsOrganizationUri }}' VstsFeedProject = '${{ parameters.vstsFeedProject }}' VstsFeedName = '${{ parameters.vstsFeedName }}' - ModuleVersion = $ModuleToPublish.Version + ModuleVersion = $moduleToPublish.Version BearerToken = $env:TOKEN } @@ -188,6 +196,7 @@ jobs: inline: | # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToPublish.ps1') + . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesMissingFromTemplateSpecsRG.ps1') . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToTemplateSpecsRG.ps1') #Prioritizing the bicep file @@ -204,19 +213,26 @@ jobs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose # Get the modified child resources - $ModulesToPublish = Get-ModulesToPublish @functionInput -Verbose + $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + + # Add all modules that don't exist in the target location + foreach($missingModule in (Get-ModulesMissingFromTemplateSpecsRG -TemplateFilePath $TemplateFilePath)) { + if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { + $modulesToPublish += $missingModule + } + } # Publish the modified child resources - foreach ($ModuleToPublish in $ModulesToPublish) { - $RelPath = (($ModuleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] - Write-Host "##[group]$(' - [{0}] [{1}]' -f $RelPath, $ModuleToPublish.Version)" + foreach ($moduleToPublish in $modulesToPublish) { + $RelPath = (($moduleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] + Write-Host "##[group]$(' - [{0}] [{1}]' -f $RelPath, $moduleToPublish.Version)" $functionInput = @{ - TemplateFilePath = $ModuleToPublish.TemplateFilePath + TemplateFilePath = $moduleToPublish.TemplateFilePath TemplateSpecsRgName = '${{ parameters.templateSpecsRgName }}' TemplateSpecsRgLocation = '${{ parameters.templateSpecsRgLocation }}' TemplateSpecsDescription = '${{ parameters.templateSpecsDescription }}' - ModuleVersion = $ModuleToPublish.Version + ModuleVersion = $moduleToPublish.Version } Write-Verbose "Invoke Publish-ModuleToTemplateSpecsRG with" -Verbose @@ -248,6 +264,7 @@ jobs: # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToPublish.ps1') + . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesMissingFromPrivateBicepRegistry.ps1') . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1') #Prioritizing the bicep file @@ -265,19 +282,26 @@ jobs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose # Get the modified child resources - $ModulesToPublish = Get-ModulesToPublish @functionInput -Verbose + $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + + # Add all modules that don't exist in the target location + foreach($missingModule in (Get-ModulesMissingFromPrivateBicepRegistry -TemplateFilePath $TemplateFilePath)) { + if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { + $modulesToPublish += $missingModule + } + } # Publish the modified child resources - foreach ($ModuleToPublish in $ModulesToPublish) { - $RelPath = (($ModuleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] - Write-Host "##[group]$(' - [{0}] [{1}]' -f $RelPath, $ModuleToPublish.Version)" + foreach ($moduleToPublish in $modulesToPublish) { + $RelPath = (($moduleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] + Write-Host "##[group]$(' - [{0}] [{1}]' -f $RelPath, $moduleToPublish.Version)" $functionInput = @{ - TemplateFilePath = $ModuleToPublish.TemplateFilePath + TemplateFilePath = $moduleToPublish.TemplateFilePath BicepRegistryName = '${{ parameters.bicepRegistryName }}' BicepRegistryRgName = '${{ parameters.bicepRegistryRgName }}' BicepRegistryRgLocation = '${{ parameters.bicepRegistryRgLocation }}' - ModuleVersion = $ModuleToPublish.Version + ModuleVersion = $moduleToPublish.Version } Write-Verbose "Invoke Publish-ModuleToPrivateBicepRegistry with" -Verbose diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index d6832bd53c..4492560b50 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -102,6 +102,7 @@ runs: # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesToPublish.ps1') + . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesMissingFromTemplateSpecsRG.ps1') . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToTemplateSpecsRG.ps1') $functionInput = @{ @@ -112,19 +113,26 @@ runs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose # Get the modified child resources - $ModulesToPublish = Get-ModulesToPublish @functionInput -Verbose + $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + + # Add all modules that don't exist in the target location + foreach($missingModule in (Get-ModulesMissingFromTemplateSpecsRG -TemplateFilePath $TemplateFilePath)) { + if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { + $modulesToPublish += $missingModule + } + } # Publish the modified child resources - foreach ($ModuleToPublish in $ModulesToPublish) { - $RelPath = (($ModuleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] - Write-Output "::group::$(' - [{0}] [{1}]' -f $RelPath, $ModuleToPublish.Version)" + foreach ($moduleToPublish in $modulesToPublish) { + $RelPath = (($moduleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] + Write-Output "::group::$(' - [{0}] [{1}]' -f $RelPath, $moduleToPublish.Version)" $functionInput = @{ - TemplateFilePath = $ModuleToPublish.TemplateFilePath + TemplateFilePath = $moduleToPublish.TemplateFilePath TemplateSpecsRgName = '${{ inputs.templateSpecsRgName }}' TemplateSpecsRgLocation = '${{ inputs.templateSpecsRgLocation }}' TemplateSpecsDescription = '${{ inputs.templateSpecsDescription }}' - ModuleVersion = $ModuleToPublish.Version + ModuleVersion = $moduleToPublish.Version } Write-Verbose "Invoke task with" -Verbose @@ -146,6 +154,7 @@ runs: # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesToPublish.ps1') + . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesMissingFromPrivateBicepRegistry.ps1') . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1') $functionInput = @{ @@ -157,19 +166,26 @@ runs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose # Get the modified child resources - $ModulesToPublish = Get-ModulesToPublish @functionInput -Verbose + $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + + # Add all modules that don't exist in the target location + foreach($missingModule in (Get-ModulesMissingFromPrivateBicepRegistry -TemplateFilePath $TemplateFilePath)) { + if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { + $modulesToPublish += $missingModule + } + } # Publish the modified child resources - foreach ($ModuleToPublish in $ModulesToPublish) { - $RelPath = (($ModuleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] - Write-Output "::group::$(' - [{0}] [{1}]' -f $RelPath, $ModuleToPublish.Version)" + foreach ($moduleToPublish in $modulesToPublish) { + $RelPath = (($moduleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] + Write-Output "::group::$(' - [{0}] [{1}]' -f $RelPath, $moduleToPublish.Version)" $functionInput = @{ - TemplateFilePath = $ModuleToPublish.TemplateFilePath + TemplateFilePath = $moduleToPublish.TemplateFilePath BicepRegistryName = '${{ inputs.bicepRegistryName }}' BicepRegistryRgName = '${{ inputs.bicepRegistryRgName }}' BicepRegistryRgLocation = '${{ inputs.bicepRegistryRgLocation }}' - ModuleVersion = $ModuleToPublish.Version + ModuleVersion = $moduleToPublish.Version } Write-Verbose "Invoke task with" -Verbose diff --git a/utilities/pipelines/resourcePublish/Find-ModuleInPrivateBicepRegistry.ps1 b/utilities/pipelines/resourcePublish/Find-ModuleInPrivateBicepRegistry.ps1 deleted file mode 100644 index 5f282702bb..0000000000 --- a/utilities/pipelines/resourcePublish/Find-ModuleInPrivateBicepRegistry.ps1 +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/utilities/pipelines/resourcePublish/Find-ModuleInTemplateSpecsRG.ps1 b/utilities/pipelines/resourcePublish/Find-ModuleInTemplateSpecsRG.ps1 deleted file mode 100644 index 5f282702bb..0000000000 --- a/utilities/pipelines/resourcePublish/Find-ModuleInTemplateSpecsRG.ps1 +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/utilities/pipelines/resourcePublish/Find-ModuleInUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Find-ModuleInUniversalArtifactsFeed.ps1 deleted file mode 100644 index 5f282702bb..0000000000 --- a/utilities/pipelines/resourcePublish/Find-ModuleInUniversalArtifactsFeed.ps1 +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 new file mode 100644 index 0000000000..828fab558f --- /dev/null +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 @@ -0,0 +1,9 @@ +function Get-ModulesMissingFromPrivateBicepRegistry { + + [CmdletBinding()] + param ( + [Parameter(Mandatory)] + [string] $TemplateFilePath + ) + +} diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 new file mode 100644 index 0000000000..d91e088223 --- /dev/null +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 @@ -0,0 +1,9 @@ +function Get-ModulesMissingFromTemplateSpecsRG { + + [CmdletBinding()] + param ( + [Parameter(Mandatory)] + [string] $TemplateFilePath + ) + +} diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 new file mode 100644 index 0000000000..5bfc66df6b --- /dev/null +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 @@ -0,0 +1,9 @@ +function Get-ModulesMissingFromUniversalArtifactsFeed { + + [CmdletBinding()] + param ( + [Parameter(Mandatory)] + [string] $TemplateFilePath + ) + +} diff --git a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 index 2d53d61ba9..1f6bdd01d8 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 @@ -380,11 +380,11 @@ function Get-ModulesToPublish { $ModuleFolderPath = Split-Path $TemplateFilePath -Parent $TemplateFilesToPublish = Get-TemplateFileToPublish -ModuleFolderPath $ModuleFolderPath | Sort-Object FullName -Descending - $ModulesToPublish = [System.Collections.ArrayList]@() + $modulesToPublish = [System.Collections.ArrayList]@() foreach ($TemplateFileToPublish in $TemplateFilesToPublish) { $ModuleVersion = Get-NewModuleVersion -TemplateFilePath $TemplateFileToPublish.FullName -Verbose - $ModulesToPublish += @{ + $modulesToPublish += @{ Version = $ModuleVersion TemplateFilePath = $TemplateFileToPublish.FullName } @@ -392,20 +392,20 @@ function Get-ModulesToPublish { if ($ModuleVersion -notmatch 'prerelease') { # Latest Major,Minor - $ModulesToPublish += @{ + $modulesToPublish += @{ Version = ($ModuleVersion.Split('.')[0..1] -join '.') TemplateFilePath = $TemplateFileToPublish.FullName } # Latest Major - $ModulesToPublish += @{ + $modulesToPublish += @{ Version = ($ModuleVersion.Split('.')[0]) TemplateFilePath = $TemplateFileToPublish.FullName } if ($PublishLatest) { # Absolute latest - $ModulesToPublish += @{ + $modulesToPublish += @{ Version = 'latest' TemplateFilePath = $TemplateFileToPublish.FullName } @@ -416,7 +416,7 @@ function Get-ModulesToPublish { foreach ($ParentTemplateFileToPublish in $ParentTemplateFilesToPublish) { $ParentModuleVersion = Get-NewModuleVersion -TemplateFilePath $ParentTemplateFileToPublish.FullName - $ModulesToPublish += @{ + $modulesToPublish += @{ Version = $ParentModuleVersion TemplateFilePath = $ParentTemplateFileToPublish.FullName } @@ -424,20 +424,20 @@ function Get-ModulesToPublish { if ($ModuleVersion -notmatch 'prerelease') { # Latest Major,Minor - $ModulesToPublish += @{ + $modulesToPublish += @{ Version = ($ParentModuleVersion.Split('.')[0..1] -join '.') TemplateFilePath = $ParentTemplateFileToPublish.FullName } # Latest Major - $ModulesToPublish += @{ + $modulesToPublish += @{ Version = ($ParentModuleVersion.Split('.')[0]) TemplateFilePath = $ParentTemplateFileToPublish.FullName } if ($PublishLatest) { # Absolute latest - $ModulesToPublish += @{ + $modulesToPublish += @{ Version = 'latest' TemplateFilePath = $ParentTemplateFileToPublish.FullName } @@ -446,11 +446,11 @@ function Get-ModulesToPublish { } } - $ModulesToPublish = $ModulesToPublish | Sort-Object TemplateFilePath, Version -Descending -Unique + $modulesToPublish = $modulesToPublish | Sort-Object TemplateFilePath, Version -Descending -Unique - if ($ModulesToPublish.count -gt 0) { + if ($modulesToPublish.count -gt 0) { Write-Verbose 'Publish the following modules:'-Verbose - $ModulesToPublish | ForEach-Object { + $modulesToPublish | ForEach-Object { $RelPath = ($_.TemplateFilePath).Split('/modules/')[-1] $RelPath = $RelPath.Split('/deploy.')[0] Write-Verbose (' - [{0}] [{1}] ' -f $RelPath, $_.Version) -Verbose @@ -459,5 +459,5 @@ function Get-ModulesToPublish { Write-Verbose 'No modules to publish.'-Verbose } - return $ModulesToPublish + return $modulesToPublish } From 1fbfb1b22c01bcb5ccbfadb118cf26b4bc8abf61 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Tue, 6 Dec 2022 16:33:55 +0100 Subject: [PATCH 04/39] Added template specs support --- .../pipelineTemplates/jobs.publishModule.yml | 15 +++- ...ModulesMissingFromPrivateBicepRegistry.ps1 | 85 ++++++++++++++++++- .../Get-ModulesMissingFromTemplateSpecsRG.ps1 | 84 +++++++++++++++++- .../Get-PrivateRegistryRepositoryName.ps1 | 28 ++++++ .../resourcePublish/Get-TemplateSpecsName.ps1 | 29 +++++++ .../Publish-ModuleToPrivateBicepRegistry.ps1 | 8 +- .../Publish-ModuleToTemplateSpecsRG.ps1 | 9 +- 7 files changed, 244 insertions(+), 14 deletions(-) create mode 100644 utilities/pipelines/resourcePublish/Get-PrivateRegistryRepositoryName.ps1 create mode 100644 utilities/pipelines/resourcePublish/Get-TemplateSpecsName.ps1 diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 501101fad8..94c133b288 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -216,7 +216,12 @@ jobs: $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose # Add all modules that don't exist in the target location - foreach($missingModule in (Get-ModulesMissingFromTemplateSpecsRG -TemplateFilePath $TemplateFilePath)) { + $missingInputObject = @{ + TemplateFilePath = $TemplateFilePath + TemplateSpecsRGName = '${{ parameters.templateSpecsRgName }}' + } + $missingModules = Get-ModulesMissingFromTemplateSpecsRG @missingInputObject + foreach($missingModule in $missingModules) { if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { $modulesToPublish += $missingModule } @@ -285,7 +290,13 @@ jobs: $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose # Add all modules that don't exist in the target location - foreach($missingModule in (Get-ModulesMissingFromPrivateBicepRegistry -TemplateFilePath $TemplateFilePath)) { + $missingInputObject = @{ + TemplateFilePath = $TemplateFilePath + BicepRegistryName = '${{ parameters.bicepRegistryName }}' + BicepRegistryRgName = '${{ parameters.bicepRegistryRgName }}' + } + $missingModules = Get-ModulesMissingFromPrivateBicepRegistry @missingInputObject + foreach($missingModule in $missingModules) { if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { $modulesToPublish += $missingModule } diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 index 828fab558f..8e91e243de 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 @@ -1,9 +1,88 @@ -function Get-ModulesMissingFromPrivateBicepRegistry { +<# +.SYNOPSIS +Get a list of all modules (path & version) in the given TemplatePath that do not exist as a repository in the given Container Registry + +.DESCRIPTION +Get a list of all modules (path & version) in the given TemplatePath that do not exist as a repository in the given Container Registry + +.PARAMETER TemplateFilePath +Mandatory. The Template File Path to process + +.PARAMETER BicepRegistryName +Mandatory. The name of the Container Registry to search in + +.PARAMETER BicepRegistryRgName +Mandatory. The name of Resource Group the Container Registry is located it. + +.EXAMPLE +Get-ModulesMissingFromPrivateBicepRegistry -TemplateFilePath 'C:\ResourceModules\modules\Microsoft.Compute\virtualMachines\deploy.bicep' -BicepRegistryName 'adpsxxazacrx001' -BicepRegistryRgName 'artifacts-rg' + +Check if either the Virtual Machine module or any of its children (e.g. 'extension') is missing in the Container Registry 'adpsxxazacrx001' of Resource Group 'artifacts-rg' + +Returns for example: +Name Value +---- ----- +Version 0.4.0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.Compute\virtualMachines\extensions\deploy.bicep +Version 0.6.0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.Compute\virtualMachines\deploy.bicep +#> +function Get-ModulesMissingFromPrivateBicepRegistry { [CmdletBinding()] param ( - [Parameter(Mandatory)] - [string] $TemplateFilePath + [Parameter(Mandatory = $true)] + [string] $TemplateFilePath, + + [Parameter(Mandatory = $true)] + [string] $BicepRegistryName, + + [Parameter(Mandatory = $true)] + [string] $BicepRegistryRgName ) + begin { + Write-Debug ('{0} entered' -f $MyInvocation.MyCommand) + + # Load used functions + . (Join-Path $PSScriptRoot 'Get-PrivateRegistryRepositoryName.ps1') + } + + process { + # Get all children + $availableModuleTemplatePaths = (Get-ChildItem -Path (Split-Path $TemplateFilePath) -Recurse -Include @('deploy.bicep', 'deploy.json')).FullName + + if (-not (Get-AzContainerRegistry -Name $BicepRegistryName -ResourceGroupName $BicepRegistryRgName)) { + $missingTemplatePaths = $availableModuleTemplatePaths + } else { + # Test all children against ACR + $missingTemplatePaths = @() + foreach ($templatePath in $availableModuleTemplatePaths) { + + # Get a valid Container Registry name + $moduleRegistryIdentifier = Get-PrivateRegistryRepositoryName -TemplateFilePath $templatePath + + $null = Get-AzContainerRegistryTag -RepositoryName $moduleRegistryIdentifier -RegistryName $BicepRegistryName -ErrorAction 'SilentlyContinue' -ErrorVariable 'result' + + if ($result.exception.Response.StatusCode -eq 'NotFound') { + $missingTemplatePaths += $templatePath + } + } + } + + # Collect any that are not part of the ACR, fetch their version and return the result array + $modulesToPublish = @() + foreach ($missingTemplatePath in $missingTemplatePaths) { + $modulesToPublish += @{ + TemplateFilePath = $missingTemplatePath + Version = '{0}.0' -f (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version + } + } + + return $modulesToPublish + } + + end { + Write-Debug ('{0} exited' -f $MyInvocation.MyCommand) + } } diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 index d91e088223..c7f9d041e8 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 @@ -1,9 +1,87 @@ -function Get-ModulesMissingFromTemplateSpecsRG { +<# +.SYNOPSIS +Get a list of all modules (path & version) in the given TemplatePath that do not exist as a Template Spec in the given Resource Group + +.DESCRIPTION +Get a list of all modules (path & version) in the given TemplatePath that do not exist as a Template Spec in the given Resource Group + +.PARAMETER TemplateFilePath +Mandatory. The Template File Path to process + +.PARAMETER TemplateSpecsRGName +Mandatory. The Resource Group to search in + +.EXAMPLE +Get-ModulesMissingFromTemplateSpecsRG -TemplateFilePath 'C:\ResourceModules\modules\Microsoft.KeyVault\vaults\deploy.bicep' -TemplateSpecsRGName 'artifacts-rg' + +Check if either the Key Vault module or any of its children (e.g. 'secret') is missing in the Resource Group 'artifacts-rg' + +Returns for example: +Name Value +---- ----- +Version 0.4.0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\accessPolicies\deploy.bicep +Version 0.4.0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\keys\deploy.bicep +Version 0.4.0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\secrets\deploy.bicep +Version 0.5.0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\deploy.bicep +#> +function Get-ModulesMissingFromTemplateSpecsRG { [CmdletBinding()] param ( - [Parameter(Mandatory)] - [string] $TemplateFilePath + [Parameter(Mandatory = $true)] + [string] $TemplateFilePath, + + [Parameter(Mandatory = $true)] + [string] $TemplateSpecsRGName ) + begin { + Write-Debug ('{0} entered' -f $MyInvocation.MyCommand) + + # Load used functions + . (Join-Path $PSScriptRoot 'Get-TemplateSpecsName.ps1') + } + + process { + # Get all children + $availableModuleTemplatePaths = (Get-ChildItem -Path (Split-Path $TemplateFilePath) -Recurse -Include @('deploy.bicep', 'deploy.json')).FullName + + if (-not (Get-AzResourceGroup -ResourceGroupName 'artifacts-rg')) { + $missingTemplatePaths = $availableModuleTemplatePaths + } else { + # Test all children against ACR + $missingTemplatePaths = @() + foreach ($templatePath in $availableModuleTemplatePaths) { + + # Get a valid Container Registry name + $templateSpecsIdentifier = Get-TemplateSpecsName -TemplateFilePath $templatePath + + $null = Get-AzTemplateSpec -ResourceGroupName $TemplateSpecsRGName -Name $templateSpecsIdentifier -ErrorAction 'SilentlyContinue' -ErrorVariable 'result' + + if ($result.exception.Response.StatusCode -eq 'NotFound') { + $missingTemplatePaths += $templatePath + } + } + } + + # Collect any that are not part of the ACR, fetch their version and return the result array + $modulesToPublish = @() + foreach ($missingTemplatePath in $missingTemplatePaths) { + $modulesToPublish += @{ + TemplateFilePath = $missingTemplatePath + Version = '{0}.0' -f (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version + } + } + + return $modulesToPublish + } + + end { + Write-Debug ('{0} exited' -f $MyInvocation.MyCommand) + } } + diff --git a/utilities/pipelines/resourcePublish/Get-PrivateRegistryRepositoryName.ps1 b/utilities/pipelines/resourcePublish/Get-PrivateRegistryRepositoryName.ps1 new file mode 100644 index 0000000000..876663c119 --- /dev/null +++ b/utilities/pipelines/resourcePublish/Get-PrivateRegistryRepositoryName.ps1 @@ -0,0 +1,28 @@ +<# +.SYNOPSIS +Convert the given template file path into a valid Container Registry repository name + +.DESCRIPTION +Convert the given template file path into a valid Container Registry repository name + +.PARAMETER TemplateFilePath +Mandatory. The template file path to convert + +.EXAMPLE +Get-PrivateRegistryRepositoryName -TemplateFilePath 'C:\modules\Microsoft.KeyVault\vaults\deploy.bicep' + +Convert 'C:\modules\Microsoft.KeyVault\vaults\deploy.bicep' to e.g. 'bicep/modules/microsoft.keyvault.vaults' +#> +function Get-PrivateRegistryRepositoryName { + + [CmdletBinding()] + param ( + [Parameter(Mandatory)] + [string] $TemplateFilePath + ) + + $moduleIdentifier = (Split-Path $TemplateFilePath -Parent).Replace('\', '/').Split('/modules/')[1] + $moduleRegistryIdentifier = 'bicep/modules/{0}' -f $moduleIdentifier.Replace('\', '/').Replace('/', '.').ToLower() + + return $moduleRegistryIdentifier +} diff --git a/utilities/pipelines/resourcePublish/Get-TemplateSpecsName.ps1 b/utilities/pipelines/resourcePublish/Get-TemplateSpecsName.ps1 new file mode 100644 index 0000000000..5048d5dc75 --- /dev/null +++ b/utilities/pipelines/resourcePublish/Get-TemplateSpecsName.ps1 @@ -0,0 +1,29 @@ +<# +.SYNOPSIS +Convert the given template file path into a valid Template Specs name + +.DESCRIPTION +Convert the given template file path into a valid Template Specs repository name + +.PARAMETER TemplateFilePath +Mandatory. The template file path to convert + +.EXAMPLE +Get-TemplateSpecsName -TemplateFilePath 'C:\modules\Microsoft.KeyVault\vaults\deploy.bicep' + +Convert 'C:\modules\Microsoft.KeyVault\vaults\deploy.bicep' to e.g. 'microsoft.keyvault.vaults' +#> +function Get-TemplateSpecsName { + + [CmdletBinding()] + param ( + [Parameter(Mandatory)] + [string] $TemplateFilePath + ) + + $moduleIdentifier = (Split-Path $TemplateFilePath -Parent).Replace('\', '/').Split('/modules/')[1] + $templateSpecIdentifier = $moduleIdentifier.Replace('\', '/').Replace('/', '.').ToLower() + + + return $templateSpecIdentifier +} diff --git a/utilities/pipelines/resourcePublish/Publish-ModuleToPrivateBicepRegistry.ps1 b/utilities/pipelines/resourcePublish/Publish-ModuleToPrivateBicepRegistry.ps1 index 319c73b919..11cfddc7a5 100644 --- a/utilities/pipelines/resourcePublish/Publish-ModuleToPrivateBicepRegistry.ps1 +++ b/utilities/pipelines/resourcePublish/Publish-ModuleToPrivateBicepRegistry.ps1 @@ -52,6 +52,9 @@ function Publish-ModuleToPrivateBicepRegistry { begin { Write-Debug ('{0} entered' -f $MyInvocation.MyCommand) + + # Load used functions + . (Join-Path $PSScriptRoot 'Get-PrivateRegistryRepositoryName.ps1') } process { @@ -76,9 +79,8 @@ function Publish-ModuleToPrivateBicepRegistry { } } - # Extracts Microsoft.KeyVault/vaults from e.g. C:\modules\Microsoft.KeyVault\vaults\deploy.bicep - $moduleIdentifier = (Split-Path $TemplateFilePath -Parent).Replace('\', '/').Split('/modules/')[1] - $moduleRegistryIdentifier = 'bicep/modules/{0}' -f $moduleIdentifier.Replace('\', '/').Replace('/', '.').ToLower() + # Get a valid Container Registry name + $moduleRegistryIdentifier = Get-PrivateRegistryRepositoryName -TemplateFilePath $TemplateFilePath ############################################# ## Publish to private bicep registry ## diff --git a/utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpecsRG.ps1 b/utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpecsRG.ps1 index 77f1185066..9f047be260 100644 --- a/utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpecsRG.ps1 +++ b/utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpecsRG.ps1 @@ -53,12 +53,12 @@ function Publish-ModuleToTemplateSpecsRG { begin { Write-Debug ('{0} entered' -f $MyInvocation.MyCommand) + + # Load helper functions + . (Join-Path $PSScriptRoot 'Get-TemplateSpecsName.ps1') } process { - $moduleIdentifier = (Split-Path $TemplateFilePath -Parent).Replace('\', '/').Split('/modules/')[1] - $templateSpecIdentifier = $moduleIdentifier.Replace('\', '/').Replace('/', '.').ToLower() - ############################# ## EVALUATE RESOURCES ## ############################# @@ -68,6 +68,9 @@ function Publish-ModuleToTemplateSpecsRG { } } + # Get a valid Template Specs name + $templateSpecIdentifier = Get-TemplateSpecsName -TemplateFilePath $TemplateFilePath + ################################ ## Create template spec ## ################################ From 5bdb5244f12d70627ab331029c2a85a7788ca7d8 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Tue, 6 Dec 2022 16:44:24 +0100 Subject: [PATCH 05/39] Further updates --- .../Get-ModulesMissingFromTemplateSpecsRG.ps1 | 4 +- ...dulesMissingFromUniversalArtifactsFeed.ps1 | 80 ++++++++++++++++++- .../Get-UniversalArtifactsName.ps1 | 30 +++++++ ...Publish-ModuleToUniversalArtifactsFeed.ps1 | 11 +-- 4 files changed, 113 insertions(+), 12 deletions(-) create mode 100644 utilities/pipelines/resourcePublish/Get-UniversalArtifactsName.ps1 diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 index c7f9d041e8..1d55a915dc 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 @@ -53,11 +53,11 @@ function Get-ModulesMissingFromTemplateSpecsRG { if (-not (Get-AzResourceGroup -ResourceGroupName 'artifacts-rg')) { $missingTemplatePaths = $availableModuleTemplatePaths } else { - # Test all children against ACR + # Test all children against Resource Group $missingTemplatePaths = @() foreach ($templatePath in $availableModuleTemplatePaths) { - # Get a valid Container Registry name + # Get a valid Template Spec name $templateSpecsIdentifier = Get-TemplateSpecsName -TemplateFilePath $templatePath $null = Get-AzTemplateSpec -ResourceGroupName $TemplateSpecsRGName -Name $templateSpecsIdentifier -ErrorAction 'SilentlyContinue' -ErrorVariable 'result' diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 index 5bfc66df6b..b562dd6347 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 @@ -1,9 +1,83 @@ -function Get-ModulesMissingFromUniversalArtifactsFeed { +<# +.SYNOPSIS +Get a list of all modules (path & version) in the given TemplatePath that do not exist as a Template Spec in the given Resource Group + +.DESCRIPTION +Get a list of all modules (path & version) in the given TemplatePath that do not exist as a Template Spec in the given Resource Group + +.PARAMETER TemplateFilePath +Mandatory. The Template File Path to process + +.PARAMETER TemplateSpecsRGName +Mandatory. The Resource Group to search in + +.EXAMPLE +Get-ModulesMissingFromTemplateSpecsRG -TemplateFilePath 'C:\ResourceModules\modules\Microsoft.KeyVault\vaults\deploy.bicep' -TemplateSpecsRGName 'artifacts-rg' + +Check if either the Key Vault module or any of its children (e.g. 'secret') is missing in the Resource Group 'artifacts-rg' + +Returns for example: +Name Value +---- ----- +Version 0.4.0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\accessPolicies\deploy.bicep +Version 0.4.0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\keys\deploy.bicep +Version 0.4.0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\secrets\deploy.bicep +Version 0.5.0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\deploy.bicep +#> +function Get-ModulesMissingFromUniversalArtifactsFeed { [CmdletBinding()] param ( - [Parameter(Mandatory)] - [string] $TemplateFilePath + [Parameter(Mandatory = $true)] + [string] $TemplateFilePath, + + [Parameter(Mandatory = $true)] + [string] $TemplateSpecsRGName ) + begin { + Write-Debug ('{0} entered' -f $MyInvocation.MyCommand) + + # Load used functions + . (Join-Path $PSScriptRoot 'Get-UniversalArtifactsName.ps1') + } + + process { + # Get all children + $availableModuleTemplatePaths = (Get-ChildItem -Path (Split-Path $TemplateFilePath) -Recurse -Include @('deploy.bicep', 'deploy.json')).FullName + + # Test all children against Universal Artifacts feed + $missingTemplatePaths = @() + foreach ($templatePath in $availableModuleTemplatePaths) { + + # Get a valid Universal Artifact name + $templateSpecsIdentifier = Get-UniversalArtifactsName -TemplateFilePath $templatePath + + $null = # TODO Add call -ErrorAction 'SilentlyContinue' -ErrorVariable 'result' + + if ($result.exception.Response.StatusCode -eq 'NotFound') { + $missingTemplatePaths += $templatePath + } + } + + # Collect any that are not part of the ACR, fetch their version and return the result array + $modulesToPublish = @() + foreach ($missingTemplatePath in $missingTemplatePaths) { + $modulesToPublish += @{ + TemplateFilePath = $missingTemplatePath + Version = '{0}.0' -f (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version + } + } + + return $modulesToPublish + } + + end { + Write-Debug ('{0} exited' -f $MyInvocation.MyCommand) + } } + diff --git a/utilities/pipelines/resourcePublish/Get-UniversalArtifactsName.ps1 b/utilities/pipelines/resourcePublish/Get-UniversalArtifactsName.ps1 new file mode 100644 index 0000000000..34b8d43d8d --- /dev/null +++ b/utilities/pipelines/resourcePublish/Get-UniversalArtifactsName.ps1 @@ -0,0 +1,30 @@ +<# +.SYNOPSIS +Convert the given template file path into a valid Universal Artifact name + +.DESCRIPTION +Convert the given template file path into a valid Universal Artifact repository name +Must be lowercase alphanumerics, dashes, dots or underscores, under 256 characters. + +.PARAMETER TemplateFilePath +Mandatory. The template file path to convert + +.EXAMPLE +Get-UniversalArtifactsName -TemplateFilePath 'C:\modules\Microsoft.KeyVault\vaults\deploy.bicep' + +Convert 'C:\modules\Microsoft.KeyVault\vaults\deploy.bicep' to e.g. 'microsoft.keyvault.vaults' +#> +function Get-UniversalArtifactsName { + + [CmdletBinding()] + param ( + [Parameter(Mandatory)] + [string] $TemplateFilePath + ) + + $ModuleFolderPath = Split-Path $TemplateFilePath -Parent + $universalPackageModuleName = $ModuleFolderPath.Replace('\', '/').Split('/modules/')[1] + $universalPackageModuleName = ($universalPackageModuleName.Replace('\', '.').Replace('/', '.').toLower() -Replace '[^a-z0-9\.\-_]')[0..255] -join '' + + return $universalPackageModuleName +} diff --git a/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactsFeed.ps1 index 6415ca4eba..2480e5deaa 100644 --- a/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactsFeed.ps1 @@ -89,6 +89,9 @@ function Publish-ModuleToUniversalArtifactsFeed { begin { Write-Debug ('{0} entered' -f $MyInvocation.MyCommand) + + # Load helper functions + . (Join-Path $PSScriptRoot 'Get-UniversalArtifactsName.ps1') } process { @@ -100,13 +103,7 @@ function Publish-ModuleToUniversalArtifactsFeed { ################################# ## Generate package name ## ################################# - - # Universal package names => lowercase alphanumerics, dashes, dots or underscores, under 256 characters. - # 'C:\modules\Microsoft.KeyVault\vaults\deploy.bicep' => 'microsoft.keyvault.vaults' - $ModuleFolderPath = Split-Path $TemplateFilePath -Parent - $universalPackageModuleName = $ModuleFolderPath.Replace('\', '/').Split('/modules/')[1] - $universalPackageModuleName = ($universalPackageModuleName.Replace('\', '.').Replace('/', '.').toLower() -Replace '[^a-z0-9\.\-_]')[0..255] -join '' - Write-Verbose "The universal package name is [$universalPackageModuleName]" -Verbose + $universalPackageModuleName = Get-UniversalArtifactsName -TemplateFilePath $TemplateFilePath ########################### ## Find feed scope ## From d759d3f2c9ead05341c01beeda7bd648b27f0e8a Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Tue, 6 Dec 2022 17:34:40 +0100 Subject: [PATCH 06/39] Update to latest --- .../Get-ModulesMissingFromUniversalArtifactsFeed.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 index b562dd6347..dc83df364f 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 @@ -55,7 +55,7 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { foreach ($templatePath in $availableModuleTemplatePaths) { # Get a valid Universal Artifact name - $templateSpecsIdentifier = Get-UniversalArtifactsName -TemplateFilePath $templatePath + $artifactsIdentifier = Get-UniversalArtifactsName -TemplateFilePath $templatePath $null = # TODO Add call -ErrorAction 'SilentlyContinue' -ErrorVariable 'result' From e25c5bb783e48a255d5c001bcbdfa18f9f006006 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Tue, 6 Dec 2022 18:25:57 +0100 Subject: [PATCH 07/39] Updated Universal Packages fetch --- ...dulesMissingFromUniversalArtifactsFeed.ps1 | 55 +++++++++++++++---- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 index dc83df364f..a03e6ba25b 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 @@ -1,20 +1,32 @@ <# .SYNOPSIS -Get a list of all modules (path & version) in the given TemplatePath that do not exist as a Template Spec in the given Resource Group +Get a list of all modules (path & version) in the given TemplatePath that do not exist as an Universal Package in the given Azure DevOps project & artifacts feed .DESCRIPTION -Get a list of all modules (path & version) in the given TemplatePath that do not exist as a Template Spec in the given Resource Group +Get a list of all modules (path & version) in the given TemplatePath that do not exist as an Universal Package in the given Azure DevOps project & artifacts feed .PARAMETER TemplateFilePath Mandatory. The Template File Path to process -.PARAMETER TemplateSpecsRGName -Mandatory. The Resource Group to search in +.PARAMETER VstsOrganizationUri +Mandatory. Azure DevOps organization URL hosting the artifacts feed. +Example: 'https://dev.azure.com/fabrikam/'. + +.PARAMETER VstsFeedProject +Optional. Name of the project hosting the artifacts feed. May be empty. +Example: 'IaC'. + +.PARAMETER VstsFeedName +Mandatory. Name to the feed to publish to. +Example: 'Artifacts'. + +.PARAMETER BearerToken +Optional. The bearer token to use to authenticate the request. If not provided it MUST be existing in your environment as `$env:TOKEN` .EXAMPLE -Get-ModulesMissingFromTemplateSpecsRG -TemplateFilePath 'C:\ResourceModules\modules\Microsoft.KeyVault\vaults\deploy.bicep' -TemplateSpecsRGName 'artifacts-rg' +Get-ModulesMissingFromUniversalArtifactsFeed -TemplateFilePath 'C:\modules\Microsoft.KeyVault\vaults\deploy.bicep' -vstsOrganizationUri 'https://dev.azure.com/fabrikam' -VstsProject 'IaC' -VstsFeedName 'Artifacts' -Check if either the Key Vault module or any of its children (e.g. 'secret') is missing in the Resource Group 'artifacts-rg' +Check if either the Key Vault module or any of its children (e.g. 'secret') is missing in artifacts feed 'Artifacts' of Azure DevOps project 'https://dev.azure.com/fabrikam/IaC' Returns for example: Name Value @@ -35,8 +47,17 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { [Parameter(Mandatory = $true)] [string] $TemplateFilePath, - [Parameter(Mandatory = $true)] - [string] $TemplateSpecsRGName + [Parameter(Mandatory)] + [string] $VstsOrganizationUri, + + [Parameter(Mandatory = $false)] + [string] $VstsFeedProject = '', + + [Parameter(Mandatory)] + [string] $VstsFeedName, + + [Parameter(Mandatory = $false)] + [string] $BearerToken = $env:TOKEN ) begin { @@ -50,6 +71,19 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { # Get all children $availableModuleTemplatePaths = (Get-ChildItem -Path (Split-Path $TemplateFilePath) -Recurse -Include @('deploy.bicep', 'deploy.json')).FullName + # Get artifacts + $VstsOrganization = Split-Path $VstsOrganizationUri -Leaf + + $modulesInputObject = @{ + Method = 'Get' + Headers = @{ + Authorization = "Basic $BearerToken" + } + Uri = "https://feeds.dev.azure.com/$VstsOrganization/$VstsFeedProject/_apis/packaging/Feeds/$VstsFeedName/Packages?api-version=6.0-preview" + } + $publishedModules = Invoke-RestMethod @modulesInputObject + $publishedModules = $publishedModules.value.name # Reduce down to the name + # Test all children against Universal Artifacts feed $missingTemplatePaths = @() foreach ($templatePath in $availableModuleTemplatePaths) { @@ -57,9 +91,7 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { # Get a valid Universal Artifact name $artifactsIdentifier = Get-UniversalArtifactsName -TemplateFilePath $templatePath - $null = # TODO Add call -ErrorAction 'SilentlyContinue' -ErrorVariable 'result' - - if ($result.exception.Response.StatusCode -eq 'NotFound') { + if ($publishedModules -notcontains $artifactsIdentifier) { $missingTemplatePaths += $templatePath } } @@ -80,4 +112,3 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { Write-Debug ('{0} exited' -f $MyInvocation.MyCommand) } } - From 073dd720e9b3cec0d809b3bd692575deef6eda08 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 00:13:32 +0100 Subject: [PATCH 08/39] Bugfix & disabled pipeline parts --- .../pipelineTemplates/jobs.publishModule.yml | 10 ++++++- .../pipelineTemplates/stages.module.yml | 28 +++++++++---------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 94c133b288..d245e116c5 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -149,7 +149,15 @@ jobs: $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose # Add all modules that don't exist in the target location - foreach($missingModule in (Get-ModulesMissingFromUniversalArtifactsFeed -TemplateFilePath $TemplateFilePath)) { + $missingInputObject = @{ + TemplateFilePath = $TemplateFilePath + VstsOrganizationUri = '${{ parameters.vstsOrganizationUri }}' + VstsFeedProject = '${{ parameters.vstsFeedProject }}' + VstsFeedName = '${{ parameters.vstsFeedName }}' + BearerToken = $env:TOKEN + } + $missingModules = Get-ModulesMissingFromUniversalArtifactsFeed @missingInputObject + foreach($missingModule in $missingModules) { if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { $modulesToPublish += $missingModule } diff --git a/.azuredevops/pipelineTemplates/stages.module.yml b/.azuredevops/pipelineTemplates/stages.module.yml index 647517a17e..b1f435348d 100644 --- a/.azuredevops/pipelineTemplates/stages.module.yml +++ b/.azuredevops/pipelineTemplates/stages.module.yml @@ -5,23 +5,23 @@ parameters: defaultJobTimeoutInMinutes: 120 stages: - - stage: validation - displayName: Static validation - jobs: - - template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml + # - stage: validation + # displayName: Static validation + # jobs: + # - template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml - - stage: deployment - displayName: Deployment validation - jobs: - - template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml - parameters: - templateFilePath: '$(modulePath)/deploy.bicep' - removeDeployment: '${{ parameters.removeDeployment }}' - defaultJobTimeoutInMinutes: ${{ parameters.defaultJobTimeoutInMinutes }} + # - stage: deployment + # displayName: Deployment validation + # jobs: + # - template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml + # parameters: + # templateFilePath: '$(modulePath)/deploy.bicep' + # removeDeployment: '${{ parameters.removeDeployment }}' + # defaultJobTimeoutInMinutes: ${{ parameters.defaultJobTimeoutInMinutes }} - stage: Publishing - dependsOn: - - deployment + # dependsOn: + # - deployment displayName: Publish module condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq('${{ parameters.prerelease }}', 'true'))) jobs: From cfe426faa333fbac13eb57ce6d450a49190378d8 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 09:37:21 +0100 Subject: [PATCH 09/39] Adjusted header --- .../Get-ModulesMissingFromUniversalArtifactsFeed.ps1 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 index a03e6ba25b..f889f99efa 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 @@ -47,15 +47,15 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { [Parameter(Mandatory = $true)] [string] $TemplateFilePath, - [Parameter(Mandatory)] + [Parameter(Mandatory = $true)] + [string] $VstsFeedName, + + [Parameter(Mandatory = $true)] [string] $VstsOrganizationUri, [Parameter(Mandatory = $false)] [string] $VstsFeedProject = '', - [Parameter(Mandatory)] - [string] $VstsFeedName, - [Parameter(Mandatory = $false)] [string] $BearerToken = $env:TOKEN ) @@ -77,7 +77,8 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { $modulesInputObject = @{ Method = 'Get' Headers = @{ - Authorization = "Basic $BearerToken" + # Authorization = "Basic $BearerToken" # For custom PAT + Authorization = "Bearer $BearerToken" # For pipeline PAT } Uri = "https://feeds.dev.azure.com/$VstsOrganization/$VstsFeedProject/_apis/packaging/Feeds/$VstsFeedName/Packages?api-version=6.0-preview" } From 748be3301619d035e86e5e52ed3f5daed9744896 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 09:41:49 +0100 Subject: [PATCH 10/39] Update to latest --- settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.yml b/settings.yml index 37c759f5f5..2b50a57b79 100644 --- a/settings.yml +++ b/settings.yml @@ -90,7 +90,7 @@ variables: ###################################### artifactsFeedDoPublish: true # Set to true, if you would like to publish modules as Universal Packages (in Azure DevOps Artifacts) - vstsFeedName: 'ResourceModules' # The name of the Azure DevOps universal packages feed to publish to + vstsFeedName: 'carml' # The name of the Azure DevOps universal packages feed to publish to vstsFeedProject: '$(System.TeamProject)' # The project that hosts the feed vstsFeedToken: $(System.AccessToken) # The token used to publish universal packages into the feed above From b4e20b581451e630ae0a3146e0ff272e69c8954d Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 09:54:56 +0100 Subject: [PATCH 11/39] Update to latest --- .../Get-ModulesMissingFromUniversalArtifactsFeed.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 index f889f99efa..64a5119c10 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 @@ -82,6 +82,9 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { } Uri = "https://feeds.dev.azure.com/$VstsOrganization/$VstsFeedProject/_apis/packaging/Feeds/$VstsFeedName/Packages?api-version=6.0-preview" } + + Write-Verbose "URL: [$($modulesInputObject.Uri)]" -Verbose + $publishedModules = Invoke-RestMethod @modulesInputObject $publishedModules = $publishedModules.value.name # Reduce down to the name From bf58ba41d85b7d48311cb0e2212c727d7edf9578 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 10:00:14 +0100 Subject: [PATCH 12/39] Update to latest --- .../pipelineTemplates/jobs.publishModule.yml | 49 +++++++++++++++++-- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index d245e116c5..0bf724a27f 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -138,6 +138,9 @@ jobs: $TemplateFilePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' 'deploy.json' } + ################################ + ## Get modules to publish ## + ################################ $functionInput = @{ TemplateFilePath = $TemplateFilePath } @@ -148,22 +151,31 @@ jobs: # Get the modified child resources $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + ############################# + ## Get missing modules ## + ############################# # Add all modules that don't exist in the target location $missingInputObject = @{ TemplateFilePath = $TemplateFilePath VstsOrganizationUri = '${{ parameters.vstsOrganizationUri }}' VstsFeedProject = '${{ parameters.vstsFeedProject }}' VstsFeedName = '${{ parameters.vstsFeedName }}' - BearerToken = $env:TOKEN } - $missingModules = Get-ModulesMissingFromUniversalArtifactsFeed @missingInputObject + + Write-Verbose "Invoke Get-ModulesMissingFromUniversalArtifactsFeed with" -Verbose + Write-Verbose ($missingInputObject | ConvertTo-Json | Out-String) -Verbose + + $missingModules = Get-ModulesMissingFromUniversalArtifactsFeed @missingInputObject -BearerToken $env:TOKEN + foreach($missingModule in $missingModules) { if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { $modulesToPublish += $missingModule } } - # Publish the modified child resources + ################# + ## Publish ## + ################# foreach ($moduleToPublish in $modulesToPublish) { $RelPath = (($moduleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] Write-Host "##[group]$(' - [{0}] [{1}]' -f $RelPath, $moduleToPublish.Version)" @@ -213,6 +225,9 @@ jobs: $TemplateFilePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' 'deploy.json' } + ################################ + ## Get modules to publish ## + ################################ $functionInput = @{ TemplateFilePath = $TemplateFilePath } @@ -223,19 +238,30 @@ jobs: # Get the modified child resources $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + ############################# + ## Get missing modules ## + ############################# + # Add all modules that don't exist in the target location $missingInputObject = @{ TemplateFilePath = $TemplateFilePath TemplateSpecsRGName = '${{ parameters.templateSpecsRgName }}' } + + Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose + Write-Verbose ($missingInputObject | ConvertTo-Json | Out-String) -Verbose + $missingModules = Get-ModulesMissingFromTemplateSpecsRG @missingInputObject + foreach($missingModule in $missingModules) { if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { $modulesToPublish += $missingModule } } - # Publish the modified child resources + ################# + ## Publish ## + ################# foreach ($moduleToPublish in $modulesToPublish) { $RelPath = (($moduleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] Write-Host "##[group]$(' - [{0}] [{1}]' -f $RelPath, $moduleToPublish.Version)" @@ -286,6 +312,9 @@ jobs: $TemplateFilePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' 'deploy.json' } + ################################ + ## Get modules to publish ## + ################################ $functionInput = @{ TemplateFilePath = $TemplateFilePath publishLatest = $(publishLatest) @@ -297,20 +326,30 @@ jobs: # Get the modified child resources $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + ############################# + ## Get missing modules ## + ############################# # Add all modules that don't exist in the target location $missingInputObject = @{ TemplateFilePath = $TemplateFilePath BicepRegistryName = '${{ parameters.bicepRegistryName }}' BicepRegistryRgName = '${{ parameters.bicepRegistryRgName }}' } + + Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose + Write-Verbose ($missingInputObject | ConvertTo-Json | Out-String) -Verbose + $missingModules = Get-ModulesMissingFromPrivateBicepRegistry @missingInputObject + foreach($missingModule in $missingModules) { if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { $modulesToPublish += $missingModule } } - # Publish the modified child resources + ################# + ## Publish ## + ################# foreach ($moduleToPublish in $modulesToPublish) { $RelPath = (($moduleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] Write-Host "##[group]$(' - [{0}] [{1}]' -f $RelPath, $moduleToPublish.Version)" From 2a5c6ef0481beb30b5d3ae6b7f09050a6e452c72 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 10:05:28 +0100 Subject: [PATCH 13/39] Aligned pipelines --- .../templates/publishModule/action.yml | 47 +++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index 4492560b50..106691371c 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -105,6 +105,9 @@ runs: . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesMissingFromTemplateSpecsRG.ps1') . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToTemplateSpecsRG.ps1') + ################################ + ## Get modules to publish ## + ################################ $functionInput = @{ TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" } @@ -115,14 +118,30 @@ runs: # Get the modified child resources $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + ############################# + ## Get missing modules ## + ############################# + # Add all modules that don't exist in the target location - foreach($missingModule in (Get-ModulesMissingFromTemplateSpecsRG -TemplateFilePath $TemplateFilePath)) { + $missingInputObject = @{ + TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" + TemplateSpecsRGName = '${{ inputs.templateSpecsRgName }}' + } + + Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose + Write-Verbose ($missingInputObject | ConvertTo-Json | Out-String) -Verbose + + $missingModules = Get-ModulesMissingFromTemplateSpecsRG @missingInputObject + + foreach($missingModule in $missingModules) { if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { $modulesToPublish += $missingModule } } - # Publish the modified child resources + ################# + ## Publish ## + ################# foreach ($moduleToPublish in $modulesToPublish) { $RelPath = (($moduleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] Write-Output "::group::$(' - [{0}] [{1}]' -f $RelPath, $moduleToPublish.Version)" @@ -157,6 +176,10 @@ runs: . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesMissingFromPrivateBicepRegistry.ps1') . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1') + + ################################ + ## Get modules to publish ## + ################################ $functionInput = @{ TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" publishLatest = $(publishLatest) @@ -168,14 +191,30 @@ runs: # Get the modified child resources $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + ############################# + ## Get missing modules ## + ############################# # Add all modules that don't exist in the target location - foreach($missingModule in (Get-ModulesMissingFromPrivateBicepRegistry -TemplateFilePath $TemplateFilePath)) { + $missingInputObject = @{ + TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" + BicepRegistryName = '${{ inputs.bicepRegistryName }}' + BicepRegistryRgName = '${{ inputs.bicepRegistryRgName }}' + } + + Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose + Write-Verbose ($missingInputObject | ConvertTo-Json | Out-String) -Verbose + + $missingModules = Get-ModulesMissingFromPrivateBicepRegistry @missingInputObject + + foreach($missingModule in $missingModules) { if($modulsToPublish.TemplateFilePath -notcontains $missingModule.TemplateFilePath) { $modulesToPublish += $missingModule } } - # Publish the modified child resources + ################# + ## Publish ## + ################# foreach ($moduleToPublish in $modulesToPublish) { $RelPath = (($moduleToPublish.TemplateFilePath).Split('/modules/')[-1]).Split('/deploy.')[0] Write-Output "::group::$(' - [{0}] [{1}]' -f $RelPath, $moduleToPublish.Version)" From 05efd5e73da98a0ef7285a79ad33bfadf170d49d Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 10:10:21 +0100 Subject: [PATCH 14/39] Small adjustment --- .../Get-ModulesMissingFromUniversalArtifactsFeed.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 index 64a5119c10..361b319e19 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 @@ -72,7 +72,10 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { $availableModuleTemplatePaths = (Get-ChildItem -Path (Split-Path $TemplateFilePath) -Recurse -Include @('deploy.bicep', 'deploy.json')).FullName # Get artifacts - $VstsOrganization = Split-Path $VstsOrganizationUri -Leaf + if ($VstsOrganizationUri -like '*/') { + $VstsOrganizationUri = $VstsOrganizationUri.Substring(0, ($VstsOrganizationUri.length - 1)) # Remove tailing slash if any + } + $VstsOrganization = Split-Path $VstsOrganizationUri -Leaf # Extract only organization name $modulesInputObject = @{ Method = 'Get' From da67c3114ce6fc7bdbf3ffb4659431262e2b1063 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 10:24:29 +0100 Subject: [PATCH 15/39] Adjusted feedname --- settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.yml b/settings.yml index 2b50a57b79..15b6e510f3 100644 --- a/settings.yml +++ b/settings.yml @@ -90,7 +90,7 @@ variables: ###################################### artifactsFeedDoPublish: true # Set to true, if you would like to publish modules as Universal Packages (in Azure DevOps Artifacts) - vstsFeedName: 'carml' # The name of the Azure DevOps universal packages feed to publish to + vstsFeedName: 'carml-modules' # The name of the Azure DevOps universal packages feed to publish to vstsFeedProject: '$(System.TeamProject)' # The project that hosts the feed vstsFeedToken: $(System.AccessToken) # The token used to publish universal packages into the feed above From bc8e1454cd5d92d52147ca0e87ccd9e41653cf7e Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 10:26:26 +0100 Subject: [PATCH 16/39] Update to latest --- .../Get-ModulesMissingFromUniversalArtifactsFeed.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 index 361b319e19..ca9e627c5a 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 @@ -53,9 +53,6 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { [Parameter(Mandatory = $true)] [string] $VstsOrganizationUri, - [Parameter(Mandatory = $false)] - [string] $VstsFeedProject = '', - [Parameter(Mandatory = $false)] [string] $BearerToken = $env:TOKEN ) @@ -83,7 +80,7 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { # Authorization = "Basic $BearerToken" # For custom PAT Authorization = "Bearer $BearerToken" # For pipeline PAT } - Uri = "https://feeds.dev.azure.com/$VstsOrganization/$VstsFeedProject/_apis/packaging/Feeds/$VstsFeedName/Packages?api-version=6.0-preview" + Uri = "https://feeds.dev.azure.com/$VstsOrganization/_apis/packaging/Feeds/$VstsFeedName/Packages?api-version=6.0-preview" } Write-Verbose "URL: [$($modulesInputObject.Uri)]" -Verbose From 6a8f40f67938316a9c84328ebbd83288e9d268e9 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 10:26:35 +0100 Subject: [PATCH 17/39] Update to latest --- .../Get-ModulesMissingFromUniversalArtifactsFeed.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 index ca9e627c5a..6709cdd883 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 @@ -53,6 +53,9 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { [Parameter(Mandatory = $true)] [string] $VstsOrganizationUri, + [Parameter(Mandatory = $false)] + [string] $VstsFeedProject = '', + [Parameter(Mandatory = $false)] [string] $BearerToken = $env:TOKEN ) From 31a53d4291841759dfd37efcf52caa5d52b27d6c Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 10:34:57 +0100 Subject: [PATCH 18/39] Update to latest --- .../Get-ModulesMissingFromUniversalArtifactsFeed.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 index 6709cdd883..361b319e19 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 @@ -83,7 +83,7 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { # Authorization = "Basic $BearerToken" # For custom PAT Authorization = "Bearer $BearerToken" # For pipeline PAT } - Uri = "https://feeds.dev.azure.com/$VstsOrganization/_apis/packaging/Feeds/$VstsFeedName/Packages?api-version=6.0-preview" + Uri = "https://feeds.dev.azure.com/$VstsOrganization/$VstsFeedProject/_apis/packaging/Feeds/$VstsFeedName/Packages?api-version=6.0-preview" } Write-Verbose "URL: [$($modulesInputObject.Uri)]" -Verbose From 30ced1371e2db496fdc72327a53b333a0b8308cd Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 10:44:59 +0100 Subject: [PATCH 19/39] Update to latest --- .azuredevops/pipelineTemplates/jobs.publishModule.yml | 11 +++++------ .../Get-ModulesMissingFromPrivateBicepRegistry.ps1 | 4 +++- .../Get-ModulesMissingFromTemplateSpecsRG.ps1 | 4 +++- .../Get-ModulesMissingFromUniversalArtifactsFeed.ps1 | 6 +++--- .../Publish-ModuleToUniversalArtifactsFeed.ps1 | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 0bf724a27f..e339f2dacc 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -181,18 +181,17 @@ jobs: Write-Host "##[group]$(' - [{0}] [{1}]' -f $RelPath, $moduleToPublish.Version)" $functionInput = @{ - TemplateFilePath = $moduleToPublish.TemplateFilePath + TemplateFilePath = $moduleToPublish.TemplateFilePath VstsOrganizationUri = '${{ parameters.vstsOrganizationUri }}' - VstsFeedProject = '${{ parameters.vstsFeedProject }}' - VstsFeedName = '${{ parameters.vstsFeedName }}' - ModuleVersion = $moduleToPublish.Version - BearerToken = $env:TOKEN + VstsFeedProject = '${{ parameters.vstsFeedProject }}' + VstsFeedName = '${{ parameters.vstsFeedName }}' + ModuleVersion = $moduleToPublish.Version } Write-Verbose "Invoke Publish-ModuleToUniversalArtifactsFeed with" -Verbose Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose - Publish-ModuleToUniversalArtifactsFeed @functionInput -Verbose + Publish-ModuleToUniversalArtifactsFeed @functionInput -BearerToken $env:TOKEN -Verbose Write-Host "##[endgroup]" } env: diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 index 8e91e243de..f0a41177b6 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 @@ -73,10 +73,12 @@ function Get-ModulesMissingFromPrivateBicepRegistry { # Collect any that are not part of the ACR, fetch their version and return the result array $modulesToPublish = @() foreach ($missingTemplatePath in $missingTemplatePaths) { - $modulesToPublish += @{ + $moduleToPublish = @{ TemplateFilePath = $missingTemplatePath Version = '{0}.0' -f (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version } + $modulesToPublish += $moduleToPublish + Write-Verbose ('Missing module [{0}] will be considered for publishing with version [{1}]' -f $modulesToPublish.TemplateFilePath, $modulesToPublish.Version) } return $modulesToPublish diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 index 1d55a915dc..61c0c5cb1e 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 @@ -71,10 +71,12 @@ function Get-ModulesMissingFromTemplateSpecsRG { # Collect any that are not part of the ACR, fetch their version and return the result array $modulesToPublish = @() foreach ($missingTemplatePath in $missingTemplatePaths) { - $modulesToPublish += @{ + $moduleToPublish = @{ TemplateFilePath = $missingTemplatePath Version = '{0}.0' -f (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version } + $modulesToPublish += $moduleToPublish + Write-Verbose ('Missing module [{0}] will be considered for publishing with version [{1}]' -f $modulesToPublish.TemplateFilePath, $modulesToPublish.Version) -Verbose } return $modulesToPublish diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 index 361b319e19..ce47a0c0fc 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 @@ -86,8 +86,6 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { Uri = "https://feeds.dev.azure.com/$VstsOrganization/$VstsFeedProject/_apis/packaging/Feeds/$VstsFeedName/Packages?api-version=6.0-preview" } - Write-Verbose "URL: [$($modulesInputObject.Uri)]" -Verbose - $publishedModules = Invoke-RestMethod @modulesInputObject $publishedModules = $publishedModules.value.name # Reduce down to the name @@ -106,10 +104,12 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { # Collect any that are not part of the ACR, fetch their version and return the result array $modulesToPublish = @() foreach ($missingTemplatePath in $missingTemplatePaths) { - $modulesToPublish += @{ + $moduleToPublish = @{ TemplateFilePath = $missingTemplatePath Version = '{0}.0' -f (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version } + $modulesToPublish += $moduleToPublish + Write-Verbose ('Missing module [{0}] will be considered for publishing with version [{1}]' -f $modulesToPublish.TemplateFilePath, $modulesToPublish.Version) -Verbose } return $modulesToPublish diff --git a/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactsFeed.ps1 index 2480e5deaa..09d8fe7b66 100644 --- a/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Publish-ModuleToUniversalArtifactsFeed.ps1 @@ -126,7 +126,7 @@ function Publish-ModuleToUniversalArtifactsFeed { '--scope', "$feedScope", '--name', "$universalPackageModuleName", '--version', "$ModuleVersion", - '--path', "$ModuleFolderPath", + '--path', "$TemplateFilePath", '--description', "$universalPackageModuleName Module", '--verbose' ) From af30397c106b9036846939e7593064dbc7ae6771 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 10:47:09 +0100 Subject: [PATCH 20/39] Adjusted output --- utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 index 1f6bdd01d8..4ee0f44179 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 @@ -456,7 +456,7 @@ function Get-ModulesToPublish { Write-Verbose (' - [{0}] [{1}] ' -f $RelPath, $_.Version) -Verbose } } else { - Write-Verbose 'No modules to publish.'-Verbose + Write-Verbose 'No modules with changes found to publish.'-Verbose } return $modulesToPublish From 311446a9051b129c1c6ebe4450e915d6734885db Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 10:50:17 +0100 Subject: [PATCH 21/39] Update to latest --- ... - Scenario 2 Onboard module library and CI environment.md | 4 ++-- .../Get-ModulesMissingFromPrivateBicepRegistry.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md b/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md index 55cc4bc34f..2a76dc5844 100644 --- a/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md +++ b/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md @@ -329,7 +329,7 @@ The primary pipeline settings file ([`settings.yml`](https://github.com/Azure/Re | Variable Name | Example Value | Description | | - | - | - | -| `vstsFeedName` | `'ResourceModules'` | The name of the Azure DevOps universal packages feed to publish to. | +| `vstsFeedName` | `'carml-modules'` | The name of the Azure DevOps universal packages feed to publish to. | | `vstsFeedProject` | `'$(System.TeamProject)'` | The project that hosts the feed. The feed must be created in Azure DevOps ahead of time. | | `vstsFeedToken` | `'$(System.AccessToken)'` | The token used to publish universal packages into the feed above. | | `artifactsFeedDoPublish` | `'true'` | A central switch to enable/disable publishing to Universal packages. | @@ -354,7 +354,7 @@ This section will explain what is required to publish the modules to [Azure Arti 1. An Azure DevOps organization and project 1. An Azure DevOps artifacts feed - > Note: The default feed name is `ResourceModules` as configured in the [`settings.yml`](https://github.com/Azure/ResourceModules/blob/main/settings.yml) file's variable `vstsFeedName`. Update the value here if you want to use a different name, but make sure it matches the name of the artifact feed created in Azure DevOps. + > Note: The default feed name is `carml-modules` as configured in the [`settings.yml`](https://github.com/Azure/ResourceModules/blob/main/settings.yml) file's variable `vstsFeedName`. Update the value here if you want to use a different name, but make sure it matches the name of the artifact feed created in Azure DevOps. 1. An Azure DevOps project to host the artifact feed > Note: There are a couple options to consider when setting up an Azure Artifact feed. For example, organization-scoped feeds vs project-scoped feeds. Please see what option suits your needs by reviewing the [feeds](https://docs.microsoft.com/en-us/azure/devops/artifacts/concepts/feeds?view=azure-devops) document first. 1. If you chose the feed to be project-scoped, you will need the Project Build Service account to have `Contributor` access to publish to the Azure Artifacts feed. To set this, follow the [Pipeline permission](https://docs.microsoft.com/en-us/azure/devops/artifacts/feeds/feed-permissions?view=azure-devops#pipelines-permissions) steps. diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 index f0a41177b6..0dc383e5b2 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 @@ -78,7 +78,7 @@ function Get-ModulesMissingFromPrivateBicepRegistry { Version = '{0}.0' -f (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version } $modulesToPublish += $moduleToPublish - Write-Verbose ('Missing module [{0}] will be considered for publishing with version [{1}]' -f $modulesToPublish.TemplateFilePath, $modulesToPublish.Version) + Write-Verbose ('Missing module [{0}] will be considered for publishing with version [{1}]' -f $modulesToPublish.TemplateFilePath, $modulesToPublish.Version) -Verbose } return $modulesToPublish From 2ea09ca3c195874fd2ada24c86dd78dcca95eb48 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 10:53:11 +0100 Subject: [PATCH 22/39] Extended docs --- ...ted - Scenario 2 Onboard module library and CI environment.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md b/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md index 2a76dc5844..6434d4cd68 100644 --- a/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md +++ b/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md @@ -355,6 +355,7 @@ This section will explain what is required to publish the modules to [Azure Arti 1. An Azure DevOps organization and project 1. An Azure DevOps artifacts feed > Note: The default feed name is `carml-modules` as configured in the [`settings.yml`](https://github.com/Azure/ResourceModules/blob/main/settings.yml) file's variable `vstsFeedName`. Update the value here if you want to use a different name, but make sure it matches the name of the artifact feed created in Azure DevOps. + > Note: It's also very important that the feed's 'Permissions' (Artifact Feed -> Feed settings -> Permissions) are set up so that the project's 'Build Service' has at least the role 'Contributor' to be able to publish artifacts ([ref](https://learn.microsoft.com/en-us/azure/devops/artifacts/feeds/feed-permissions?view=azure-devops#permissions-table)). 1. An Azure DevOps project to host the artifact feed > Note: There are a couple options to consider when setting up an Azure Artifact feed. For example, organization-scoped feeds vs project-scoped feeds. Please see what option suits your needs by reviewing the [feeds](https://docs.microsoft.com/en-us/azure/devops/artifacts/concepts/feeds?view=azure-devops) document first. 1. If you chose the feed to be project-scoped, you will need the Project Build Service account to have `Contributor` access to publish to the Azure Artifacts feed. To set this, follow the [Pipeline permission](https://docs.microsoft.com/en-us/azure/devops/artifacts/feeds/feed-permissions?view=azure-devops#pipelines-permissions) steps. From aad13b328db85383c89df2008f584c4df8c62bee Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 10:55:23 +0100 Subject: [PATCH 23/39] Extended docs --- ...Scenario 2 Onboard module library and CI environment.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md b/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md index 6434d4cd68..6380984277 100644 --- a/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md +++ b/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md @@ -354,10 +354,11 @@ This section will explain what is required to publish the modules to [Azure Arti 1. An Azure DevOps organization and project 1. An Azure DevOps artifacts feed - > Note: The default feed name is `carml-modules` as configured in the [`settings.yml`](https://github.com/Azure/ResourceModules/blob/main/settings.yml) file's variable `vstsFeedName`. Update the value here if you want to use a different name, but make sure it matches the name of the artifact feed created in Azure DevOps. - > Note: It's also very important that the feed's 'Permissions' (Artifact Feed -> Feed settings -> Permissions) are set up so that the project's 'Build Service' has at least the role 'Contributor' to be able to publish artifacts ([ref](https://learn.microsoft.com/en-us/azure/devops/artifacts/feeds/feed-permissions?view=azure-devops#permissions-table)). + > **Note:** The default feed name is `carml-modules` as configured in the [`settings.yml`](https://github.com/Azure/ResourceModules/blob/main/settings.yml) file's variable `vstsFeedName`. Update the value here if you want to use a different name, but make sure it matches the name of the artifact feed created in Azure DevOps. + > + > **Note:** It's also very important that the feed's 'Permissions' (Artifact Feed -> Feed settings -> Permissions) are set up so that the project's 'Build Service' has at least the role 'Contributor' to be able to publish artifacts ([ref](https://learn.microsoft.com/en-us/azure/devops/artifacts/feeds/feed-permissions?view=azure-devops#permissions-table)). 1. An Azure DevOps project to host the artifact feed - > Note: There are a couple options to consider when setting up an Azure Artifact feed. For example, organization-scoped feeds vs project-scoped feeds. Please see what option suits your needs by reviewing the [feeds](https://docs.microsoft.com/en-us/azure/devops/artifacts/concepts/feeds?view=azure-devops) document first. + > **Note:** There are a couple options to consider when setting up an Azure Artifact feed. For example, organization-scoped feeds vs project-scoped feeds. Please see what option suits your needs by reviewing the [feeds](https://docs.microsoft.com/en-us/azure/devops/artifacts/concepts/feeds?view=azure-devops) document first. 1. If you chose the feed to be project-scoped, you will need the Project Build Service account to have `Contributor` access to publish to the Azure Artifacts feed. To set this, follow the [Pipeline permission](https://docs.microsoft.com/en-us/azure/devops/artifacts/feeds/feed-permissions?view=azure-devops#pipelines-permissions) steps. #### Implementation Guidance From 914dcc45c4bd59e9223f5b1933d56b92e9ad4890 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 11:02:52 +0100 Subject: [PATCH 24/39] Fixed output --- .azuredevops/pipelineTemplates/jobs.publishModule.yml | 4 ++-- .github/actions/templates/publishModule/action.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index e339f2dacc..2ecbf57d95 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -247,7 +247,7 @@ jobs: TemplateSpecsRGName = '${{ parameters.templateSpecsRgName }}' } - Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose + Write-Verbose "Invoke Get-ModulesMissingFromTemplateSpecsRG with" -Verbose Write-Verbose ($missingInputObject | ConvertTo-Json | Out-String) -Verbose $missingModules = Get-ModulesMissingFromTemplateSpecsRG @missingInputObject @@ -335,7 +335,7 @@ jobs: BicepRegistryRgName = '${{ parameters.bicepRegistryRgName }}' } - Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose + Write-Verbose "Invoke Get-ModulesMissingFromPrivateBicepRegistry with" -Verbose Write-Verbose ($missingInputObject | ConvertTo-Json | Out-String) -Verbose $missingModules = Get-ModulesMissingFromPrivateBicepRegistry @missingInputObject diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index 106691371c..cdc5b0010a 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -128,7 +128,7 @@ runs: TemplateSpecsRGName = '${{ inputs.templateSpecsRgName }}' } - Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose + Write-Verbose "Invoke Get-ModulesMissingFromTemplateSpecsRG with" -Verbose Write-Verbose ($missingInputObject | ConvertTo-Json | Out-String) -Verbose $missingModules = Get-ModulesMissingFromTemplateSpecsRG @missingInputObject @@ -201,7 +201,7 @@ runs: BicepRegistryRgName = '${{ inputs.bicepRegistryRgName }}' } - Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose + Write-Verbose "Invoke Get-ModulesMissingFromPrivateBicepRegistry with" -Verbose Write-Verbose ($missingInputObject | ConvertTo-Json | Out-String) -Verbose $missingModules = Get-ModulesMissingFromPrivateBicepRegistry @missingInputObject From 19597262a978bd1cb8371fbe7e49d116e86fb60a Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 11:09:14 +0100 Subject: [PATCH 25/39] Fixed GH passthru --- .azuredevops/pipelineTemplates/jobs.publishModule.yml | 4 +++- .github/actions/templates/publishModule/action.yml | 8 +++++++- .github/workflows/ms.aad.domainservices.yml | 1 + .github/workflows/ms.analysisservices.servers.yml | 1 + .github/workflows/ms.apimanagement.service.yml | 1 + .../workflows/ms.appconfiguration.configurationstores.yml | 1 + .github/workflows/ms.authorization.locks.yml | 1 + .github/workflows/ms.authorization.policyassignments.yml | 1 + .github/workflows/ms.authorization.policydefinitions.yml | 1 + .github/workflows/ms.authorization.policyexemptions.yml | 1 + .../workflows/ms.authorization.policysetdefinitions.yml | 1 + .github/workflows/ms.authorization.roleassignments.yml | 1 + .github/workflows/ms.authorization.roledefinitions.yml | 1 + .github/workflows/ms.automation.automationaccounts.yml | 1 + .github/workflows/ms.batch.batchaccounts.yml | 1 + .github/workflows/ms.cache.redis.yml | 1 + .github/workflows/ms.cognitiveservices.accounts.yml | 1 + .github/workflows/ms.compute.availabilitysets.yml | 1 + .github/workflows/ms.compute.diskencryptionsets.yml | 1 + .github/workflows/ms.compute.disks.yml | 1 + .github/workflows/ms.compute.galleries.yml | 1 + .github/workflows/ms.compute.images.yml | 1 + .github/workflows/ms.compute.proximityplacementgroups.yml | 1 + .github/workflows/ms.compute.virtualmachines.yml | 1 + .github/workflows/ms.compute.virtualmachinescalesets.yml | 1 + .github/workflows/ms.consumption.budgets.yml | 1 + .../workflows/ms.containerinstance.containergroups.yml | 1 + .github/workflows/ms.containerregistry.registries.yml | 1 + .github/workflows/ms.containerservice.managedclusters.yml | 1 + .github/workflows/ms.databricks.workspaces.yml | 1 + .github/workflows/ms.datafactory.factories.yml | 1 + .github/workflows/ms.dataprotection.backupvaults.yml | 1 + .github/workflows/ms.dbforpostgresql.flexibleservers.yml | 1 + .../ms.desktopvirtualization.applicationgroups.yml | 1 + .github/workflows/ms.desktopvirtualization.hostpools.yml | 1 + .../workflows/ms.desktopvirtualization.scalingplans.yml | 1 + .github/workflows/ms.desktopvirtualization.workspaces.yml | 1 + .github/workflows/ms.documentdb.databaseaccounts.yml | 1 + .github/workflows/ms.eventgrid.systemtopics.yml | 1 + .github/workflows/ms.eventgrid.topics.yml | 1 + .github/workflows/ms.eventhub.namespaces.yml | 1 + .github/workflows/ms.healthbot.healthbots.yml | 1 + .github/workflows/ms.insights.actiongroups.yml | 1 + .github/workflows/ms.insights.activitylogalerts.yml | 1 + .github/workflows/ms.insights.components.yml | 1 + .github/workflows/ms.insights.diagnosticsettings.yml | 1 + .github/workflows/ms.insights.metricalerts.yml | 1 + .github/workflows/ms.insights.privatelinkscopes.yml | 1 + .github/workflows/ms.insights.scheduledqueryrules.yml | 1 + .github/workflows/ms.keyvault.vaults.yml | 1 + .../workflows/ms.kubernetesconfiguration.extensions.yml | 1 + .../ms.kubernetesconfiguration.fluxconfigurations.yml | 1 + .github/workflows/ms.logic.workflows.yml | 1 + .../workflows/ms.machinelearningservices.workspaces.yml | 1 + .../ms.maintenance.maintenanceconfigurations.yml | 1 + .../ms.managedidentity.userassignedidentities.yml | 1 + .../ms.managedservices.registrationdefinitions.yml | 1 + .github/workflows/ms.management.managementgroups.yml | 1 + .github/workflows/ms.netapp.netappaccounts.yml | 1 + .github/workflows/ms.network.applicationgateways.yml | 1 + ...k.applicationgatewaywebapplicationfirewallpolicies.yml | 1 + .../workflows/ms.network.applicationsecuritygroups.yml | 1 + .github/workflows/ms.network.azurefirewalls.yml | 1 + .github/workflows/ms.network.bastionhosts.yml | 1 + .github/workflows/ms.network.connections.yml | 1 + .github/workflows/ms.network.ddosprotectionplans.yml | 1 + .github/workflows/ms.network.dnsresolvers.yml | 1 + .github/workflows/ms.network.expressroutecircuits.yml | 1 + .github/workflows/ms.network.firewallpolicies.yml | 1 + .github/workflows/ms.network.frontdoors.yml | 1 + .github/workflows/ms.network.ipgroups.yml | 1 + .github/workflows/ms.network.loadbalancers.yml | 1 + .github/workflows/ms.network.localnetworkgateways.yml | 1 + .github/workflows/ms.network.natgateways.yml | 1 + .github/workflows/ms.network.networkinterfaces.yml | 1 + .github/workflows/ms.network.networksecuritygroups.yml | 1 + .github/workflows/ms.network.networkwatchers.yml | 1 + .github/workflows/ms.network.privatednszones.yml | 1 + .github/workflows/ms.network.privateendpoints.yml | 1 + .github/workflows/ms.network.privatelinkservices.yml | 1 + .github/workflows/ms.network.publicipaddresses.yml | 1 + .github/workflows/ms.network.publicipprefixes.yml | 1 + .github/workflows/ms.network.routetables.yml | 1 + .github/workflows/ms.network.trafficmanagerprofiles.yml | 1 + .github/workflows/ms.network.virtualhubs.yml | 1 + .github/workflows/ms.network.virtualnetworkgateways.yml | 1 + .github/workflows/ms.network.virtualnetworks.yml | 1 + .github/workflows/ms.network.virtualwans.yml | 1 + .github/workflows/ms.network.vpngateways.yml | 1 + .github/workflows/ms.network.vpnsites.yml | 1 + .github/workflows/ms.operationalinsights.workspaces.yml | 1 + .github/workflows/ms.operationsmanagement.solutions.yml | 1 + .github/workflows/ms.powerbidedicated.capacities.yml | 1 + .github/workflows/ms.recoveryservices.vaults.yml | 1 + .github/workflows/ms.resources.deploymentscripts.yml | 1 + .github/workflows/ms.resources.resourcegroups.yml | 1 + .github/workflows/ms.resources.tags.yml | 1 + .github/workflows/ms.security.azuresecuritycenter.yml | 1 + .github/workflows/ms.servicebus.namespaces.yml | 1 + .github/workflows/ms.servicefabric.clusters.yml | 1 + .github/workflows/ms.signalrservice.webpubsub.yml | 1 + .github/workflows/ms.sql.managedinstances.yml | 1 + .github/workflows/ms.sql.servers.yml | 1 + .github/workflows/ms.storage.storageaccounts.yml | 1 + .github/workflows/ms.synapse.privatelinkhubs.yml | 1 + .github/workflows/ms.synapse.workspaces.yml | 1 + .../workflows/ms.virtualmachineimages.imagetemplates.yml | 1 + .github/workflows/ms.web.connections.yml | 1 + .github/workflows/ms.web.hostingenvironments.yml | 1 + .github/workflows/ms.web.serverfarms.yml | 1 + .github/workflows/ms.web.sites.yml | 1 + .github/workflows/ms.web.staticsites.yml | 1 + 112 files changed, 120 insertions(+), 2 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 2ecbf57d95..21d9c16215 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -143,6 +143,7 @@ jobs: ################################ $functionInput = @{ TemplateFilePath = $TemplateFilePath + PublishLatest = $false # Not supported by Azure DevOps feeds } Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose @@ -229,6 +230,7 @@ jobs: ################################ $functionInput = @{ TemplateFilePath = $TemplateFilePath + PublishLatest = $(publishLatest) } Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose @@ -316,7 +318,7 @@ jobs: ################################ $functionInput = @{ TemplateFilePath = $TemplateFilePath - publishLatest = $(publishLatest) + PublishLatest = $(publishLatest) } Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index cdc5b0010a..c7e99b3e36 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -24,6 +24,7 @@ ## | bicepRegistryRgName | false | '' | Required to publish to private bicep registry. Name of the container registry resource group | 'artifacts-rg' | ## | bicepRegistryRgLocation | false | '' | Required to publish to private bicep registry. Location of the container registry resource group | 'WestEurope' | ## | bicepRegistryDoPublish | false | 'false' | Flag to indicate whether or not to publish to the private bicep registry | 'true' | +## | publishLatest | false | 'true' | Flag to indicate whether or not to publish a "latest" version | 'true' | ## |===========================================================================================================================================================================================================| ## ##---------------------------------------------## @@ -60,6 +61,10 @@ inputs: description: 'Flag to indicate whether or not to publish to the private bicep registry' default: 'false' required: false + publishLatest: + description: 'Flag to indicate whether or not to publish a "latest" version' + default: 'true' + required: false runs: using: 'composite' @@ -110,6 +115,7 @@ runs: ################################ $functionInput = @{ TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" + PublishLatest = "${{ inputs.publishLatest }}" } Write-Verbose "Invoke task with" -Verbose @@ -182,7 +188,7 @@ runs: ################################ $functionInput = @{ TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" - publishLatest = $(publishLatest) + publishLatest = "${{ inputs.publishLatest }}" } Write-Verbose "Invoke task with" -Verbose diff --git a/.github/workflows/ms.aad.domainservices.yml b/.github/workflows/ms.aad.domainservices.yml index 3e109eef4f..7ffd3ee010 100644 --- a/.github/workflows/ms.aad.domainservices.yml +++ b/.github/workflows/ms.aad.domainservices.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.analysisservices.servers.yml b/.github/workflows/ms.analysisservices.servers.yml index 5f0e3e938f..cadf4b2b95 100644 --- a/.github/workflows/ms.analysisservices.servers.yml +++ b/.github/workflows/ms.analysisservices.servers.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.apimanagement.service.yml b/.github/workflows/ms.apimanagement.service.yml index 49deccc92f..9faad847a1 100644 --- a/.github/workflows/ms.apimanagement.service.yml +++ b/.github/workflows/ms.apimanagement.service.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.appconfiguration.configurationstores.yml b/.github/workflows/ms.appconfiguration.configurationstores.yml index 5600f234a7..202b803560 100644 --- a/.github/workflows/ms.appconfiguration.configurationstores.yml +++ b/.github/workflows/ms.appconfiguration.configurationstores.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.authorization.locks.yml b/.github/workflows/ms.authorization.locks.yml index f06cc96c03..7327fc7512 100644 --- a/.github/workflows/ms.authorization.locks.yml +++ b/.github/workflows/ms.authorization.locks.yml @@ -145,3 +145,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.authorization.policyassignments.yml b/.github/workflows/ms.authorization.policyassignments.yml index 3e05978920..979cbb2b9d 100644 --- a/.github/workflows/ms.authorization.policyassignments.yml +++ b/.github/workflows/ms.authorization.policyassignments.yml @@ -145,3 +145,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.authorization.policydefinitions.yml b/.github/workflows/ms.authorization.policydefinitions.yml index effae68e12..27f121958f 100644 --- a/.github/workflows/ms.authorization.policydefinitions.yml +++ b/.github/workflows/ms.authorization.policydefinitions.yml @@ -145,3 +145,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.authorization.policyexemptions.yml b/.github/workflows/ms.authorization.policyexemptions.yml index 75faf02827..40e73e5ecb 100644 --- a/.github/workflows/ms.authorization.policyexemptions.yml +++ b/.github/workflows/ms.authorization.policyexemptions.yml @@ -145,3 +145,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.authorization.policysetdefinitions.yml b/.github/workflows/ms.authorization.policysetdefinitions.yml index a45ebd47b5..9e0f378863 100644 --- a/.github/workflows/ms.authorization.policysetdefinitions.yml +++ b/.github/workflows/ms.authorization.policysetdefinitions.yml @@ -145,3 +145,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.authorization.roleassignments.yml b/.github/workflows/ms.authorization.roleassignments.yml index 4489a5e568..37dc432999 100644 --- a/.github/workflows/ms.authorization.roleassignments.yml +++ b/.github/workflows/ms.authorization.roleassignments.yml @@ -145,3 +145,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.authorization.roledefinitions.yml b/.github/workflows/ms.authorization.roledefinitions.yml index c2c011c9e5..dec3ec4295 100644 --- a/.github/workflows/ms.authorization.roledefinitions.yml +++ b/.github/workflows/ms.authorization.roledefinitions.yml @@ -145,3 +145,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.automation.automationaccounts.yml b/.github/workflows/ms.automation.automationaccounts.yml index 5bec3a8d65..2d9a8dafa7 100644 --- a/.github/workflows/ms.automation.automationaccounts.yml +++ b/.github/workflows/ms.automation.automationaccounts.yml @@ -143,3 +143,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.batch.batchaccounts.yml b/.github/workflows/ms.batch.batchaccounts.yml index a571e10aab..17af34b2a0 100644 --- a/.github/workflows/ms.batch.batchaccounts.yml +++ b/.github/workflows/ms.batch.batchaccounts.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.cache.redis.yml b/.github/workflows/ms.cache.redis.yml index 8484b1d7c6..c2e976f229 100644 --- a/.github/workflows/ms.cache.redis.yml +++ b/.github/workflows/ms.cache.redis.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.cognitiveservices.accounts.yml b/.github/workflows/ms.cognitiveservices.accounts.yml index 7c640f21f2..042b27199e 100644 --- a/.github/workflows/ms.cognitiveservices.accounts.yml +++ b/.github/workflows/ms.cognitiveservices.accounts.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.compute.availabilitysets.yml b/.github/workflows/ms.compute.availabilitysets.yml index 34347371fd..3a5f9e1aba 100644 --- a/.github/workflows/ms.compute.availabilitysets.yml +++ b/.github/workflows/ms.compute.availabilitysets.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.compute.diskencryptionsets.yml b/.github/workflows/ms.compute.diskencryptionsets.yml index 832325648f..4202c5e66b 100644 --- a/.github/workflows/ms.compute.diskencryptionsets.yml +++ b/.github/workflows/ms.compute.diskencryptionsets.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.compute.disks.yml b/.github/workflows/ms.compute.disks.yml index 419a5cefa4..722edcb9ac 100644 --- a/.github/workflows/ms.compute.disks.yml +++ b/.github/workflows/ms.compute.disks.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.compute.galleries.yml b/.github/workflows/ms.compute.galleries.yml index 5b226ec69a..db098513f3 100644 --- a/.github/workflows/ms.compute.galleries.yml +++ b/.github/workflows/ms.compute.galleries.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.compute.images.yml b/.github/workflows/ms.compute.images.yml index 2ae640acdf..20df8cca63 100644 --- a/.github/workflows/ms.compute.images.yml +++ b/.github/workflows/ms.compute.images.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.compute.proximityplacementgroups.yml b/.github/workflows/ms.compute.proximityplacementgroups.yml index 9beecdb1c7..b92ecd24f4 100644 --- a/.github/workflows/ms.compute.proximityplacementgroups.yml +++ b/.github/workflows/ms.compute.proximityplacementgroups.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.compute.virtualmachines.yml b/.github/workflows/ms.compute.virtualmachines.yml index abeb3c24c8..b3b038f421 100644 --- a/.github/workflows/ms.compute.virtualmachines.yml +++ b/.github/workflows/ms.compute.virtualmachines.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.compute.virtualmachinescalesets.yml b/.github/workflows/ms.compute.virtualmachinescalesets.yml index aa6cbeebb2..c5e5282c32 100644 --- a/.github/workflows/ms.compute.virtualmachinescalesets.yml +++ b/.github/workflows/ms.compute.virtualmachinescalesets.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.consumption.budgets.yml b/.github/workflows/ms.consumption.budgets.yml index aab58a18db..0b25528451 100644 --- a/.github/workflows/ms.consumption.budgets.yml +++ b/.github/workflows/ms.consumption.budgets.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.containerinstance.containergroups.yml b/.github/workflows/ms.containerinstance.containergroups.yml index b9afe4ce23..c91dfe0035 100644 --- a/.github/workflows/ms.containerinstance.containergroups.yml +++ b/.github/workflows/ms.containerinstance.containergroups.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.containerregistry.registries.yml b/.github/workflows/ms.containerregistry.registries.yml index 1ee6d1083b..42f1eefe60 100644 --- a/.github/workflows/ms.containerregistry.registries.yml +++ b/.github/workflows/ms.containerregistry.registries.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.containerservice.managedclusters.yml b/.github/workflows/ms.containerservice.managedclusters.yml index 688c5112dc..5786a29d04 100644 --- a/.github/workflows/ms.containerservice.managedclusters.yml +++ b/.github/workflows/ms.containerservice.managedclusters.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.databricks.workspaces.yml b/.github/workflows/ms.databricks.workspaces.yml index 8bc365dda0..8cd192f29a 100644 --- a/.github/workflows/ms.databricks.workspaces.yml +++ b/.github/workflows/ms.databricks.workspaces.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.datafactory.factories.yml b/.github/workflows/ms.datafactory.factories.yml index c9caee3d99..c0825d7773 100644 --- a/.github/workflows/ms.datafactory.factories.yml +++ b/.github/workflows/ms.datafactory.factories.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.dataprotection.backupvaults.yml b/.github/workflows/ms.dataprotection.backupvaults.yml index 040889f8e9..946f8fd4c2 100644 --- a/.github/workflows/ms.dataprotection.backupvaults.yml +++ b/.github/workflows/ms.dataprotection.backupvaults.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.dbforpostgresql.flexibleservers.yml b/.github/workflows/ms.dbforpostgresql.flexibleservers.yml index cc50de7666..4a670b2101 100644 --- a/.github/workflows/ms.dbforpostgresql.flexibleservers.yml +++ b/.github/workflows/ms.dbforpostgresql.flexibleservers.yml @@ -145,3 +145,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.desktopvirtualization.applicationgroups.yml b/.github/workflows/ms.desktopvirtualization.applicationgroups.yml index 435ac229a5..b96b27f5e9 100644 --- a/.github/workflows/ms.desktopvirtualization.applicationgroups.yml +++ b/.github/workflows/ms.desktopvirtualization.applicationgroups.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.desktopvirtualization.hostpools.yml b/.github/workflows/ms.desktopvirtualization.hostpools.yml index 1dc4208f61..7278faf015 100644 --- a/.github/workflows/ms.desktopvirtualization.hostpools.yml +++ b/.github/workflows/ms.desktopvirtualization.hostpools.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.desktopvirtualization.scalingplans.yml b/.github/workflows/ms.desktopvirtualization.scalingplans.yml index 987eff06b9..ea847d050f 100644 --- a/.github/workflows/ms.desktopvirtualization.scalingplans.yml +++ b/.github/workflows/ms.desktopvirtualization.scalingplans.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.desktopvirtualization.workspaces.yml b/.github/workflows/ms.desktopvirtualization.workspaces.yml index e7c0adc5b9..1e104cc501 100644 --- a/.github/workflows/ms.desktopvirtualization.workspaces.yml +++ b/.github/workflows/ms.desktopvirtualization.workspaces.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.documentdb.databaseaccounts.yml b/.github/workflows/ms.documentdb.databaseaccounts.yml index 47198f73b2..6ea1a64d4a 100644 --- a/.github/workflows/ms.documentdb.databaseaccounts.yml +++ b/.github/workflows/ms.documentdb.databaseaccounts.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.eventgrid.systemtopics.yml b/.github/workflows/ms.eventgrid.systemtopics.yml index c6df6c0219..2715aabdcc 100644 --- a/.github/workflows/ms.eventgrid.systemtopics.yml +++ b/.github/workflows/ms.eventgrid.systemtopics.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.eventgrid.topics.yml b/.github/workflows/ms.eventgrid.topics.yml index b4a64c00d1..421d35fba8 100644 --- a/.github/workflows/ms.eventgrid.topics.yml +++ b/.github/workflows/ms.eventgrid.topics.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.eventhub.namespaces.yml b/.github/workflows/ms.eventhub.namespaces.yml index 9d97dd88ad..2532b4a8b8 100644 --- a/.github/workflows/ms.eventhub.namespaces.yml +++ b/.github/workflows/ms.eventhub.namespaces.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.healthbot.healthbots.yml b/.github/workflows/ms.healthbot.healthbots.yml index 3a2beb6987..54deb90b30 100644 --- a/.github/workflows/ms.healthbot.healthbots.yml +++ b/.github/workflows/ms.healthbot.healthbots.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.insights.actiongroups.yml b/.github/workflows/ms.insights.actiongroups.yml index c57116bc17..72ff4014aa 100644 --- a/.github/workflows/ms.insights.actiongroups.yml +++ b/.github/workflows/ms.insights.actiongroups.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.insights.activitylogalerts.yml b/.github/workflows/ms.insights.activitylogalerts.yml index 95b97a60b2..373aef4da7 100644 --- a/.github/workflows/ms.insights.activitylogalerts.yml +++ b/.github/workflows/ms.insights.activitylogalerts.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.insights.components.yml b/.github/workflows/ms.insights.components.yml index a1f2770cbd..0173282187 100644 --- a/.github/workflows/ms.insights.components.yml +++ b/.github/workflows/ms.insights.components.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.insights.diagnosticsettings.yml b/.github/workflows/ms.insights.diagnosticsettings.yml index d5c27eed25..ca44d6f529 100644 --- a/.github/workflows/ms.insights.diagnosticsettings.yml +++ b/.github/workflows/ms.insights.diagnosticsettings.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.insights.metricalerts.yml b/.github/workflows/ms.insights.metricalerts.yml index 23d2cc3949..b9811e83bb 100644 --- a/.github/workflows/ms.insights.metricalerts.yml +++ b/.github/workflows/ms.insights.metricalerts.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.insights.privatelinkscopes.yml b/.github/workflows/ms.insights.privatelinkscopes.yml index 91c2166506..3c765ea3a8 100644 --- a/.github/workflows/ms.insights.privatelinkscopes.yml +++ b/.github/workflows/ms.insights.privatelinkscopes.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.insights.scheduledqueryrules.yml b/.github/workflows/ms.insights.scheduledqueryrules.yml index 1743abdfc6..0205e2447e 100644 --- a/.github/workflows/ms.insights.scheduledqueryrules.yml +++ b/.github/workflows/ms.insights.scheduledqueryrules.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.keyvault.vaults.yml b/.github/workflows/ms.keyvault.vaults.yml index 5a6e1d5119..94a0c52b1c 100644 --- a/.github/workflows/ms.keyvault.vaults.yml +++ b/.github/workflows/ms.keyvault.vaults.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.kubernetesconfiguration.extensions.yml b/.github/workflows/ms.kubernetesconfiguration.extensions.yml index 94d1f6d199..30f4660e06 100644 --- a/.github/workflows/ms.kubernetesconfiguration.extensions.yml +++ b/.github/workflows/ms.kubernetesconfiguration.extensions.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml b/.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml index e77b0cb8e8..6dbb579edd 100644 --- a/.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml +++ b/.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.logic.workflows.yml b/.github/workflows/ms.logic.workflows.yml index a8c08c57b8..6ff7bdf6e0 100644 --- a/.github/workflows/ms.logic.workflows.yml +++ b/.github/workflows/ms.logic.workflows.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.machinelearningservices.workspaces.yml b/.github/workflows/ms.machinelearningservices.workspaces.yml index 1c8037101d..0abde75c41 100644 --- a/.github/workflows/ms.machinelearningservices.workspaces.yml +++ b/.github/workflows/ms.machinelearningservices.workspaces.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.maintenance.maintenanceconfigurations.yml b/.github/workflows/ms.maintenance.maintenanceconfigurations.yml index 447af7c253..da2b23fd24 100644 --- a/.github/workflows/ms.maintenance.maintenanceconfigurations.yml +++ b/.github/workflows/ms.maintenance.maintenanceconfigurations.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.managedidentity.userassignedidentities.yml b/.github/workflows/ms.managedidentity.userassignedidentities.yml index 4db4c5729e..6edbcac898 100644 --- a/.github/workflows/ms.managedidentity.userassignedidentities.yml +++ b/.github/workflows/ms.managedidentity.userassignedidentities.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.managedservices.registrationdefinitions.yml b/.github/workflows/ms.managedservices.registrationdefinitions.yml index 3314b0947f..4f919a3e05 100644 --- a/.github/workflows/ms.managedservices.registrationdefinitions.yml +++ b/.github/workflows/ms.managedservices.registrationdefinitions.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.management.managementgroups.yml b/.github/workflows/ms.management.managementgroups.yml index 615818613e..8ee2184357 100644 --- a/.github/workflows/ms.management.managementgroups.yml +++ b/.github/workflows/ms.management.managementgroups.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.netapp.netappaccounts.yml b/.github/workflows/ms.netapp.netappaccounts.yml index d3024b6883..f6e86bfcb6 100644 --- a/.github/workflows/ms.netapp.netappaccounts.yml +++ b/.github/workflows/ms.netapp.netappaccounts.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.applicationgateways.yml b/.github/workflows/ms.network.applicationgateways.yml index 990555ceb5..45f5ac6d03 100644 --- a/.github/workflows/ms.network.applicationgateways.yml +++ b/.github/workflows/ms.network.applicationgateways.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.applicationgatewaywebapplicationfirewallpolicies.yml b/.github/workflows/ms.network.applicationgatewaywebapplicationfirewallpolicies.yml index 5cefea57af..bdb8eaa718 100644 --- a/.github/workflows/ms.network.applicationgatewaywebapplicationfirewallpolicies.yml +++ b/.github/workflows/ms.network.applicationgatewaywebapplicationfirewallpolicies.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.applicationsecuritygroups.yml b/.github/workflows/ms.network.applicationsecuritygroups.yml index 102815b3dd..2f58211536 100644 --- a/.github/workflows/ms.network.applicationsecuritygroups.yml +++ b/.github/workflows/ms.network.applicationsecuritygroups.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.azurefirewalls.yml b/.github/workflows/ms.network.azurefirewalls.yml index a680876063..e012367603 100644 --- a/.github/workflows/ms.network.azurefirewalls.yml +++ b/.github/workflows/ms.network.azurefirewalls.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.bastionhosts.yml b/.github/workflows/ms.network.bastionhosts.yml index 3695389555..166b859289 100644 --- a/.github/workflows/ms.network.bastionhosts.yml +++ b/.github/workflows/ms.network.bastionhosts.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.connections.yml b/.github/workflows/ms.network.connections.yml index 6febce4686..5357a7037e 100644 --- a/.github/workflows/ms.network.connections.yml +++ b/.github/workflows/ms.network.connections.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.ddosprotectionplans.yml b/.github/workflows/ms.network.ddosprotectionplans.yml index 0b2070ff47..ac3f3a4410 100644 --- a/.github/workflows/ms.network.ddosprotectionplans.yml +++ b/.github/workflows/ms.network.ddosprotectionplans.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.dnsresolvers.yml b/.github/workflows/ms.network.dnsresolvers.yml index 381d50f7cf..8fcdcce9e0 100644 --- a/.github/workflows/ms.network.dnsresolvers.yml +++ b/.github/workflows/ms.network.dnsresolvers.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.expressroutecircuits.yml b/.github/workflows/ms.network.expressroutecircuits.yml index 727a352c23..94bf9bb341 100644 --- a/.github/workflows/ms.network.expressroutecircuits.yml +++ b/.github/workflows/ms.network.expressroutecircuits.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.firewallpolicies.yml b/.github/workflows/ms.network.firewallpolicies.yml index 2ddf7e3778..448a4ed256 100644 --- a/.github/workflows/ms.network.firewallpolicies.yml +++ b/.github/workflows/ms.network.firewallpolicies.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.frontdoors.yml b/.github/workflows/ms.network.frontdoors.yml index 7fe3287ea4..a7a6793aa7 100644 --- a/.github/workflows/ms.network.frontdoors.yml +++ b/.github/workflows/ms.network.frontdoors.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.ipgroups.yml b/.github/workflows/ms.network.ipgroups.yml index d45221dfae..a5bed703a8 100644 --- a/.github/workflows/ms.network.ipgroups.yml +++ b/.github/workflows/ms.network.ipgroups.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.loadbalancers.yml b/.github/workflows/ms.network.loadbalancers.yml index f6079215ab..5110a773ad 100644 --- a/.github/workflows/ms.network.loadbalancers.yml +++ b/.github/workflows/ms.network.loadbalancers.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.localnetworkgateways.yml b/.github/workflows/ms.network.localnetworkgateways.yml index c95aae4636..9a89bb9bec 100644 --- a/.github/workflows/ms.network.localnetworkgateways.yml +++ b/.github/workflows/ms.network.localnetworkgateways.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.natgateways.yml b/.github/workflows/ms.network.natgateways.yml index 6545e9b2bb..14e1585e4e 100644 --- a/.github/workflows/ms.network.natgateways.yml +++ b/.github/workflows/ms.network.natgateways.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.networkinterfaces.yml b/.github/workflows/ms.network.networkinterfaces.yml index d7c5cd4a0f..59af654a23 100644 --- a/.github/workflows/ms.network.networkinterfaces.yml +++ b/.github/workflows/ms.network.networkinterfaces.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.networksecuritygroups.yml b/.github/workflows/ms.network.networksecuritygroups.yml index 564c561904..8a9338ef93 100644 --- a/.github/workflows/ms.network.networksecuritygroups.yml +++ b/.github/workflows/ms.network.networksecuritygroups.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.networkwatchers.yml b/.github/workflows/ms.network.networkwatchers.yml index 6bec969ffd..6d0ed2a146 100644 --- a/.github/workflows/ms.network.networkwatchers.yml +++ b/.github/workflows/ms.network.networkwatchers.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.privatednszones.yml b/.github/workflows/ms.network.privatednszones.yml index ad7dce9db7..da013a45cf 100644 --- a/.github/workflows/ms.network.privatednszones.yml +++ b/.github/workflows/ms.network.privatednszones.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.privateendpoints.yml b/.github/workflows/ms.network.privateendpoints.yml index d5a862eb0c..f5ae3c27da 100644 --- a/.github/workflows/ms.network.privateendpoints.yml +++ b/.github/workflows/ms.network.privateendpoints.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.privatelinkservices.yml b/.github/workflows/ms.network.privatelinkservices.yml index 36a3ef248b..9ba978d94f 100644 --- a/.github/workflows/ms.network.privatelinkservices.yml +++ b/.github/workflows/ms.network.privatelinkservices.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.publicipaddresses.yml b/.github/workflows/ms.network.publicipaddresses.yml index df4f28275e..f7603118d1 100644 --- a/.github/workflows/ms.network.publicipaddresses.yml +++ b/.github/workflows/ms.network.publicipaddresses.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.publicipprefixes.yml b/.github/workflows/ms.network.publicipprefixes.yml index 6c1f81bf81..bd548759a9 100644 --- a/.github/workflows/ms.network.publicipprefixes.yml +++ b/.github/workflows/ms.network.publicipprefixes.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.routetables.yml b/.github/workflows/ms.network.routetables.yml index 72373b2633..5862ba6975 100644 --- a/.github/workflows/ms.network.routetables.yml +++ b/.github/workflows/ms.network.routetables.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.trafficmanagerprofiles.yml b/.github/workflows/ms.network.trafficmanagerprofiles.yml index 58a631acd5..2a0fd3a372 100644 --- a/.github/workflows/ms.network.trafficmanagerprofiles.yml +++ b/.github/workflows/ms.network.trafficmanagerprofiles.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.virtualhubs.yml b/.github/workflows/ms.network.virtualhubs.yml index 237d184892..ec49430d6d 100644 --- a/.github/workflows/ms.network.virtualhubs.yml +++ b/.github/workflows/ms.network.virtualhubs.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.virtualnetworkgateways.yml b/.github/workflows/ms.network.virtualnetworkgateways.yml index 5dcbb4735c..edbb3105ab 100644 --- a/.github/workflows/ms.network.virtualnetworkgateways.yml +++ b/.github/workflows/ms.network.virtualnetworkgateways.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.virtualnetworks.yml b/.github/workflows/ms.network.virtualnetworks.yml index e7d3a865fd..125978ff80 100644 --- a/.github/workflows/ms.network.virtualnetworks.yml +++ b/.github/workflows/ms.network.virtualnetworks.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.virtualwans.yml b/.github/workflows/ms.network.virtualwans.yml index 976d9a7567..9f435e8c4d 100644 --- a/.github/workflows/ms.network.virtualwans.yml +++ b/.github/workflows/ms.network.virtualwans.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.vpngateways.yml b/.github/workflows/ms.network.vpngateways.yml index 5f4693756b..d14cf36138 100644 --- a/.github/workflows/ms.network.vpngateways.yml +++ b/.github/workflows/ms.network.vpngateways.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.network.vpnsites.yml b/.github/workflows/ms.network.vpnsites.yml index 23e2cb6628..6c22e97c24 100644 --- a/.github/workflows/ms.network.vpnsites.yml +++ b/.github/workflows/ms.network.vpnsites.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.operationalinsights.workspaces.yml b/.github/workflows/ms.operationalinsights.workspaces.yml index 095e87297c..c571a60129 100644 --- a/.github/workflows/ms.operationalinsights.workspaces.yml +++ b/.github/workflows/ms.operationalinsights.workspaces.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.operationsmanagement.solutions.yml b/.github/workflows/ms.operationsmanagement.solutions.yml index 9caded5446..2699bd8fec 100644 --- a/.github/workflows/ms.operationsmanagement.solutions.yml +++ b/.github/workflows/ms.operationsmanagement.solutions.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.powerbidedicated.capacities.yml b/.github/workflows/ms.powerbidedicated.capacities.yml index 7db1068ea5..952dfadabe 100644 --- a/.github/workflows/ms.powerbidedicated.capacities.yml +++ b/.github/workflows/ms.powerbidedicated.capacities.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.recoveryservices.vaults.yml b/.github/workflows/ms.recoveryservices.vaults.yml index de9de27fc7..470941a44d 100644 --- a/.github/workflows/ms.recoveryservices.vaults.yml +++ b/.github/workflows/ms.recoveryservices.vaults.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.resources.deploymentscripts.yml b/.github/workflows/ms.resources.deploymentscripts.yml index 861b5acd88..7ca7d54fd9 100644 --- a/.github/workflows/ms.resources.deploymentscripts.yml +++ b/.github/workflows/ms.resources.deploymentscripts.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.resources.resourcegroups.yml b/.github/workflows/ms.resources.resourcegroups.yml index 5fcc6b0996..44fd4011f5 100644 --- a/.github/workflows/ms.resources.resourcegroups.yml +++ b/.github/workflows/ms.resources.resourcegroups.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.resources.tags.yml b/.github/workflows/ms.resources.tags.yml index 4ab720c3bb..69188f0ca0 100644 --- a/.github/workflows/ms.resources.tags.yml +++ b/.github/workflows/ms.resources.tags.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.security.azuresecuritycenter.yml b/.github/workflows/ms.security.azuresecuritycenter.yml index e1c6dab1c9..fa806b363a 100644 --- a/.github/workflows/ms.security.azuresecuritycenter.yml +++ b/.github/workflows/ms.security.azuresecuritycenter.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.servicebus.namespaces.yml b/.github/workflows/ms.servicebus.namespaces.yml index 3ffa4e3b3a..2de5a375b8 100644 --- a/.github/workflows/ms.servicebus.namespaces.yml +++ b/.github/workflows/ms.servicebus.namespaces.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.servicefabric.clusters.yml b/.github/workflows/ms.servicefabric.clusters.yml index 0c899c587c..9c3953483e 100644 --- a/.github/workflows/ms.servicefabric.clusters.yml +++ b/.github/workflows/ms.servicefabric.clusters.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.signalrservice.webpubsub.yml b/.github/workflows/ms.signalrservice.webpubsub.yml index 29f0d7aa31..a006d45d9a 100644 --- a/.github/workflows/ms.signalrservice.webpubsub.yml +++ b/.github/workflows/ms.signalrservice.webpubsub.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.sql.managedinstances.yml b/.github/workflows/ms.sql.managedinstances.yml index c8abdd090b..1e66ff46e4 100644 --- a/.github/workflows/ms.sql.managedinstances.yml +++ b/.github/workflows/ms.sql.managedinstances.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.sql.servers.yml b/.github/workflows/ms.sql.servers.yml index 85a3f2e5c9..2eaacbcb7d 100644 --- a/.github/workflows/ms.sql.servers.yml +++ b/.github/workflows/ms.sql.servers.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.storage.storageaccounts.yml b/.github/workflows/ms.storage.storageaccounts.yml index d8d22d2881..6b13836285 100644 --- a/.github/workflows/ms.storage.storageaccounts.yml +++ b/.github/workflows/ms.storage.storageaccounts.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.synapse.privatelinkhubs.yml b/.github/workflows/ms.synapse.privatelinkhubs.yml index a9d9567572..089f3484e9 100644 --- a/.github/workflows/ms.synapse.privatelinkhubs.yml +++ b/.github/workflows/ms.synapse.privatelinkhubs.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.synapse.workspaces.yml b/.github/workflows/ms.synapse.workspaces.yml index c040c0a985..8428b1d4b6 100644 --- a/.github/workflows/ms.synapse.workspaces.yml +++ b/.github/workflows/ms.synapse.workspaces.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.virtualmachineimages.imagetemplates.yml b/.github/workflows/ms.virtualmachineimages.imagetemplates.yml index ce2bb25f42..8e701b6599 100644 --- a/.github/workflows/ms.virtualmachineimages.imagetemplates.yml +++ b/.github/workflows/ms.virtualmachineimages.imagetemplates.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.web.connections.yml b/.github/workflows/ms.web.connections.yml index 0780f32e0d..67247714cb 100644 --- a/.github/workflows/ms.web.connections.yml +++ b/.github/workflows/ms.web.connections.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.web.hostingenvironments.yml b/.github/workflows/ms.web.hostingenvironments.yml index b3060770e8..6e57344ba7 100644 --- a/.github/workflows/ms.web.hostingenvironments.yml +++ b/.github/workflows/ms.web.hostingenvironments.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.web.serverfarms.yml b/.github/workflows/ms.web.serverfarms.yml index ec5a40a789..1fa50230ee 100644 --- a/.github/workflows/ms.web.serverfarms.yml +++ b/.github/workflows/ms.web.serverfarms.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.web.sites.yml b/.github/workflows/ms.web.sites.yml index e4f2984341..81c8b57b02 100644 --- a/.github/workflows/ms.web.sites.yml +++ b/.github/workflows/ms.web.sites.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' diff --git a/.github/workflows/ms.web.staticsites.yml b/.github/workflows/ms.web.staticsites.yml index b8c131f6e9..d09bd3fef1 100644 --- a/.github/workflows/ms.web.staticsites.yml +++ b/.github/workflows/ms.web.staticsites.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' From 199168c0fd06d084a9036b259992bf46b0a15cee Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 11:12:08 +0100 Subject: [PATCH 26/39] Update to latest --- .azuredevops/pipelineTemplates/jobs.publishModule.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 21d9c16215..5f14ace796 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -21,12 +21,13 @@ ## |======================================================================================================================================================================================================================| ## | Parameter | Default Value | Description | Example | ## |---------------------------------|--------------------------------------|---------------------------------------------------------------------------------------------------------|-----------------------------------| -## | displayName | 'Publishing' | Name for the pipeline job | 'Publish KeyVault' | +## | displayName | 'Publishing' | Name for the pipeline job | 'Publish KeyVault' | ## | serviceConnection | '$(serviceConnection)' | The service connection that connects to Azure | 'demo-internal' | ## | poolName | '$(poolName)' | You can provide either a [poolname] or [vmImage] to run the job on | 'Custom Deployment Pool' | ## | vmImage | '$(vmImage)' | You can provide either a [poolname] or [vmImage] to run the job on | 'ubuntu20.04' | ## | defaultJobTimeoutInMinutes | 120 | The timeout for the job in this pipeline | 120 | ## | modulePath | '$(modulePath)' | The path to the module to deploy. E.g. [c:/KeyVault] | 'c:/KeyVault' | +## | publishLatest | '$(publishLatest)' | Flag to indicate whether or not to publish a "latest" version | true | ## | templateSpecsRGName | '$(templateSpecsRGName)' | Required to publish to template spec. ResourceGroup of the template spec to publish to | 'mgmt-rg' | ## | templateSpecsRGLocation | '$(templateSpecsRGLocation)' | Required to publish to template spec. Location of the template spec resource group | 'West Europe' | ## | templateSpecsDescription | '$(templateSpecsDescription)' | Required to publish to template spec. Description of the template spec to publish to | 'IaCs module' | @@ -56,6 +57,9 @@ parameters: ## Module-related modulePath: '$(modulePath)' + # Shared + publishLatest: '$(publishLatest)' + ## TemplateSpec-related templateSpecsDoPublish: '$(templateSpecsDoPublish)' templateSpecsRGName: '$(templateSpecsRGName)' @@ -230,7 +234,7 @@ jobs: ################################ $functionInput = @{ TemplateFilePath = $TemplateFilePath - PublishLatest = $(publishLatest) + PublishLatest = '${{ parameters.publishLatest }}' } Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose @@ -318,7 +322,7 @@ jobs: ################################ $functionInput = @{ TemplateFilePath = $TemplateFilePath - PublishLatest = $(publishLatest) + PublishLatest = '${{ parameters.publishLatest }}' } Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose From 96c7ef43c7d28a74f4c80772cbe560e412ffd8ee Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 11:19:46 +0100 Subject: [PATCH 27/39] Update to latest --- .azuredevops/pipelineTemplates/jobs.publishModule.yml | 4 ++-- .github/actions/templates/publishModule/action.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 5f14ace796..24fde97bf0 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -234,7 +234,7 @@ jobs: ################################ $functionInput = @{ TemplateFilePath = $TemplateFilePath - PublishLatest = '${{ parameters.publishLatest }}' + PublishLatest = [bool] '${{ parameters.publishLatest }}' } Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose @@ -322,7 +322,7 @@ jobs: ################################ $functionInput = @{ TemplateFilePath = $TemplateFilePath - PublishLatest = '${{ parameters.publishLatest }}' + PublishLatest = [bool] '${{ parameters.publishLatest }}' } Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index c7e99b3e36..11e30b9705 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -115,7 +115,7 @@ runs: ################################ $functionInput = @{ TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" - PublishLatest = "${{ inputs.publishLatest }}" + PublishLatest = [bool] "${{ inputs.publishLatest }}" } Write-Verbose "Invoke task with" -Verbose @@ -188,7 +188,7 @@ runs: ################################ $functionInput = @{ TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" - publishLatest = "${{ inputs.publishLatest }}" + publishLatest = [bool] "${{ inputs.publishLatest }}" } Write-Verbose "Invoke task with" -Verbose From c0cbc83aac4156c86ae265f563dc9dddf2d935d2 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 11:28:31 +0100 Subject: [PATCH 28/39] Added output --- .../Get-ModulesMissingFromPrivateBicepRegistry.ps1 | 4 ++++ .../resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 | 4 ++++ .../Get-ModulesMissingFromUniversalArtifactsFeed.ps1 | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 index 0dc383e5b2..ced7494f52 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 @@ -81,6 +81,10 @@ function Get-ModulesMissingFromPrivateBicepRegistry { Write-Verbose ('Missing module [{0}] will be considered for publishing with version [{1}]' -f $modulesToPublish.TemplateFilePath, $modulesToPublish.Version) -Verbose } + if ($moduleToPublish.count -eq 0) { + Write-Verbose 'No modules missing in the target environment' -Verbose + } + return $modulesToPublish } diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 index 61c0c5cb1e..d2e96ebd01 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 @@ -79,6 +79,10 @@ function Get-ModulesMissingFromTemplateSpecsRG { Write-Verbose ('Missing module [{0}] will be considered for publishing with version [{1}]' -f $modulesToPublish.TemplateFilePath, $modulesToPublish.Version) -Verbose } + if ($moduleToPublish.count -eq 0) { + Write-Verbose 'No modules missing in the target environment' -Verbose + } + return $modulesToPublish } diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 index ce47a0c0fc..0f5a44fd9d 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromUniversalArtifactsFeed.ps1 @@ -112,6 +112,10 @@ function Get-ModulesMissingFromUniversalArtifactsFeed { Write-Verbose ('Missing module [{0}] will be considered for publishing with version [{1}]' -f $modulesToPublish.TemplateFilePath, $modulesToPublish.Version) -Verbose } + if ($moduleToPublish.count -eq 0) { + Write-Verbose 'No modules missing in the target environment' -Verbose + } + return $modulesToPublish } From 47dd37e034e0c7b14afb972c1951d16d65a7ecd5 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 11:30:33 +0100 Subject: [PATCH 29/39] Suppressed output --- .azuredevops/pipelineTemplates/jobs.publishModule.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 24fde97bf0..83fd05131a 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -304,7 +304,7 @@ jobs: . $profile # Load PS-Profile configuration $SecuredPassword = ConvertTo-SecureString -AsPlainText -String $env:servicePrincipalKey $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $env:servicePrincipalId, $SecuredPassword - Connect-AzAccount -ServicePrincipal -TenantId $env:tenantId -Credential $Credential + $null = Connect-AzAccount -ServicePrincipal -TenantId $env:tenantId -Credential $Credential # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToPublish.ps1') From e18b4c476dd2ae29e91c904dfa40f2102d555455 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 13:25:15 +0100 Subject: [PATCH 30/39] Update to latest --- ... - Scenario 2 Onboard module library and CI environment.md | 4 ++-- settings.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md b/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md index 6380984277..697d8b4946 100644 --- a/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md +++ b/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md @@ -329,7 +329,7 @@ The primary pipeline settings file ([`settings.yml`](https://github.com/Azure/Re | Variable Name | Example Value | Description | | - | - | - | -| `vstsFeedName` | `'carml-modules'` | The name of the Azure DevOps universal packages feed to publish to. | +| `vstsFeedName` | `'carml'` | The name of the Azure DevOps universal packages feed to publish to. | | `vstsFeedProject` | `'$(System.TeamProject)'` | The project that hosts the feed. The feed must be created in Azure DevOps ahead of time. | | `vstsFeedToken` | `'$(System.AccessToken)'` | The token used to publish universal packages into the feed above. | | `artifactsFeedDoPublish` | `'true'` | A central switch to enable/disable publishing to Universal packages. | @@ -354,7 +354,7 @@ This section will explain what is required to publish the modules to [Azure Arti 1. An Azure DevOps organization and project 1. An Azure DevOps artifacts feed - > **Note:** The default feed name is `carml-modules` as configured in the [`settings.yml`](https://github.com/Azure/ResourceModules/blob/main/settings.yml) file's variable `vstsFeedName`. Update the value here if you want to use a different name, but make sure it matches the name of the artifact feed created in Azure DevOps. + > **Note:** The default feed name is `carml` as configured in the [`settings.yml`](https://github.com/Azure/ResourceModules/blob/main/settings.yml) file's variable `vstsFeedName`. Update the value here if you want to use a different name, but make sure it matches the name of the artifact feed created in Azure DevOps. > > **Note:** It's also very important that the feed's 'Permissions' (Artifact Feed -> Feed settings -> Permissions) are set up so that the project's 'Build Service' has at least the role 'Contributor' to be able to publish artifacts ([ref](https://learn.microsoft.com/en-us/azure/devops/artifacts/feeds/feed-permissions?view=azure-devops#permissions-table)). 1. An Azure DevOps project to host the artifact feed diff --git a/settings.yml b/settings.yml index 15b6e510f3..2b50a57b79 100644 --- a/settings.yml +++ b/settings.yml @@ -90,7 +90,7 @@ variables: ###################################### artifactsFeedDoPublish: true # Set to true, if you would like to publish modules as Universal Packages (in Azure DevOps Artifacts) - vstsFeedName: 'carml-modules' # The name of the Azure DevOps universal packages feed to publish to + vstsFeedName: 'carml' # The name of the Azure DevOps universal packages feed to publish to vstsFeedProject: '$(System.TeamProject)' # The project that hosts the feed vstsFeedToken: $(System.AccessToken) # The token used to publish universal packages into the feed above From 0dd8d3dd59d1a5f0f0b0d8adc7cb576560af1b0c Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 13:38:41 +0100 Subject: [PATCH 31/39] Disabled most of the analysis services pipeline for teting --- .../pipelineTemplates/stages.module.yml | 28 ++--- .../workflows/ms.analysisservices.servers.yml | 106 +++++++++--------- 2 files changed, 67 insertions(+), 67 deletions(-) diff --git a/.azuredevops/pipelineTemplates/stages.module.yml b/.azuredevops/pipelineTemplates/stages.module.yml index b1f435348d..647517a17e 100644 --- a/.azuredevops/pipelineTemplates/stages.module.yml +++ b/.azuredevops/pipelineTemplates/stages.module.yml @@ -5,23 +5,23 @@ parameters: defaultJobTimeoutInMinutes: 120 stages: - # - stage: validation - # displayName: Static validation - # jobs: - # - template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml + - stage: validation + displayName: Static validation + jobs: + - template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml - # - stage: deployment - # displayName: Deployment validation - # jobs: - # - template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml - # parameters: - # templateFilePath: '$(modulePath)/deploy.bicep' - # removeDeployment: '${{ parameters.removeDeployment }}' - # defaultJobTimeoutInMinutes: ${{ parameters.defaultJobTimeoutInMinutes }} + - stage: deployment + displayName: Deployment validation + jobs: + - template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml + parameters: + templateFilePath: '$(modulePath)/deploy.bicep' + removeDeployment: '${{ parameters.removeDeployment }}' + defaultJobTimeoutInMinutes: ${{ parameters.defaultJobTimeoutInMinutes }} - stage: Publishing - # dependsOn: - # - deployment + dependsOn: + - deployment displayName: Publish module condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq('${{ parameters.prerelease }}', 'true'))) jobs: diff --git a/.github/workflows/ms.analysisservices.servers.yml b/.github/workflows/ms.analysisservices.servers.yml index cadf4b2b95..63e477c15f 100644 --- a/.github/workflows/ms.analysisservices.servers.yml +++ b/.github/workflows/ms.analysisservices.servers.yml @@ -60,67 +60,67 @@ jobs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} - ######################### - # Static validation # - ######################### - job_module_pester_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' + # ######################### + # # Static validation # + # ######################### + # job_module_pester_validation: + # runs-on: ubuntu-20.04 + # name: 'Static validation' + # steps: + # - name: 'Checkout' + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # - name: Set environment variables + # uses: ./.github/actions/templates/setEnvironmentVariables + # with: + # variablesPath: ${{ env.variablesPath }} + # - name: 'Run tests' + # uses: ./.github/actions/templates/validateModulePester + # with: + # modulePath: '${{ env.modulePath }}' + # moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deployment validation' - needs: - - job_initialize_pipeline - - job_module_pester_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' + # ############################# + # # Deployment validation # + # ############################# + # job_module_deploy_validation: + # runs-on: ubuntu-20.04 + # name: 'Deployment validation' + # needs: + # - job_initialize_pipeline + # - job_module_pester_validation + # strategy: + # fail-fast: false + # matrix: + # moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} + # steps: + # - name: 'Checkout' + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # - name: Set environment variables + # uses: ./.github/actions/templates/setEnvironmentVariables + # with: + # variablesPath: ${{ env.variablesPath }} + # - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' + # uses: ./.github/actions/templates/validateModuleDeployment + # with: + # templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' + # location: '${{ env.location }}' + # subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' + # managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' + # removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' ################## # Publishing # ################## job_publish_module: name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' + # if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation + # needs: + # - job_module_deploy_validation steps: - name: 'Checkout' uses: actions/checkout@v3 From 9762d84eac4512761b98f52d0eb9d5bf08901c02 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 13:51:06 +0100 Subject: [PATCH 32/39] Undid temp changes --- .../workflows/ms.analysisservices.servers.yml | 106 +++++++++--------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/.github/workflows/ms.analysisservices.servers.yml b/.github/workflows/ms.analysisservices.servers.yml index 63e477c15f..cadf4b2b95 100644 --- a/.github/workflows/ms.analysisservices.servers.yml +++ b/.github/workflows/ms.analysisservices.servers.yml @@ -60,67 +60,67 @@ jobs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} - # ######################### - # # Static validation # - # ######################### - # job_module_pester_validation: - # runs-on: ubuntu-20.04 - # name: 'Static validation' - # steps: - # - name: 'Checkout' - # uses: actions/checkout@v3 - # with: - # fetch-depth: 0 - # - name: Set environment variables - # uses: ./.github/actions/templates/setEnvironmentVariables - # with: - # variablesPath: ${{ env.variablesPath }} - # - name: 'Run tests' - # uses: ./.github/actions/templates/validateModulePester - # with: - # modulePath: '${{ env.modulePath }}' - # moduleTestFilePath: '${{ env.moduleTestFilePath }}' + ######################### + # Static validation # + ######################### + job_module_pester_validation: + runs-on: ubuntu-20.04 + name: 'Static validation' + steps: + - name: 'Checkout' + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set environment variables + uses: ./.github/actions/templates/setEnvironmentVariables + with: + variablesPath: ${{ env.variablesPath }} + - name: 'Run tests' + uses: ./.github/actions/templates/validateModulePester + with: + modulePath: '${{ env.modulePath }}' + moduleTestFilePath: '${{ env.moduleTestFilePath }}' - # ############################# - # # Deployment validation # - # ############################# - # job_module_deploy_validation: - # runs-on: ubuntu-20.04 - # name: 'Deployment validation' - # needs: - # - job_initialize_pipeline - # - job_module_pester_validation - # strategy: - # fail-fast: false - # matrix: - # moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - # steps: - # - name: 'Checkout' - # uses: actions/checkout@v3 - # with: - # fetch-depth: 0 - # - name: Set environment variables - # uses: ./.github/actions/templates/setEnvironmentVariables - # with: - # variablesPath: ${{ env.variablesPath }} - # - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - # uses: ./.github/actions/templates/validateModuleDeployment - # with: - # templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - # location: '${{ env.location }}' - # subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - # managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - # removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' + ############################# + # Deployment validation # + ############################# + job_module_deploy_validation: + runs-on: ubuntu-20.04 + name: 'Deployment validation' + needs: + - job_initialize_pipeline + - job_module_pester_validation + strategy: + fail-fast: false + matrix: + moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} + steps: + - name: 'Checkout' + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set environment variables + uses: ./.github/actions/templates/setEnvironmentVariables + with: + variablesPath: ${{ env.variablesPath }} + - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' + uses: ./.github/actions/templates/validateModuleDeployment + with: + templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' + location: '${{ env.location }}' + subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' + managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' + removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' ################## # Publishing # ################## job_publish_module: name: 'Publishing' - # if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' runs-on: ubuntu-20.04 - # needs: - # - job_module_deploy_validation + needs: + - job_module_deploy_validation steps: - name: 'Checkout' uses: actions/checkout@v3 From 8b61c1abea3607f8b83abb368c3949386be6979a Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 14:06:32 +0100 Subject: [PATCH 33/39] Added minor, major & latest to missing publishing --- .../pipelineTemplates/jobs.publishModule.yml | 2 + .../templates/publishModule/action.yml | 4 +- ...ModulesMissingFromPrivateBicepRegistry.ps1 | 51 +++++++++++++-- .../Get-ModulesMissingFromTemplateSpecsRG.ps1 | 63 +++++++++++++++++-- 4 files changed, 107 insertions(+), 13 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 83fd05131a..5d0351d989 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -251,6 +251,7 @@ jobs: $missingInputObject = @{ TemplateFilePath = $TemplateFilePath TemplateSpecsRGName = '${{ parameters.templateSpecsRgName }}' + PublishLatest = [bool] '${{ parameters.bicepRegistryRgName }}' } Write-Verbose "Invoke Get-ModulesMissingFromTemplateSpecsRG with" -Verbose @@ -339,6 +340,7 @@ jobs: TemplateFilePath = $TemplateFilePath BicepRegistryName = '${{ parameters.bicepRegistryName }}' BicepRegistryRgName = '${{ parameters.bicepRegistryRgName }}' + PublishLatest = [bool] '${{ parameters.bicepRegistryRgName }}' } Write-Verbose "Invoke Get-ModulesMissingFromPrivateBicepRegistry with" -Verbose diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index 11e30b9705..55fe284f2e 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -132,6 +132,7 @@ runs: $missingInputObject = @{ TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" TemplateSpecsRGName = '${{ inputs.templateSpecsRgName }}' + PublishLatest = [bool] "${{ inputs.publishLatest }}" } Write-Verbose "Invoke Get-ModulesMissingFromTemplateSpecsRG with" -Verbose @@ -188,7 +189,7 @@ runs: ################################ $functionInput = @{ TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" - publishLatest = [bool] "${{ inputs.publishLatest }}" + PublishLatest = [bool] "${{ inputs.publishLatest }}" } Write-Verbose "Invoke task with" -Verbose @@ -205,6 +206,7 @@ runs: TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}" BicepRegistryName = '${{ inputs.bicepRegistryName }}' BicepRegistryRgName = '${{ inputs.bicepRegistryRgName }}' + PublishLatest = [bool] "${{ inputs.publishLatest }}" } Write-Verbose "Invoke Get-ModulesMissingFromPrivateBicepRegistry with" -Verbose diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 index ced7494f52..b4415ad09e 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromPrivateBicepRegistry.ps1 @@ -14,6 +14,10 @@ Mandatory. The name of the Container Registry to search in .PARAMETER BicepRegistryRgName Mandatory. The name of Resource Group the Container Registry is located it. +.PARAMETER PublishLatest +Optional. Publish an absolute latest version. +Note: This version may include breaking changes and is not recommended for production environments + .EXAMPLE Get-ModulesMissingFromPrivateBicepRegistry -TemplateFilePath 'C:\ResourceModules\modules\Microsoft.Compute\virtualMachines\deploy.bicep' -BicepRegistryName 'adpsxxazacrx001' -BicepRegistryRgName 'artifacts-rg' @@ -24,8 +28,20 @@ Name Value ---- ----- Version 0.4.0 TemplateFilePath C:\ResourceModules\modules\Microsoft.Compute\virtualMachines\extensions\deploy.bicep +Version 0.4 +TemplateFilePath C:\ResourceModules\modules\Microsoft.Compute\virtualMachines\extensions\deploy.bicep +Version 0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.Compute\virtualMachines\extensions\deploy.bicep +Version latest +TemplateFilePath C:\ResourceModules\modules\Microsoft.Compute\virtualMachines\extensions\deploy.bicep Version 0.6.0 TemplateFilePath C:\ResourceModules\modules\Microsoft.Compute\virtualMachines\deploy.bicep +Version 0.6 +TemplateFilePath C:\ResourceModules\modules\Microsoft.Compute\virtualMachines\deploy.bicep +Version 0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.Compute\virtualMachines\deploy.bicep +Version latest +TemplateFilePath C:\ResourceModules\modules\Microsoft.Compute\virtualMachines\deploy.bicep #> function Get-ModulesMissingFromPrivateBicepRegistry { @@ -38,7 +54,10 @@ function Get-ModulesMissingFromPrivateBicepRegistry { [string] $BicepRegistryName, [Parameter(Mandatory = $true)] - [string] $BicepRegistryRgName + [string] $BicepRegistryRgName, + + [Parameter(Mandatory = $false)] + [bool] $PublishLatest = $true ) begin { @@ -73,12 +92,32 @@ function Get-ModulesMissingFromPrivateBicepRegistry { # Collect any that are not part of the ACR, fetch their version and return the result array $modulesToPublish = @() foreach ($missingTemplatePath in $missingTemplatePaths) { - $moduleToPublish = @{ - TemplateFilePath = $missingTemplatePath - Version = '{0}.0' -f (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version + $moduleVersionsToPublish = @( + # Patch version + @{ + TemplateFilePath = $missingTemplatePath + Version = '{0}.0' -f (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version + }, + # Minor version + @{ + TemplateFilePath = $missingTemplatePath + Version = (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version + }, + # Major version + @{ + TemplateFilePath = $missingTemplatePath + Version = ((Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version -split '\.')[0] + } + ) + if ($PublishLatest) { + $moduleVersionsToPublish += @{ + TemplateFilePath = $missingTemplatePath + Version = 'latest' + } } - $modulesToPublish += $moduleToPublish - Write-Verbose ('Missing module [{0}] will be considered for publishing with version [{1}]' -f $modulesToPublish.TemplateFilePath, $modulesToPublish.Version) -Verbose + + $modulesToPublish += $moduleVersionsToPublish + Write-Verbose ('Missing module [{0}] will be considered for publishing with version(s) [{1}]' -f $missingTemplatePath, ($moduleVersionsToPublish.Version -join ', ')) -Verbose } if ($moduleToPublish.count -eq 0) { diff --git a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 index d2e96ebd01..cc78c17d96 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesMissingFromTemplateSpecsRG.ps1 @@ -11,6 +11,10 @@ Mandatory. The Template File Path to process .PARAMETER TemplateSpecsRGName Mandatory. The Resource Group to search in +.PARAMETER PublishLatest +Optional. Publish an absolute latest version. +Note: This version may include breaking changes and is not recommended for production environments + .EXAMPLE Get-ModulesMissingFromTemplateSpecsRG -TemplateFilePath 'C:\ResourceModules\modules\Microsoft.KeyVault\vaults\deploy.bicep' -TemplateSpecsRGName 'artifacts-rg' @@ -21,12 +25,36 @@ Name Value ---- ----- Version 0.4.0 TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\accessPolicies\deploy.bicep +Version 0.4 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\accessPolicies\deploy.bicep +Version 0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\accessPolicies\deploy.bicep +Version latest +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\accessPolicies\deploy.bicep Version 0.4.0 TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\keys\deploy.bicep +Version 0.4 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\keys\deploy.bicep +Version 0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\keys\deploy.bicep +Version latest +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\keys\deploy.bicep Version 0.4.0 TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\secrets\deploy.bicep +Version 0.4 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\secrets\deploy.bicep +Version 0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\secrets\deploy.bicep +Version latest +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\secrets\deploy.bicep Version 0.5.0 TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\deploy.bicep +Version 0.5 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\deploy.bicep +Version 0 +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\deploy.bicep +Version latest +TemplateFilePath C:\ResourceModules\modules\Microsoft.KeyVault\vaults\deploy.bicep #> function Get-ModulesMissingFromTemplateSpecsRG { @@ -36,7 +64,10 @@ function Get-ModulesMissingFromTemplateSpecsRG { [string] $TemplateFilePath, [Parameter(Mandatory = $true)] - [string] $TemplateSpecsRGName + [string] $TemplateSpecsRGName, + + [Parameter(Mandatory = $false)] + [bool] $PublishLatest = $true ) begin { @@ -71,12 +102,32 @@ function Get-ModulesMissingFromTemplateSpecsRG { # Collect any that are not part of the ACR, fetch their version and return the result array $modulesToPublish = @() foreach ($missingTemplatePath in $missingTemplatePaths) { - $moduleToPublish = @{ - TemplateFilePath = $missingTemplatePath - Version = '{0}.0' -f (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version + $moduleVersionsToPublish = @( + # Patch version + @{ + TemplateFilePath = $missingTemplatePath + Version = '{0}.0' -f (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version + }, + # Minor version + @{ + TemplateFilePath = $missingTemplatePath + Version = (Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version + }, + # Major version + @{ + TemplateFilePath = $missingTemplatePath + Version = ((Get-Content (Join-Path (Split-Path $missingTemplatePath) 'version.json') -Raw | ConvertFrom-Json).version -split '\.')[0] + } + ) + if ($PublishLatest) { + $moduleVersionsToPublish += @{ + TemplateFilePath = $missingTemplatePath + Version = 'latest' + } } - $modulesToPublish += $moduleToPublish - Write-Verbose ('Missing module [{0}] will be considered for publishing with version [{1}]' -f $modulesToPublish.TemplateFilePath, $modulesToPublish.Version) -Verbose + + $modulesToPublish += $moduleVersionsToPublish + Write-Verbose ('Missing module [{0}] will be considered for publishing with version(s) [{1}]' -f $missingTemplatePath, ($moduleVersionsToPublish.Version -join ', ')) -Verbose } if ($moduleToPublish.count -eq 0) { From 1024f3f54f65b9f55cf1bab68e1440bad97c2077 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 14:07:24 +0100 Subject: [PATCH 34/39] Disabled most of the analysis services pipeline for teting --- .../workflows/ms.analysisservices.servers.yml | 106 +++++++++--------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/.github/workflows/ms.analysisservices.servers.yml b/.github/workflows/ms.analysisservices.servers.yml index cadf4b2b95..63e477c15f 100644 --- a/.github/workflows/ms.analysisservices.servers.yml +++ b/.github/workflows/ms.analysisservices.servers.yml @@ -60,67 +60,67 @@ jobs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} - ######################### - # Static validation # - ######################### - job_module_pester_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' + # ######################### + # # Static validation # + # ######################### + # job_module_pester_validation: + # runs-on: ubuntu-20.04 + # name: 'Static validation' + # steps: + # - name: 'Checkout' + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # - name: Set environment variables + # uses: ./.github/actions/templates/setEnvironmentVariables + # with: + # variablesPath: ${{ env.variablesPath }} + # - name: 'Run tests' + # uses: ./.github/actions/templates/validateModulePester + # with: + # modulePath: '${{ env.modulePath }}' + # moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deployment validation' - needs: - - job_initialize_pipeline - - job_module_pester_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' + # ############################# + # # Deployment validation # + # ############################# + # job_module_deploy_validation: + # runs-on: ubuntu-20.04 + # name: 'Deployment validation' + # needs: + # - job_initialize_pipeline + # - job_module_pester_validation + # strategy: + # fail-fast: false + # matrix: + # moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} + # steps: + # - name: 'Checkout' + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # - name: Set environment variables + # uses: ./.github/actions/templates/setEnvironmentVariables + # with: + # variablesPath: ${{ env.variablesPath }} + # - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' + # uses: ./.github/actions/templates/validateModuleDeployment + # with: + # templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' + # location: '${{ env.location }}' + # subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' + # managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' + # removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' ################## # Publishing # ################## job_publish_module: name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' + # if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation + # needs: + # - job_module_deploy_validation steps: - name: 'Checkout' uses: actions/checkout@v3 From 096f01bc069abd25ff89f03f4642ac432b12fb8f Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 14:13:20 +0100 Subject: [PATCH 35/39] Update to latest --- .../pipelineTemplates/jobs.publishModule.yml | 12 +++++++++--- .github/actions/templates/publishModule/action.yml | 7 +++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 5d0351d989..30196ec354 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -153,8 +153,10 @@ jobs: Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose + $modulesToPublish = @() + # Get the modified child resources - $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + $modulesToPublish += Get-ModulesToPublish @functionInput -Verbose ############################# ## Get missing modules ## @@ -240,8 +242,10 @@ jobs: Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose + $modulesToPublish = @() + # Get the modified child resources - $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + $modulesToPublish += Get-ModulesToPublish @functionInput -Verbose ############################# ## Get missing modules ## @@ -329,8 +333,10 @@ jobs: Write-Verbose "Invoke Get-ModulesToPublish with" -Verbose Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose + $modulesToPublish = @() + # Get the modified child resources - $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + $modulesToPublish += Get-ModulesToPublish @functionInput -Verbose ############################# ## Get missing modules ## diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index 55fe284f2e..14e45f965e 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -110,6 +110,8 @@ runs: . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesMissingFromTemplateSpecsRG.ps1') . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToTemplateSpecsRG.ps1') + $modulesToPublish = @() + ################################ ## Get modules to publish ## ################################ @@ -122,7 +124,7 @@ runs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose # Get the modified child resources - $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + $modulesToPublish += Get-ModulesToPublish @functionInput -Verbose ############################# ## Get missing modules ## @@ -183,6 +185,7 @@ runs: . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesMissingFromPrivateBicepRegistry.ps1') . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1') + $modulesToPublish = @() ################################ ## Get modules to publish ## @@ -196,7 +199,7 @@ runs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose # Get the modified child resources - $modulesToPublish = Get-ModulesToPublish @functionInput -Verbose + $modulesToPublish += Get-ModulesToPublish @functionInput -Verbose ############################# ## Get missing modules ## From 683d6f31ec81f23ab662b493cbcd8c2bed4d0164 Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 14:24:50 +0100 Subject: [PATCH 36/39] Update to latest --- .../workflows/ms.analysisservices.servers.yml | 107 +++++++++--------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/.github/workflows/ms.analysisservices.servers.yml b/.github/workflows/ms.analysisservices.servers.yml index 63e477c15f..5f0e3e938f 100644 --- a/.github/workflows/ms.analysisservices.servers.yml +++ b/.github/workflows/ms.analysisservices.servers.yml @@ -60,67 +60,67 @@ jobs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} - # ######################### - # # Static validation # - # ######################### - # job_module_pester_validation: - # runs-on: ubuntu-20.04 - # name: 'Static validation' - # steps: - # - name: 'Checkout' - # uses: actions/checkout@v3 - # with: - # fetch-depth: 0 - # - name: Set environment variables - # uses: ./.github/actions/templates/setEnvironmentVariables - # with: - # variablesPath: ${{ env.variablesPath }} - # - name: 'Run tests' - # uses: ./.github/actions/templates/validateModulePester - # with: - # modulePath: '${{ env.modulePath }}' - # moduleTestFilePath: '${{ env.moduleTestFilePath }}' + ######################### + # Static validation # + ######################### + job_module_pester_validation: + runs-on: ubuntu-20.04 + name: 'Static validation' + steps: + - name: 'Checkout' + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set environment variables + uses: ./.github/actions/templates/setEnvironmentVariables + with: + variablesPath: ${{ env.variablesPath }} + - name: 'Run tests' + uses: ./.github/actions/templates/validateModulePester + with: + modulePath: '${{ env.modulePath }}' + moduleTestFilePath: '${{ env.moduleTestFilePath }}' - # ############################# - # # Deployment validation # - # ############################# - # job_module_deploy_validation: - # runs-on: ubuntu-20.04 - # name: 'Deployment validation' - # needs: - # - job_initialize_pipeline - # - job_module_pester_validation - # strategy: - # fail-fast: false - # matrix: - # moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - # steps: - # - name: 'Checkout' - # uses: actions/checkout@v3 - # with: - # fetch-depth: 0 - # - name: Set environment variables - # uses: ./.github/actions/templates/setEnvironmentVariables - # with: - # variablesPath: ${{ env.variablesPath }} - # - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - # uses: ./.github/actions/templates/validateModuleDeployment - # with: - # templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - # location: '${{ env.location }}' - # subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - # managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - # removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' + ############################# + # Deployment validation # + ############################# + job_module_deploy_validation: + runs-on: ubuntu-20.04 + name: 'Deployment validation' + needs: + - job_initialize_pipeline + - job_module_pester_validation + strategy: + fail-fast: false + matrix: + moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} + steps: + - name: 'Checkout' + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set environment variables + uses: ./.github/actions/templates/setEnvironmentVariables + with: + variablesPath: ${{ env.variablesPath }} + - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' + uses: ./.github/actions/templates/validateModuleDeployment + with: + templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' + location: '${{ env.location }}' + subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' + managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' + removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' ################## # Publishing # ################## job_publish_module: name: 'Publishing' - # if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' runs-on: ubuntu-20.04 - # needs: - # - job_module_deploy_validation + needs: + - job_module_deploy_validation steps: - name: 'Checkout' uses: actions/checkout@v3 @@ -142,4 +142,3 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' From 40ca3d8826d9bc0b2d042377c277b5b4c68ad2af Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 7 Dec 2022 14:27:33 +0100 Subject: [PATCH 37/39] Update to latest --- .github/workflows/ms.analysisservices.servers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ms.analysisservices.servers.yml b/.github/workflows/ms.analysisservices.servers.yml index 5f0e3e938f..cadf4b2b95 100644 --- a/.github/workflows/ms.analysisservices.servers.yml +++ b/.github/workflows/ms.analysisservices.servers.yml @@ -142,3 +142,4 @@ jobs: bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}' From 5529489596689a2e9640db9337de8e00f48b51c1 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Wed, 7 Dec 2022 21:29:01 +0100 Subject: [PATCH 38/39] Update .azuredevops/pipelineTemplates/jobs.publishModule.yml Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .azuredevops/pipelineTemplates/jobs.publishModule.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 30196ec354..3fefee7e56 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -27,7 +27,7 @@ ## | vmImage | '$(vmImage)' | You can provide either a [poolname] or [vmImage] to run the job on | 'ubuntu20.04' | ## | defaultJobTimeoutInMinutes | 120 | The timeout for the job in this pipeline | 120 | ## | modulePath | '$(modulePath)' | The path to the module to deploy. E.g. [c:/KeyVault] | 'c:/KeyVault' | -## | publishLatest | '$(publishLatest)' | Flag to indicate whether or not to publish a "latest" version | true | +## | publishLatest | '$(publishLatest)' | Flag to indicate whether or not to publish a "latest" version to Bicep Registry and Template Specs | true | ## | templateSpecsRGName | '$(templateSpecsRGName)' | Required to publish to template spec. ResourceGroup of the template spec to publish to | 'mgmt-rg' | ## | templateSpecsRGLocation | '$(templateSpecsRGLocation)' | Required to publish to template spec. Location of the template spec resource group | 'West Europe' | ## | templateSpecsDescription | '$(templateSpecsDescription)' | Required to publish to template spec. Description of the template spec to publish to | 'IaCs module' | From db840593e5cbafaca44e25913f2e1180d00730de Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Wed, 21 Dec 2022 08:41:11 +0100 Subject: [PATCH 39/39] Updated docs --- ...ed - Scenario 2 Onboard module library and CI environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md b/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md index 697d8b4946..dd941c2347 100644 --- a/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md +++ b/docs/wiki/Getting started - Scenario 2 Onboard module library and CI environment.md @@ -354,7 +354,7 @@ This section will explain what is required to publish the modules to [Azure Arti 1. An Azure DevOps organization and project 1. An Azure DevOps artifacts feed - > **Note:** The default feed name is `carml` as configured in the [`settings.yml`](https://github.com/Azure/ResourceModules/blob/main/settings.yml) file's variable `vstsFeedName`. Update the value here if you want to use a different name, but make sure it matches the name of the artifact feed created in Azure DevOps. + > **Note:** The official guidance to set up a feed can be found [here](https://learn.microsoft.com/en-us/azure/devops/artifacts/concepts/feeds?view=azure-devops#create-public-feeds). The default feed name is `carml` as configured in the [`settings.yml`](https://github.com/Azure/ResourceModules/blob/main/settings.yml) file's variable `vstsFeedName`. Update the value here if you want to use a different name, but make sure it matches the name of the artifact feed created in Azure DevOps. > > **Note:** It's also very important that the feed's 'Permissions' (Artifact Feed -> Feed settings -> Permissions) are set up so that the project's 'Build Service' has at least the role 'Contributor' to be able to publish artifacts ([ref](https://learn.microsoft.com/en-us/azure/devops/artifacts/feeds/feed-permissions?view=azure-devops#permissions-table)). 1. An Azure DevOps project to host the artifact feed