|
50 | 50 | "cognitiveServicesEndpointSuffix": {
|
51 | 51 | "type": "string",
|
52 | 52 | "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" |
53 | 61 | }
|
54 | 62 | },
|
55 | 63 | "variables": {
|
|
81 | 89 | "containerName": "documents"
|
82 | 90 | },
|
83 | 91 | "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 | + }, |
84 | 107 | {
|
85 | 108 | "type": "Microsoft.Authorization/roleAssignments",
|
86 | 109 | "apiVersion": "[variables('authorizationApiVersion')]",
|
87 | 110 | "name": "[guid(concat('blobDataContributorRoleId', variables('storageAccountName')))]",
|
88 |
| - "dependsOn": ["[variables('storageAccountName')]"], |
| 111 | + "dependsOn": [ |
| 112 | + "[variables('storageAccountName')]" |
| 113 | + ], |
89 | 114 | "properties": {
|
90 | 115 | "roleDefinitionId": "[variables('blobDataContributorRoleId')]",
|
91 | 116 | "principalId": "[parameters('testApplicationOid')]"
|
|
95 | 120 | "type": "Microsoft.Authorization/roleAssignments",
|
96 | 121 | "apiVersion": "[variables('authorizationApiVersion')]",
|
97 | 122 | "name": "[guid(concat('blobDataOwnerRoleId', variables('storageAccountName')))]",
|
98 |
| - "dependsOn": ["[variables('storageAccountName')]"], |
| 123 | + "dependsOn": [ |
| 124 | + "[variables('storageAccountName')]" |
| 125 | + ], |
99 | 126 | "properties": {
|
100 | 127 | "roleDefinitionId": "[variables('blobDataOwnerRoleId')]",
|
101 | 128 | "principalId": "[parameters('testApplicationOid')]"
|
|
134 | 161 | "name": "default",
|
135 | 162 | "type": "blobServices",
|
136 | 163 | "apiVersion": "[variables('storageApiVersion')]",
|
137 |
| - "dependsOn": ["[variables('storageAccountName')]"], |
| 164 | + "dependsOn": [ |
| 165 | + "[variables('storageAccountName')]" |
| 166 | + ], |
138 | 167 | "properties": {
|
139 | 168 | "isVersioningEnabled": "[parameters('enableVersioning')]",
|
140 | 169 | "cors": {
|
141 | 170 | "corsRules": [
|
142 | 171 | {
|
143 |
| - "allowedOrigins": ["*"], |
| 172 | + "allowedOrigins": [ |
| 173 | + "*" |
| 174 | + ], |
144 | 175 | "allowedMethods": [
|
145 | 176 | "DELETE",
|
146 | 177 | "GET",
|
|
152 | 183 | "PATCH"
|
153 | 184 | ],
|
154 | 185 | "maxAgeInSeconds": 86400,
|
155 |
| - "exposedHeaders": ["*"], |
156 |
| - "allowedHeaders": ["*"] |
| 186 | + "exposedHeaders": [ |
| 187 | + "*" |
| 188 | + ], |
| 189 | + "allowedHeaders": [ |
| 190 | + "*" |
| 191 | + ] |
157 | 192 | }
|
158 | 193 | ]
|
159 | 194 | },
|
160 | 195 | "lastAccessTimeTrackingPolicy": {
|
161 | 196 | "enable": true,
|
162 | 197 | "name": "AccessTimeTracking",
|
163 | 198 | "trackingGranularityInDays": 1,
|
164 |
| - "blobType": ["blockBlob"] |
| 199 | + "blobType": [ |
| 200 | + "blockBlob" |
| 201 | + ] |
165 | 202 | }
|
166 | 203 | },
|
167 | 204 | "resources": []
|
|
170 | 207 | "name": "default",
|
171 | 208 | "type": "fileServices",
|
172 | 209 | "apiVersion": "[variables('storageApiVersion')]",
|
173 |
| - "dependsOn": ["[variables('storageAccountName')]"], |
| 210 | + "dependsOn": [ |
| 211 | + "[variables('storageAccountName')]" |
| 212 | + ], |
174 | 213 | "properties": {
|
175 | 214 | "cors": {
|
176 | 215 | "corsRules": [
|
177 | 216 | {
|
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 | + ], |
180 | 229 | "maxAgeInSeconds": 86400,
|
181 |
| - "exposedHeaders": ["*"], |
182 |
| - "allowedHeaders": ["*"] |
| 230 | + "exposedHeaders": [ |
| 231 | + "*" |
| 232 | + ], |
| 233 | + "allowedHeaders": [ |
| 234 | + "*" |
| 235 | + ] |
183 | 236 | }
|
184 | 237 | ]
|
185 | 238 | }
|
|
210 | 263 | ],
|
211 | 264 | "properties": {
|
212 | 265 | "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 | + ] |
216 | 271 | },
|
217 | 272 | "identity": {
|
218 | 273 | "type": "SystemAssigned"
|
|
244 | 299 | "type": "string",
|
245 | 300 | "value": "[concat('https://', variables('cognitiveAccountName'), parameters('cognitiveServicesEndpointSuffix'), '/')]"
|
246 | 301 | },
|
247 |
| - "STORAGE_ACCOUNT_NAME": { |
| 302 | + "STORAGE_ENDPOINT": { |
248 | 303 | "type": "string",
|
249 |
| - "value": "[variables('storageAccountName')]" |
| 304 | + "value": "[concat('https://', variables('storageAccountName'), parameters('storageServicesEndpointSuffix'), '/')]" |
250 | 305 | }
|
251 | 306 | }
|
252 | 307 | }
|
0 commit comments