Skip to content

Commit

Permalink
[Cognitive Language] Update test-resources.json (Azure#24424)
Browse files Browse the repository at this point in the history
  • Loading branch information
deyaaeldeen authored Jan 10, 2023
1 parent 8038a49 commit 710885b
Showing 1 changed file with 72 additions and 17 deletions.
89 changes: 72 additions & 17 deletions sdk/cognitivelanguage/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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')]"
Expand All @@ -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')]"
Expand Down Expand Up @@ -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",
Expand All @@ -152,16 +183,22 @@
"PATCH"
],
"maxAgeInSeconds": 86400,
"exposedHeaders": ["*"],
"allowedHeaders": ["*"]
"exposedHeaders": [
"*"
],
"allowedHeaders": [
"*"
]
}
]
},
"lastAccessTimeTrackingPolicy": {
"enable": true,
"name": "AccessTimeTracking",
"trackingGranularityInDays": 1,
"blobType": ["blockBlob"]
"blobType": [
"blockBlob"
]
}
},
"resources": []
Expand All @@ -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": [
"*"
]
}
]
}
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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'), '/')]"
}
}
}

0 comments on commit 710885b

Please sign in to comment.