diff --git a/avm/res/cognitive-services/account/README.md b/avm/res/cognitive-services/account/README.md index 820802cdb8..e5804e0da1 100644 --- a/avm/res/cognitive-services/account/README.md +++ b/avm/res/cognitive-services/account/README.md @@ -41,7 +41,13 @@ The following section provides usage examples for the module, which were used to ### Example 1: _Using `deployments` in parameter set_ -This instance deploys the module with the AI model deployment feature. +This instance deploys the module with the AI model deployment feature.' + +Note, this test is temporarily disabled as it needs to be enabled on the subscription. +As we don't want other contributions from being blocked by this, we disabled the test for now / rely on a manual execution outside the CI environemnt +You can find more information here: https://learn.microsoft.com/en-us/legal/cognitive-services/openai/limited-access +And register here: https://aka.ms/oai/access +
diff --git a/avm/res/cognitive-services/account/main.bicep b/avm/res/cognitive-services/account/main.bicep index 293821f9b8..07ffb63489 100644 --- a/avm/res/cognitive-services/account/main.bicep +++ b/avm/res/cognitive-services/account/main.bicep @@ -137,7 +137,7 @@ var formattedUserAssignedIdentities = reduce( var identity = !empty(managedIdentities) ? { type: (managedIdentities.?systemAssigned ?? false) - ? (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'SystemAssigned,UserAssigned' : 'SystemAssigned') + ? (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'SystemAssigned, UserAssigned' : 'SystemAssigned') : (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'UserAssigned' : null) userAssignedIdentities: !empty(formattedUserAssignedIdentities) ? formattedUserAssignedIdentities : null } diff --git a/avm/res/cognitive-services/account/main.json b/avm/res/cognitive-services/account/main.json index 7c8c756cb7..7c1ff98ca5 100644 --- a/avm/res/cognitive-services/account/main.json +++ b/avm/res/cognitive-services/account/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.26.54.24096", - "templateHash": "2360701930449304487" + "version": "0.26.170.59819", + "templateHash": "5668118199015896027" }, "name": "Cognitive Services", "description": "This module deploys a Cognitive Service.", @@ -766,7 +766,7 @@ }, "variables": { "formattedUserAssignedIdentities": "[reduce(map(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createArray()), lambda('id', createObject(format('{0}', lambdaVariables('id')), createObject()))), createObject(), lambda('cur', 'next', union(lambdaVariables('cur'), lambdaVariables('next'))))]", - "identity": "[if(not(empty(parameters('managedIdentities'))), createObject('type', if(coalesce(tryGet(parameters('managedIdentities'), 'systemAssigned'), false()), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'SystemAssigned,UserAssigned', 'SystemAssigned'), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'UserAssigned', null())), 'userAssignedIdentities', if(not(empty(variables('formattedUserAssignedIdentities'))), variables('formattedUserAssignedIdentities'), null())), null())]", + "identity": "[if(not(empty(parameters('managedIdentities'))), createObject('type', if(coalesce(tryGet(parameters('managedIdentities'), 'systemAssigned'), false()), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'SystemAssigned, UserAssigned', 'SystemAssigned'), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'UserAssigned', null())), 'userAssignedIdentities', if(not(empty(variables('formattedUserAssignedIdentities'))), variables('formattedUserAssignedIdentities'), null())), null())]", "builtInRoleNames": { "Cognitive Services Contributor": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '25fbc0a9-bd7c-42a3-aa1a-3b75d497ee68')]", "Cognitive Services Custom Vision Contributor": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'c1ff6cc2-c111-46fe-8896-e0ef812ad9f3')]", diff --git a/avm/res/cognitive-services/account/tests/e2e/ai-model-deployment/main.test.bicep b/avm/res/cognitive-services/account/tests/e2e/ai-model-deployment/main.test.bicep index 7ee3f5be51..60d04523d3 100644 --- a/avm/res/cognitive-services/account/tests/e2e/ai-model-deployment/main.test.bicep +++ b/avm/res/cognitive-services/account/tests/e2e/ai-model-deployment/main.test.bicep @@ -1,7 +1,14 @@ targetScope = 'subscription' metadata name = 'Using `deployments` in parameter set' -metadata description = 'This instance deploys the module with the AI model deployment feature.' +metadata description = ''' +This instance deploys the module with the AI model deployment feature.' + +Note, this test is temporarily disabled as it needs to be enabled on the subscription. +As we don't want other contributions from being blocked by this, we disabled the test for now / rely on a manual execution outside the CI environemnt +You can find more information here: https://learn.microsoft.com/en-us/legal/cognitive-services/openai/limited-access +And register here: https://aka.ms/oai/access +''' // ========== // // Parameters // @@ -36,7 +43,7 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2022-09-01' = { // ============== // module testDeployment '../../../main.bicep' = [ - for iteration in ['init', 'idem']: { + for iteration in ['init', 'idem']: if (true == false) { scope: resourceGroup name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}-ai' params: { diff --git a/avm/res/cognitive-services/account/tests/e2e/ai-model-deployment/warning.tests.ps1 b/avm/res/cognitive-services/account/tests/e2e/ai-model-deployment/warning.tests.ps1 new file mode 100644 index 0000000000..21deb1f6a3 --- /dev/null +++ b/avm/res/cognitive-services/account/tests/e2e/ai-model-deployment/warning.tests.ps1 @@ -0,0 +1,24 @@ +###################################### +## Additional post-deployment tests ## +###################################### +## +## You can add any custom post-deployment validation tests you want here, or add them spread accross multiple test files in the test case folder. +## +########################### + +param ( + [Parameter(Mandatory = $false)] + [hashtable] $TestInputData = @{} +) + +Describe 'Warning' { + + It 'Disabled test' { + + Write-Output @{ + Warning = "Note, the OpenAI-Deployments test is temporarily disabled as it needs to be enabled on the subscription.
As we don't want other contributions from being blocked by this, we disabled the test for now / rely on a manual execution outside the CI environemnt. For more information please review the [offical docs](https://learn.microsoft.com/en-us/legal/cognitive-services/openai/limited-access) and or register [here](https://aka.ms/oai/access" + + } + } +} +