Skip to content

Commit 710885b

Browse files
authored
[Cognitive Language] Update test-resources.json (Azure#24424)
1 parent 8038a49 commit 710885b

File tree

1 file changed

+72
-17
lines changed

1 file changed

+72
-17
lines changed

sdk/cognitivelanguage/test-resources.json

Lines changed: 72 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@
5050
"cognitiveServicesEndpointSuffix": {
5151
"type": "string",
5252
"defaultValue": ".cognitiveservices.azure.com"
53+
},
54+
"storageRoleUniqueId": {
55+
"defaultValue": "[newGuid()]",
56+
"type": "String"
57+
},
58+
"storageServicesEndpointSuffix": {
59+
"type": "string",
60+
"defaultValue": ".blob.core.windows.net"
5361
}
5462
},
5563
"variables": {
@@ -81,11 +89,28 @@
8189
"containerName": "documents"
8290
},
8391
"resources": [
92+
{
93+
"type": "Microsoft.Storage/storageAccounts/providers/roleAssignments",
94+
"apiVersion": "2022-04-01",
95+
"name": "[concat(variables('storageAccountName'), '/Microsoft.Authorization/', guid(concat(resourceGroup().id, '/', variables('blobDataOwnerRoleId'), '/', parameters('storageRoleUniqueId'))))]",
96+
"dependsOn": [
97+
"[variables('storageAccountName')]",
98+
"[resourceId('Microsoft.CognitiveServices/accounts', variables('cognitiveAccountName'))]"
99+
],
100+
"location": "[parameters('location')]",
101+
"properties": {
102+
"roleDefinitionId": "[variables('blobDataOwnerRoleId')]",
103+
"principalId": "[reference(concat('Microsoft.CognitiveServices/accounts/', variables('cognitiveAccountName')), variables('cognitiveApiVersion'), 'Full').identity.principalId]",
104+
"principalType": "ServicePrincipal"
105+
}
106+
},
84107
{
85108
"type": "Microsoft.Authorization/roleAssignments",
86109
"apiVersion": "[variables('authorizationApiVersion')]",
87110
"name": "[guid(concat('blobDataContributorRoleId', variables('storageAccountName')))]",
88-
"dependsOn": ["[variables('storageAccountName')]"],
111+
"dependsOn": [
112+
"[variables('storageAccountName')]"
113+
],
89114
"properties": {
90115
"roleDefinitionId": "[variables('blobDataContributorRoleId')]",
91116
"principalId": "[parameters('testApplicationOid')]"
@@ -95,7 +120,9 @@
95120
"type": "Microsoft.Authorization/roleAssignments",
96121
"apiVersion": "[variables('authorizationApiVersion')]",
97122
"name": "[guid(concat('blobDataOwnerRoleId', variables('storageAccountName')))]",
98-
"dependsOn": ["[variables('storageAccountName')]"],
123+
"dependsOn": [
124+
"[variables('storageAccountName')]"
125+
],
99126
"properties": {
100127
"roleDefinitionId": "[variables('blobDataOwnerRoleId')]",
101128
"principalId": "[parameters('testApplicationOid')]"
@@ -134,13 +161,17 @@
134161
"name": "default",
135162
"type": "blobServices",
136163
"apiVersion": "[variables('storageApiVersion')]",
137-
"dependsOn": ["[variables('storageAccountName')]"],
164+
"dependsOn": [
165+
"[variables('storageAccountName')]"
166+
],
138167
"properties": {
139168
"isVersioningEnabled": "[parameters('enableVersioning')]",
140169
"cors": {
141170
"corsRules": [
142171
{
143-
"allowedOrigins": ["*"],
172+
"allowedOrigins": [
173+
"*"
174+
],
144175
"allowedMethods": [
145176
"DELETE",
146177
"GET",
@@ -152,16 +183,22 @@
152183
"PATCH"
153184
],
154185
"maxAgeInSeconds": 86400,
155-
"exposedHeaders": ["*"],
156-
"allowedHeaders": ["*"]
186+
"exposedHeaders": [
187+
"*"
188+
],
189+
"allowedHeaders": [
190+
"*"
191+
]
157192
}
158193
]
159194
},
160195
"lastAccessTimeTrackingPolicy": {
161196
"enable": true,
162197
"name": "AccessTimeTracking",
163198
"trackingGranularityInDays": 1,
164-
"blobType": ["blockBlob"]
199+
"blobType": [
200+
"blockBlob"
201+
]
165202
}
166203
},
167204
"resources": []
@@ -170,16 +207,32 @@
170207
"name": "default",
171208
"type": "fileServices",
172209
"apiVersion": "[variables('storageApiVersion')]",
173-
"dependsOn": ["[variables('storageAccountName')]"],
210+
"dependsOn": [
211+
"[variables('storageAccountName')]"
212+
],
174213
"properties": {
175214
"cors": {
176215
"corsRules": [
177216
{
178-
"allowedOrigins": ["*"],
179-
"allowedMethods": ["DELETE", "GET", "HEAD", "MERGE", "POST", "OPTIONS", "PUT"],
217+
"allowedOrigins": [
218+
"*"
219+
],
220+
"allowedMethods": [
221+
"DELETE",
222+
"GET",
223+
"HEAD",
224+
"MERGE",
225+
"POST",
226+
"OPTIONS",
227+
"PUT"
228+
],
180229
"maxAgeInSeconds": 86400,
181-
"exposedHeaders": ["*"],
182-
"allowedHeaders": ["*"]
230+
"exposedHeaders": [
231+
"*"
232+
],
233+
"allowedHeaders": [
234+
"*"
235+
]
183236
}
184237
]
185238
}
@@ -210,9 +263,11 @@
210263
],
211264
"properties": {
212265
"customSubDomainName": "[variables('cognitiveAccountName')]",
213-
"userOwnedStorage": [{
214-
"resourceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
215-
}]
266+
"userOwnedStorage": [
267+
{
268+
"resourceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
269+
}
270+
]
216271
},
217272
"identity": {
218273
"type": "SystemAssigned"
@@ -244,9 +299,9 @@
244299
"type": "string",
245300
"value": "[concat('https://', variables('cognitiveAccountName'), parameters('cognitiveServicesEndpointSuffix'), '/')]"
246301
},
247-
"STORAGE_ACCOUNT_NAME": {
302+
"STORAGE_ENDPOINT": {
248303
"type": "string",
249-
"value": "[variables('storageAccountName')]"
304+
"value": "[concat('https://', variables('storageAccountName'), parameters('storageServicesEndpointSuffix'), '/')]"
250305
}
251306
}
252307
}

0 commit comments

Comments
 (0)