Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added RG-Location to bicep registry #839

Merged
merged 17 commits into from
Dec 23, 2021
Merged
57 changes: 30 additions & 27 deletions .azuredevops/pipelineTemplates/module.jobs.publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,29 @@
##
## NOTE: If you don't need to overwrite a shared value, you can IGNORE this section
##
## |==================================================================================================================================================================================================================|
## | Parameter | Default Value | Description | Example |
## |---------------------------------|--------------------------------------|-----------------------------------------------------------------------------------------------------|-----------------------------------|
## | displayName | 'Publish module' | 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 |
## | versionOption | '$(versionOption)' | The mode to handle the version increments [major|minor|patch|custom]. | 'patch' |
## | moduleVersion | '$(moduleVersion)' | The version to enforce if [versionOption] is set to [custom] | '1.0.0' |
## | modulePath | '$(modulePath)' | The path to the module to deploy. E.g. [c:/KeyVault] | 'c:/KeyVault' |
## | 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' |
## | vstsFeedName | '$(vstsFeedName)' | Required to publish to a DevOps feed. Name to the feed to publish to. | 'modules' |
## | vstsProject | '$(System.TeamProject)' | Required to publish to a DevOps feed. Name of the project hosting the artifacts feed. May be empty. | 'iacs' |
## | bicepRegistryName | '$(bicepRegistryName)' | Required to publish to the private bicep registry. Name of the hosting container registry | 'adpsxxazacrx001' |
## | bicepRegistryRGName | '$(bicepRegistryRGName)' | Required to publish to the private bicep registry. Resource group of the hosting container registry | 'artifacts-rg' |
## | vstsOrganization | '$(vstsOrganization)' | Required to publish to a DevOps feed. Name of the organization hosting the artifacts feed. | 'servicescode' |
## | azurePowerShellVersion | '$(azurePowerShellVersion)' | Used for configuring the Azure PowerShell Version, one of the example values. | 'latestVersion' or 'OtherVersion' |
## | preferredAzurePowerShellVersion | '$(preferredAzurePowerShellVersion)' | Used for configuring the Azure PowerShell Version, either an empty string or specific version. | '4.4.0' |
## |==================================================================================================================================================================================================================|
## |======================================================================================================================================================================================================================|
## | Parameter | Default Value | Description | Example |
## |---------------------------------|--------------------------------------|---------------------------------------------------------------------------------------------------------|-----------------------------------|
## | displayName | 'Publish module' | 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 |
## | versionOption | '$(versionOption)' | The mode to handle the version increments [major|minor|patch|custom]. | 'patch' |
## | moduleVersion | '$(moduleVersion)' | The version to enforce if [versionOption] is set to [custom] | '1.0.0' |
## | modulePath | '$(modulePath)' | The path to the module to deploy. E.g. [c:/KeyVault] | 'c:/KeyVault' |
## | 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' |
## | vstsFeedName | '$(vstsFeedName)' | Required to publish to a DevOps feed. Name to the feed to publish to. | 'modules' |
## | vstsProject | '$(System.TeamProject)' | Required to publish to a DevOps feed. Name of the project hosting the artifacts feed. May be empty. | 'iacs' |
## | bicepRegistryName | '$(bicepRegistryName)' | Required to publish to the private bicep registry. Name of the hosting container registry | 'adpsxxazacrx001' |
## | bicepRegistryRGName | '$(bicepRegistryRGName)' | Required to publish to the private bicep registry. Resource group of the hosting container registry | 'artifacts-rg' |
## | bicepRegistryRgLocation | '$(bicepRegistryRgLocation)' | Required to publish to the private bicep registry. Location of the RG of the hosting container registry | 'West Europe' |
## | vstsOrganization | '$(vstsOrganization)' | Required to publish to a DevOps feed. Name of the organization hosting the artifacts feed. | 'servicescode' |
## | azurePowerShellVersion | '$(azurePowerShellVersion)' | Used for configuring the Azure PowerShell Version, one of the example values. | 'latestVersion' or 'OtherVersion' |
## | preferredAzurePowerShellVersion | '$(preferredAzurePowerShellVersion)' | Used for configuring the Azure PowerShell Version, either an empty string or specific version. | '4.4.0' |
## |======================================================================================================================================================================================================================|
##
##---------------------------------------------##

