|
1 | 1 | { |
2 | | - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", |
| 2 | + "$schema": "https://schema.management.azure.com/schemas/2019-08-01/deploymentTemplate.json#", |
3 | 3 | "contentVersion": "1.0.0.0", |
4 | 4 | "parameters": { |
5 | 5 | "baseName": { |
|
42 | 42 | "description": "The application client secret used to run tests." |
43 | 43 | } |
44 | 44 | }, |
45 | | - "docTranslationEndpointSuffix": { |
| 45 | + "cognitiveServicesEndpointSuffix": { |
46 | 46 | "defaultValue": ".cognitiveservices.azure.com/", |
47 | 47 | "type": "string" |
48 | 48 | }, |
| 49 | + "useStaticStorageResource": { |
| 50 | + "type": "bool", |
| 51 | + "defaultValue": false, |
| 52 | + "metadata": { |
| 53 | + "description": "A static storage resource is used for Dogfood env." |
| 54 | + } |
| 55 | + }, |
| 56 | + "staticStorageName": { |
| 57 | + "defaultValue": "pythontranslationstorage", |
| 58 | + "type": "string" |
| 59 | + }, |
49 | 60 | "blobStorageAccount": { |
50 | 61 | "type": "string", |
51 | | - "defaultValue": "[concat(parameters('baseName'), 'prim')]" |
| 62 | + "defaultValue": "[if(parameters('useStaticStorageResource'), parameters('staticStorageName'), parameters('baseName'))]" |
52 | 63 | }, |
53 | 64 | "storageAccResourceId": { |
54 | 65 | "type": "string", |
|
128 | 139 | "authorizationApiVersion": "2018-09-01-preview", |
129 | 140 | "docTranslationBaseName": "[parameters('baseName')]", |
130 | 141 | "docTranslationApiVersion": "2017-04-18", |
131 | | - "storageMgmtApiVersion": "2019-04-01", |
132 | | - "storageAccountName": "[concat(parameters('baseName'), 'prim')]", |
| 142 | + "storageMgmtApiVersion": "2017-10-01", |
| 143 | + "storageAccountName": "[parameters('blobStorageAccount')]", |
133 | 144 | "location": "[resourceGroup().location]", |
134 | | - "azureDocTranslationUrl": "[concat('https://', variables('docTranslationBaseName'), parameters('docTranslationEndpointSuffix'))]", |
| 145 | + "azureDocTranslationUrl": "[if(parameters('useStaticStorageResource'), concat('https://', variables('docTranslationBaseName'), '.ppe', parameters('cognitiveServicesEndpointSuffix')), concat('https://', variables('docTranslationBaseName'), parameters('cognitiveServicesEndpointSuffix')))]", |
135 | 146 | "azureStorageEndpoint": "[concat('https://', parameters('blobStorageAccount'), '.blob.core.windows.net/')]", |
136 | 147 | "cognitiveServiceUserRoleId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/a97b65f3-24c7-4388-baec-2e87135dc908')]", |
137 | 148 | "encryption": { |
|
176 | 187 | } |
177 | 188 | }, |
178 | 189 | { |
| 190 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
179 | 191 | "type": "Microsoft.Storage/storageAccounts", |
180 | 192 | "apiVersion": "[variables('storageMgmtApiVersion')]", |
181 | 193 | "name": "[variables('storageAccountName')]", |
|
193 | 205 | }, |
194 | 206 | "resources": [ |
195 | 207 | { |
| 208 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
196 | 209 | "type": "blobServices/containers", |
197 | 210 | "apiVersion": "[variables('storageMgmtApiVersion')]", |
198 | 211 | "name": "[concat('default/', parameters('targetContainerName_1'))]", |
|
201 | 214 | ] |
202 | 215 | }, |
203 | 216 | { |
| 217 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
204 | 218 | "type": "blobServices/containers", |
205 | 219 | "apiVersion": "[variables('storageMgmtApiVersion')]", |
206 | 220 | "name": "[concat('default/', parameters('targetContainerName_2'))]", |
|
209 | 223 | ] |
210 | 224 | }, |
211 | 225 | { |
| 226 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
212 | 227 | "type": "blobServices/containers", |
213 | 228 | "apiVersion": "[variables('storageMgmtApiVersion')]", |
214 | 229 | "name": "[concat('default/', parameters('targetContainerName_3'))]", |
|
217 | 232 | ] |
218 | 233 | }, |
219 | 234 | { |
| 235 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
220 | 236 | "type": "blobServices/containers", |
221 | 237 | "apiVersion": "[variables('storageMgmtApiVersion')]", |
222 | 238 | "name": "[concat('default/', parameters('targetContainerName_4'))]", |
223 | 239 | "dependsOn": [ |
224 | 240 | "[parameters('blobStorageAccount')]" |
225 | 241 | ] |
226 | | - }, |
| 242 | + }, |
227 | 243 | { |
| 244 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
228 | 245 | "type": "blobServices/containers", |
229 | 246 | "apiVersion": "[variables('storageMgmtApiVersion')]", |
230 | 247 | "name": "[concat('default/', parameters('sourceContainerName'))]", |
|
265 | 282 | "value": "[parameters('blobStorageAccount')]" |
266 | 283 | }, |
267 | 284 | "TRANSLATION_DOCUMENT_STORAGE_KEY": { |
| 285 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
268 | 286 | "type": "string", |
269 | 287 | "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), variables('storageMgmtApiVersion')).keys[0].value]" |
270 | 288 | }, |
|
281 | 299 | "value": "[parameters('blobStorageAccount')]" |
282 | 300 | }, |
283 | 301 | "AZURE_STORAGE_SOURCE_KEY": { |
| 302 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
284 | 303 | "type": "string", |
285 | 304 | "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), variables('storageMgmtApiVersion')).keys[0].value]" |
286 | 305 | }, |
|
289 | 308 | "value": "[variables('azureStorageEndpoint')]" |
290 | 309 | }, |
291 | 310 | "AZURE_SOURCE_CONTAINER_URL": { |
| 311 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
292 | 312 | "type": "string", |
293 | 313 | "value": "[concat(reference(parameters('storageAccResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('sourceContainerName'), '?', listServiceSas(parameters('storageAccResourceId'), '2019-06-01', parameters('sourceContainerSasProperties')).serviceSasToken)]" |
294 | 314 | }, |
295 | 315 | "AZURE_SOURCE_CONTAINER_URL_1": { |
| 316 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
296 | 317 | "type": "string", |
297 | 318 | "value": "[concat(reference(parameters('storageAccResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('sourceContainerName'), '?', listServiceSas(parameters('storageAccResourceId'), '2019-06-01', parameters('sourceContainerSasProperties')).serviceSasToken)]" |
298 | 319 | }, |
299 | 320 | "AZURE_SOURCE_CONTAINER_URL_2": { |
| 321 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
300 | 322 | "type": "string", |
301 | 323 | "value": "[concat(reference(parameters('storageAccResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('sourceContainerName'), '?', listServiceSas(parameters('storageAccResourceId'), '2019-06-01', parameters('sourceContainerSasProperties')).serviceSasToken)]" |
302 | 324 | }, |
303 | 325 | "AZURE_TRANSLATION_GLOSSARY_URL": { |
| 326 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
304 | 327 | "type": "string", |
305 | 328 | "value": "[concat(reference(parameters('storageAccResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('sourceContainerName'), '/', parameters('glossaryFileName'), '?', listServiceSas(parameters('storageAccResourceId'), '2019-06-01', parameters('sourceContainerSasProperties')).serviceSasToken)]" |
306 | 329 | }, |
307 | 330 | "AZURE_TARGET_CONTAINER_URL": { |
| 331 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
308 | 332 | "type": "string", |
309 | 333 | "value": "[concat(reference(parameters('storageAccResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('targetContainerName_1'), '?', listServiceSas(parameters('storageAccResourceId'), '2019-06-01', parameters('targetContainerSasProperties_1')).serviceSasToken)]" |
310 | 334 | }, |
311 | 335 | "AZURE_TARGET_CONTAINER_URL_FR": { |
| 336 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
312 | 337 | "type": "string", |
313 | 338 | "value": "[concat(reference(parameters('storageAccResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('targetContainerName_2'), '?', listServiceSas(parameters('storageAccResourceId'), '2019-06-01', parameters('targetContainerSasProperties_2')).serviceSasToken)]" |
314 | 339 | }, |
315 | 340 | "AZURE_TARGET_CONTAINER_URL_AR": { |
| 341 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
316 | 342 | "type": "string", |
317 | 343 | "value": "[concat(reference(parameters('storageAccResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('targetContainerName_3'), '?', listServiceSas(parameters('storageAccResourceId'), '2019-06-01', parameters('targetContainerSasProperties_3')).serviceSasToken)]" |
318 | 344 | }, |
319 | 345 | "AZURE_TARGET_CONTAINER_URL_ES": { |
| 346 | + "condition": "[not(parameters('useStaticStorageResource'))]", |
320 | 347 | "type": "string", |
321 | 348 | "value": "[concat(reference(parameters('storageAccResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('targetContainerName_4'), '?', listServiceSas(parameters('storageAccResourceId'), '2019-06-01', parameters('targetContainerSasProperties_4')).serviceSasToken)]" |
322 | 349 | } |
|
0 commit comments