From a3355f68979442e3d31f5f9422e5d1e90eeff92d Mon Sep 17 00:00:00 2001 From: "Menghua Chen (MSFT)" <111940661+Menghua1@users.noreply.github.com> Date: Sat, 26 Oct 2024 01:16:31 +0800 Subject: [PATCH] fix: Update the name of the `aksAcrPull` module from hard-coded to a variable. (#3560) ## Description Updated the name of the aksAcrPull module from hard-coded to a variable. To ensure that the resource names created for each deployment are unique. ## Pipeline Reference | Pipeline | | -------- | | [![avm.ptn.azd.acr-container-app](https://github.com/Menghua1/bicep-registry-modules/actions/workflows/avm.ptn.azd.acr-container-app.yml/badge.svg?branch=update-module-name)](https://github.com/Menghua1/bicep-registry-modules/actions/workflows/avm.ptn.azd.acr-container-app.yml) | ## Type of Change - [ ] Update to CI Environment or utilities (Non-module affecting changes) - [x] Azure Verified Module updates: - [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `version.json`: - [ ] Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description. - [ ] The bug was found by the module author, and no one has opened an issue to report it yet. - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `version.json`. - [ ] Breaking changes and I have bumped the MAJOR version in `version.json`. - [ ] Update to documentation ## Checklist - [x] I'm sure there are no other open Pull Requests for the same update/change - [x] I have run `Set-AVMModule` locally to generate the supporting module files. - [x] My corresponding pipelines / checks run clean and green without any errors or warnings @jongio for notification. --- avm/ptn/azd/acr-container-app/main.json | 10 +++++----- .../acr-container-app/modules/registry-access.bicep | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/avm/ptn/azd/acr-container-app/main.json b/avm/ptn/azd/acr-container-app/main.json index 3aa2261a84..73927bb4fc 100644 --- a/avm/ptn/azd/acr-container-app/main.json +++ b/avm/ptn/azd/acr-container-app/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.29.47.4906", - "templateHash": "8683355263365484382" + "version": "0.30.23.60470", + "templateHash": "11200666829036307571" }, "name": "Azd ACR Linked Container App", "description": "Creates a container app in an Azure Container App environment.\n\n**Note:** This module is not intended for broad, generic use, as it was designed to cater for the requirements of the AZD CLI product. Feature requests and bug fix requests are welcome if they support the development of the AZD CLI but may not be incorporated if they aim to make this module more generic than what it needs to be for its primary use case", @@ -1428,8 +1428,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.29.47.4906", - "templateHash": "9239508313239206967" + "version": "0.30.23.60470", + "templateHash": "676465844790879977" }, "name": "ACR Pull permissions", "description": "Assigns ACR Pull permissions to access an Azure Container Registry.", @@ -1463,7 +1463,7 @@ { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", - "name": "acrpullrole-deployment", + "name": "[guid(subscription().id, resourceGroup().id, parameters('principalId'), variables('acrPullRole'))]", "properties": { "expressionEvaluationOptions": { "scope": "inner" diff --git a/avm/ptn/azd/acr-container-app/modules/registry-access.bicep b/avm/ptn/azd/acr-container-app/modules/registry-access.bicep index 3fdfe31799..33d6fd8ec6 100644 --- a/avm/ptn/azd/acr-container-app/modules/registry-access.bicep +++ b/avm/ptn/azd/acr-container-app/modules/registry-access.bicep @@ -17,7 +17,7 @@ var acrPullRole = subscriptionResourceId( ) module aksAcrPull 'br/public:avm/ptn/authorization/resource-role-assignment:0.1.1' = { - name: 'acrpullrole-deployment' + name: guid(subscription().id, resourceGroup().id, principalId, acrPullRole) params: { principalId: principalId resourceId: containerRegistry.id