Expand Down Expand Up @@ -72,6 +73,7 @@ parameters:
## Private-Bicep-Registry-related
bicepRegistryName: '$(bicepRegistryName)'
bicepRegistryRGName: '$(bicepRegistryRGName)'
bicepRegistryRgLocation: '$(bicepRegistryRgLocation)'

##---------------------------------------------##
## TEMPLATE LOGIC ##
Expand Down Expand Up @@ -238,11 +240,12 @@ jobs:
. (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1')

$functionInput = @{
templateFilePath = Join-Path '$(ENVMODULEPATH)' 'deploy.bicep'
bicepRegistryName = '${{ parameters.bicepRegistryName }}'
bicepRegistryRgName = '${{ parameters.bicepRegistryRgName }}'
customVersion = '${{ parameters.customVersion }}'
versioningOption = '${{ parameters.versioningOption }}'
templateFilePath = Join-Path '$(ENVMODULEPATH)' 'deploy.bicep'
bicepRegistryName = '${{ parameters.bicepRegistryName }}'
bicepRegistryRgName = '${{ parameters.bicepRegistryRgName }}'
bicepRegistryRgLocation = '${{ parameters.bicepRegistryRgLocation }}'
customVersion = '${{ parameters.customVersion }}'
versioningOption = '${{ parameters.versioningOption }}'
}

Write-Verbose "Invoke task with" -Verbose
Expand Down
1 change: 1 addition & 0 deletions .azuredevops/pipelineVariables/global.variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ variables:
bicepRegistryDoPublish: true # Set to true, if you would like to publish module templates to a bicep registry
bicepRegistryName: adpsxxazacrx001 # The name of the bicep registry (ACR) to publish to. If it does not exist, it will be created.
bicepRegistryRGName: 'artifacts-rg' # The resource group that hosts the private bicep registry (ACR)
bicepRegistryRgLocation: 'West Europe' # The location of the resource group to publish to

######################################
# Azure PowerShell Version
Expand Down
14 changes: 9 additions & 5 deletions .github/actions/templates/publishModule/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ inputs:
description: 'Required to publish to private bicep registry. ResourceGroup of the container registry to publish to'
required: false
bicepRegistryRgName:
description: 'Required to publish to private bicep registry. Name of the container registry resource group'
required: false
bicepRegistryRgLocation:
description: 'Required to publish to private bicep registry. Location of the container registry resource group'
required: false
bicepRegistryDoPublish:
Expand Down Expand Up @@ -95,11 +98,12 @@ runs:
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1')
$functionInput = @{
templateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}"
bicepRegistryName = '${{ inputs.bicepRegistryName }}'
bicepRegistryRgName = '${{ inputs.bicepRegistryRgName }}'
customVersion = '${{ inputs.customVersion }}'
versioningOption = '${{ inputs.versioningOption }}'
templateFilePath = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.templateFilePath }}"
bicepRegistryName = '${{ inputs.bicepRegistryName }}'
bicepRegistryRgName = '${{ inputs.bicepRegistryRgName }}'
bicepRegistryRgLocation = '${{ inputs.bicepRegistryRgLocation }}'
customVersion = '${{ inputs.customVersion }}'
versioningOption = '${{ inputs.versioningOption }}'
}
Write-Verbose "Invoke task with" -Verbose
Expand Down
4 changes: 4 additions & 0 deletions .github/variables/global.variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"name": "bicepRegistryRGName",
"value": "artifacts-rg"
},
{
"name": "bicepRegistryRgLocation",
"value": "WestEurope"
},
{
"name": "bicepRegistryDoPublish",
"value": "true"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ms.analysisservices.servers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.apimanagement.service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.authorization.policyassignments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.authorization.policydefinitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.authorization.policyexemptions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.authorization.roleassignments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.authorization.roledefinitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.automanage.accounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.automation.automationaccounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.batch.batchaccounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.cognitiveservices.accounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.compute.availabilitysets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.compute.diskencryptionsets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.compute.galleries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
1 change: 1 addition & 0 deletions .github/workflows/ms.compute.images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ jobs:
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
Loading