diff --git a/sdk/cognitivelanguage/test-resources.json b/sdk/cognitivelanguage/test-resources.json index 448fb20e65f7..7ff0ade3b368 100644 --- a/sdk/cognitivelanguage/test-resources.json +++ b/sdk/cognitivelanguage/test-resources.json @@ -50,6 +50,14 @@ "cognitiveServicesEndpointSuffix": { "type": "string", "defaultValue": ".cognitiveservices.azure.com" + }, + "storageRoleUniqueId": { + "defaultValue": "[newGuid()]", + "type": "String" + }, + "storageServicesEndpointSuffix": { + "type": "string", + "defaultValue": ".blob.core.windows.net" } }, "variables": { @@ -81,11 +89,28 @@ "containerName": "documents" }, "resources": [ + { + "type": "Microsoft.Storage/storageAccounts/providers/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[concat(variables('storageAccountName'), '/Microsoft.Authorization/', guid(concat(resourceGroup().id, '/', variables('blobDataOwnerRoleId'), '/', parameters('storageRoleUniqueId'))))]", + "dependsOn": [ + "[variables('storageAccountName')]", + "[resourceId('Microsoft.CognitiveServices/accounts', variables('cognitiveAccountName'))]" + ], + "location": "[parameters('location')]", + "properties": { + "roleDefinitionId": "[variables('blobDataOwnerRoleId')]", + "principalId": "[reference(concat('Microsoft.CognitiveServices/accounts/', variables('cognitiveAccountName')), variables('cognitiveApiVersion'), 'Full').identity.principalId]", + "principalType": "ServicePrincipal" + } + }, { "type": "Microsoft.Authorization/roleAssignments", "apiVersion": "[variables('authorizationApiVersion')]", "name": "[guid(concat('blobDataContributorRoleId', variables('storageAccountName')))]", - "dependsOn": ["[variables('storageAccountName')]"], + "dependsOn": [ + "[variables('storageAccountName')]" + ], "properties": { "roleDefinitionId": "[variables('blobDataContributorRoleId')]", "principalId": "[parameters('testApplicationOid')]" @@ -95,7 +120,9 @@ "type": "Microsoft.Authorization/roleAssignments", "apiVersion": "[variables('authorizationApiVersion')]", "name": "[guid(concat('blobDataOwnerRoleId', variables('storageAccountName')))]", - "dependsOn": ["[variables('storageAccountName')]"], + "dependsOn": [ + "[variables('storageAccountName')]" + ], "properties": { "roleDefinitionId": "[variables('blobDataOwnerRoleId')]", "principalId": "[parameters('testApplicationOid')]" @@ -134,13 +161,17 @@ "name": "default", "type": "blobServices", "apiVersion": "[variables('storageApiVersion')]", - "dependsOn": ["[variables('storageAccountName')]"], + "dependsOn": [ + "[variables('storageAccountName')]" + ], "properties": { "isVersioningEnabled": "[parameters('enableVersioning')]", "cors": { "corsRules": [ { - "allowedOrigins": ["*"], + "allowedOrigins": [ + "*" + ], "allowedMethods": [ "DELETE", "GET", @@ -152,8 +183,12 @@ "PATCH" ], "maxAgeInSeconds": 86400, - "exposedHeaders": ["*"], - "allowedHeaders": ["*"] + "exposedHeaders": [ + "*" + ], + "allowedHeaders": [ + "*" + ] } ] }, @@ -161,7 +196,9 @@ "enable": true, "name": "AccessTimeTracking", "trackingGranularityInDays": 1, - "blobType": ["blockBlob"] + "blobType": [ + "blockBlob" + ] } }, "resources": [] @@ -170,16 +207,32 @@ "name": "default", "type": "fileServices", "apiVersion": "[variables('storageApiVersion')]", - "dependsOn": ["[variables('storageAccountName')]"], + "dependsOn": [ + "[variables('storageAccountName')]" + ], "properties": { "cors": { "corsRules": [ { - "allowedOrigins": ["*"], - "allowedMethods": ["DELETE", "GET", "HEAD", "MERGE", "POST", "OPTIONS", "PUT"], + "allowedOrigins": [ + "*" + ], + "allowedMethods": [ + "DELETE", + "GET", + "HEAD", + "MERGE", + "POST", + "OPTIONS", + "PUT" + ], "maxAgeInSeconds": 86400, - "exposedHeaders": ["*"], - "allowedHeaders": ["*"] + "exposedHeaders": [ + "*" + ], + "allowedHeaders": [ + "*" + ] } ] } @@ -210,9 +263,11 @@ ], "properties": { "customSubDomainName": "[variables('cognitiveAccountName')]", - "userOwnedStorage": [{ - "resourceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - }] + "userOwnedStorage": [ + { + "resourceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" + } + ] }, "identity": { "type": "SystemAssigned" @@ -244,9 +299,9 @@ "type": "string", "value": "[concat('https://', variables('cognitiveAccountName'), parameters('cognitiveServicesEndpointSuffix'), '/')]" }, - "STORAGE_ACCOUNT_NAME": { + "STORAGE_ENDPOINT": { "type": "string", - "value": "[variables('storageAccountName')]" + "value": "[concat('https://', variables('storageAccountName'), parameters('storageServicesEndpointSuffix'), '/')]" } } }