From 130d7ca1d5f638f48919895b191c44f7b13a36d0 Mon Sep 17 00:00:00 2001 From: Peter Budai Date: Thu, 9 May 2024 20:36:22 +0000 Subject: [PATCH] Make tests work --- .../tests/e2e/defaults/main.test.bicep | 11 +++++++---- .../tests/e2e/waf-aligned/main.test.bicep | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/avm/ptn/authorization/resource-role-assignment/tests/e2e/defaults/main.test.bicep b/avm/ptn/authorization/resource-role-assignment/tests/e2e/defaults/main.test.bicep index 1de1f7ed119..7181e7162db 100644 --- a/avm/ptn/authorization/resource-role-assignment/tests/e2e/defaults/main.test.bicep +++ b/avm/ptn/authorization/resource-role-assignment/tests/e2e/defaults/main.test.bicep @@ -1,6 +1,6 @@ targetScope = 'subscription' metadata name = 'Resource Role Assignments' -metadata description = 'This module deploys a Role Assignment at a Resource scope using minimal parameters.' +metadata description = 'This module deploys a Resource Role Assignment using minimal parameters.' // ========== // // Parameters // @@ -47,10 +47,13 @@ module nestedDependencies 'dependencies.bicep' = { @batchSize(1) module testDeployment '../../../main.bicep' = [ for iteration in ['init', 'idem']: { - name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}' + name: '${guid(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}' + scope: resourceGroup params: { - name: '${namePrefix}${serviceShort}001' - location: resourceLocation + name: guid( + nestedDependencies.outputs.managedIdentityPrincipalId, + nestedDependencies.outputs.storageAccountResourceId + ) resourceId: nestedDependencies.outputs.storageAccountResourceId principalId: nestedDependencies.outputs.managedIdentityPrincipalId principalType: 'ServicePrincipal' diff --git a/avm/ptn/authorization/resource-role-assignment/tests/e2e/waf-aligned/main.test.bicep b/avm/ptn/authorization/resource-role-assignment/tests/e2e/waf-aligned/main.test.bicep index e0733c0c2c9..0d96a39f14b 100644 --- a/avm/ptn/authorization/resource-role-assignment/tests/e2e/waf-aligned/main.test.bicep +++ b/avm/ptn/authorization/resource-role-assignment/tests/e2e/waf-aligned/main.test.bicep @@ -47,11 +47,14 @@ module nestedDependencies 'dependencies.bicep' = { @batchSize(1) module testDeployment '../../../main.bicep' = [ for iteration in ['init', 'idem']: { - name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}' + name: '${guid(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}' + scope: resourceGroup params: { - name: '${namePrefix}${serviceShort}001' - location: resourceLocation - resourceId: '' + name: guid( + nestedDependencies.outputs.managedIdentityPrincipalId, + nestedDependencies.outputs.storageAccountResourceId, + ) + resourceId: nestedDependencies.outputs.storageAccountResourceId principalId: nestedDependencies.outputs.managedIdentityPrincipalId principalType: 'ServicePrincipal' roleDefinitionId: '2a2b9908-6ea1-4ae2-8e65-a410df84e7d1' // Storage Blob Data Reader