21
21
"testApplicationOid" : {
22
22
"type" : " string" ,
23
23
"metadata" : {
24
- "description" : " The AAD Client ID of the test application service principal ."
24
+ "description" : " The client OID to grant access to test resources ."
25
25
}
26
26
},
27
27
"tenantId" : {
28
28
"type" : " string" ,
29
+ "defaultValue" : " 72f988bf-86f1-41af-91ab-2d7cd011db47" ,
29
30
"metadata" : {
30
- "description" : " The tenant id to which the application and resources belong."
31
+ "description" : " The tenant ID to which the application and resources belong."
31
32
}
32
33
},
33
34
"testApplicationId" : {
34
35
"type" : " string" ,
35
36
"metadata" : {
36
- "description" : " The application client id used to run tests."
37
+ "description" : " The application client ID used to run tests."
37
38
}
38
39
},
39
40
"testApplicationSecret" : {
42
43
"description" : " The application client secret used to run tests."
43
44
}
44
45
},
46
+ "enableVersioning" : {
47
+ "type" : " bool" ,
48
+ "defaultValue" : false
49
+ },
45
50
"cognitiveServicesEndpointSuffix" : {
46
51
"type" : " string" ,
47
52
"defaultValue" : " .cognitiveservices.azure.com"
48
53
}
49
54
},
50
55
"variables" : {
51
56
"taRoleId" : " [concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/a97b65f3-24c7-4388-baec-2e87135dc908')]" ,
52
- "accountName" : " [format('textanalytics-{0}', parameters('baseName'))]"
57
+ "cognitiveAccountName" : " [format('textanalytics-{0}', parameters('baseName'))]" ,
58
+ "cognitiveApiVersion" : " 2022-12-01" ,
59
+ "storageApiVersion" : " 2022-09-01" ,
60
+ "storageAccountName" : " [parameters('baseName')]" ,
61
+ "authorizationApiVersion" : " 2018-09-01-preview" ,
62
+ "blobDataContributorRoleId" : " [concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe')]" ,
63
+ "blobDataOwnerRoleId" : " [concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/b7e6dc6d-f1e8-4753-8033-0f276bb0955b')]" ,
64
+ "encryption" : {
65
+ "services" : {
66
+ "file" : {
67
+ "enabled" : true
68
+ },
69
+ "blob" : {
70
+ "enabled" : true
71
+ }
72
+ },
73
+ "keySource" : " Microsoft.Storage"
74
+ },
75
+ "networkAcls" : {
76
+ "bypass" : " AzureServices" ,
77
+ "virtualNetworkRules" : [],
78
+ "ipRules" : [],
79
+ "defaultAction" : " Allow"
80
+ },
81
+ "containerName" : " documents"
53
82
},
54
83
"resources" : [
84
+ {
85
+ "type" : " Microsoft.Authorization/roleAssignments" ,
86
+ "apiVersion" : " [variables('authorizationApiVersion')]" ,
87
+ "name" : " [guid(concat('blobDataContributorRoleId', variables('storageAccountName')))]" ,
88
+ "dependsOn" : [" [variables('storageAccountName')]" ],
89
+ "properties" : {
90
+ "roleDefinitionId" : " [variables('blobDataContributorRoleId')]" ,
91
+ "principalId" : " [parameters('testApplicationOid')]"
92
+ }
93
+ },
94
+ {
95
+ "type" : " Microsoft.Authorization/roleAssignments" ,
96
+ "apiVersion" : " [variables('authorizationApiVersion')]" ,
97
+ "name" : " [guid(concat('blobDataOwnerRoleId', variables('storageAccountName')))]" ,
98
+ "dependsOn" : [" [variables('storageAccountName')]" ],
99
+ "properties" : {
100
+ "roleDefinitionId" : " [variables('blobDataOwnerRoleId')]" ,
101
+ "principalId" : " [parameters('testApplicationOid')]"
102
+ }
103
+ },
55
104
{
56
105
"type" : " Microsoft.CognitiveServices/accounts/providers/roleAssignments" ,
57
- "apiVersion" : " 2018-09-01-preview " ,
58
- "name" : " [format('{0}/Microsoft.Authorization/{1}', variables('accountName '), guid(variables('accountName ')))]" ,
106
+ "apiVersion" : " [variables('authorizationApiVersion')] " ,
107
+ "name" : " [format('{0}/Microsoft.Authorization/{1}', variables('cognitiveAccountName '), guid(variables('cognitiveAccountName ')))]" ,
59
108
"dependsOn" : [
60
- " [resourceId('Microsoft.CognitiveServices/accounts', variables('accountName '))]"
109
+ " [resourceId('Microsoft.CognitiveServices/accounts', variables('cognitiveAccountName '))]"
61
110
],
62
111
"properties" : {
63
112
"principalId" : " [parameters('testApplicationOid')]" ,
64
113
"roleDefinitionId" : " [variables('taRoleId')]"
65
114
}
66
115
},
116
+ {
117
+ "type" : " Microsoft.Storage/storageAccounts" ,
118
+ "apiVersion" : " [variables('storageApiVersion')]" ,
119
+ "name" : " [variables('storageAccountName')]" ,
120
+ "location" : " [parameters('location')]" ,
121
+ "sku" : {
122
+ "name" : " Standard_LRS" ,
123
+ "tier" : " Standard"
124
+ },
125
+ "kind" : " StorageV2" ,
126
+ "properties" : {
127
+ "networkAcls" : " [variables('networkAcls')]" ,
128
+ "supportsHttpsTrafficOnly" : true ,
129
+ "encryption" : " [variables('encryption')]" ,
130
+ "accessTier" : " Hot"
131
+ },
132
+ "resources" : [
133
+ {
134
+ "name" : " default" ,
135
+ "type" : " blobServices" ,
136
+ "apiVersion" : " [variables('storageApiVersion')]" ,
137
+ "dependsOn" : [" [variables('storageAccountName')]" ],
138
+ "properties" : {
139
+ "isVersioningEnabled" : " [parameters('enableVersioning')]" ,
140
+ "cors" : {
141
+ "corsRules" : [
142
+ {
143
+ "allowedOrigins" : [" *" ],
144
+ "allowedMethods" : [
145
+ " DELETE" ,
146
+ " GET" ,
147
+ " HEAD" ,
148
+ " MERGE" ,
149
+ " POST" ,
150
+ " OPTIONS" ,
151
+ " PUT" ,
152
+ " PATCH"
153
+ ],
154
+ "maxAgeInSeconds" : 86400 ,
155
+ "exposedHeaders" : [" *" ],
156
+ "allowedHeaders" : [" *" ]
157
+ }
158
+ ]
159
+ },
160
+ "lastAccessTimeTrackingPolicy" : {
161
+ "enable" : true ,
162
+ "name" : " AccessTimeTracking" ,
163
+ "trackingGranularityInDays" : 1 ,
164
+ "blobType" : [" blockBlob" ]
165
+ }
166
+ },
167
+ "resources" : []
168
+ },
169
+ {
170
+ "name" : " default" ,
171
+ "type" : " fileServices" ,
172
+ "apiVersion" : " [variables('storageApiVersion')]" ,
173
+ "dependsOn" : [" [variables('storageAccountName')]" ],
174
+ "properties" : {
175
+ "cors" : {
176
+ "corsRules" : [
177
+ {
178
+ "allowedOrigins" : [" *" ],
179
+ "allowedMethods" : [" DELETE" , " GET" , " HEAD" , " MERGE" , " POST" , " OPTIONS" , " PUT" ],
180
+ "maxAgeInSeconds" : 86400 ,
181
+ "exposedHeaders" : [" *" ],
182
+ "allowedHeaders" : [" *" ]
183
+ }
184
+ ]
185
+ }
186
+ },
187
+ "resources" : []
188
+ }
189
+ ]
190
+ },
191
+ {
192
+ "type" : " Microsoft.Storage/storageAccounts/blobServices/containers" ,
193
+ "apiVersion" : " [variables('storageApiVersion')]" ,
194
+ "name" : " [format('{0}/default/{1}', variables('storageAccountName'), variables('containerName'))]" ,
195
+ "dependsOn" : [
196
+ " [resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
197
+ ]
198
+ },
67
199
{
68
200
"type" : " Microsoft.CognitiveServices/accounts" ,
69
- "name" : " [variables('accountName ')]" ,
70
- "apiVersion" : " 2017-04-18 " ,
201
+ "name" : " [variables('cognitiveAccountName ')]" ,
202
+ "apiVersion" : " [variables('cognitiveApiVersion')] " ,
71
203
"sku" : {
72
204
"name" : " S"
73
205
},
74
206
"kind" : " TextAnalytics" ,
75
207
"location" : " [parameters('location')]" ,
208
+ "dependsOn" : [
209
+ " [resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
210
+ ],
76
211
"properties" : {
77
- "customSubDomainName" : " [variables('accountName')]"
212
+ "customSubDomainName" : " [variables('cognitiveAccountName')]" ,
213
+ "userOwnedStorage" : [{
214
+ "resourceId" : " [resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
215
+ }]
216
+ },
217
+ "identity" : {
218
+ "type" : " SystemAssigned"
78
219
}
79
220
}
80
221
],
93
234
},
94
235
"LANGUAGE_API_KEY" : {
95
236
"type" : " string" ,
96
- "value" : " [listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('accountName ')), '2017-04-18' ).key1]"
237
+ "value" : " [listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('cognitiveAccountName ')), variables('cognitiveApiVersion') ).key1]"
97
238
},
98
239
"LANGUAGE_API_KEY_ALT" : {
99
240
"type" : " string" ,
100
- "value" : " [listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('accountName ')), '2017-04-18' ).key2]"
241
+ "value" : " [listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('cognitiveAccountName ')), variables('cognitiveApiVersion') ).key2]"
101
242
},
102
243
"ENDPOINT" : {
103
244
"type" : " string" ,
104
- "value" : " [concat('https://', variables('accountName'), parameters('cognitiveServicesEndpointSuffix'), '/')]"
245
+ "value" : " [concat('https://', variables('cognitiveAccountName'), parameters('cognitiveServicesEndpointSuffix'), '/')]"
246
+ },
247
+ "STORAGE_ACCOUNT_NAME" : {
248
+ "type" : " string" ,
249
+ "value" : " [variables('storageAccountName')]"
105
250
}
106
251
}
107
- }
252
+ }
0 commit comments