@@ -236,8 +236,8 @@ steps:
236236 updateCondition : False
237237 inputs :
238238 storageAccountName : ' $(ACNCI_SA_PREFIX)$(LOCAL_ACNCI_UNIQUE_ID)'
239+ storageAccountLocation : $(resourcegroups.ACNCI_BUILD_RESOURCEGROUP_LOCATION)
239240 resourceGroupName : $(resourcegroups.ACNCI_BUILD_RESOURCEGROUP)
240- resourceGroupLocation : $(resourcegroups.ACNCI_BUILD_RESOURCEGROUP_LOCATION)
241241 managedIdentityResourceId : $(managedidentity.ACNCI_MANAGEDIDENTITY_ID)
242242 buildTagDefinitionIdKey : $(ACNCI_BUILDTAG_DEFINITIONID)
243243 buildTagCreatedByAppIdKey : $(ACNCI_BUILDTAG_CREATEDBYAPPID)
@@ -291,28 +291,6 @@ steps:
291291 SA_LIST_LENGTH : $(OUT_RESULT_LENGTH)
292292 SA_SERVICE_CONN : $(ACN_TEST_SERVICE_CONNECTION)
293293
294- - task : AzureCLI@2
295- displayName : " [Provision] Container Access Permissions"
296- continueOnError : true
297- inputs :
298- azureSubscription : $(ACN_TEST_SERVICE_CONNECTION)
299- scriptType : bash
300- scriptLocation : inlineScript
301- addSpnToEnvironment : true
302- inlineScript : |
303- set -e
304- [[ -n $SYSTEM_DEBUG ]] && [[ $SYSTEM_DEBUG =~ $IS_TRUE ]] && set -x || set +x
305-
306- az role assignment create \
307- --role "Storage Blob Data Contributor" \
308- --assignee "$ACNCI_MANAGEDIDENTITY_OBJECTID" \
309- --assignee-principal-type "ServicePrincipal" \
310- --scope "$ACNCI_STORAGEACCOUNT_ID"
311- env :
312- ACNCI_BUILD_RESOURCEGROUP_ID : $(resourcegroups.ACNCI_BUILD_RESOURCEGROUP_ID)
313- ACNCI_MANAGEDIDENTITY_OBJECTID : $(managedidentity.ACNCI_MANAGEDIDENTITY_OBJECTID)
314- ACNCI_STORAGEACCOUNT_ID : $(storageaccounts.ACNCI_STORAGEACCOUNT_ID)
315-
316294- task : AzureCLI@2
317295 name : artifact_container
318296 displayName : " [Output] Ensure Storage Container"
@@ -325,14 +303,12 @@ steps:
325303 set -e
326304 [[ -n $SYSTEM_DEBUG ]] && [[ $SYSTEM_DEBUG =~ $IS_TRUE ]] && set -x || set +x
327305
328- az login --identity "$ACNCI_MANAGEDIDENTITY_ID"
329306 az storage account show -n "$SA_NAME" --query networkRuleSet
330307 az storage container create \
331308 --account-name "$SA_NAME" \
332309 --resource-group "$RG_NAME" \
333310 --name "$CONTAINER_NAME" \
334311 --auth-mode login
335- #--public-access off
336312
337313 echo >&2 "##vso[task.setvariable variable=ACNCI_STORAGEACCOUNT_ARTIFACT_CONTAINER;isoutput=true]$CONTAINER_NAME"
338314 env :
@@ -341,6 +317,28 @@ steps:
341317 SA_NAME : $(artifact_storage.ACNCI_STORAGEACCOUNT_NAME)
342318 ACNCI_MANAGEDIDENTITY_ID : $(managedidentity.ACNCI_MANAGEDIDENTITY_ID)
343319
320+ - task : AzureCLI@2
321+ displayName : " [Provision] Container Access Permissions"
322+ continueOnError : true
323+ inputs :
324+ azureSubscription : $(ACN_TEST_SERVICE_CONNECTION)
325+ scriptType : bash
326+ scriptLocation : inlineScript
327+ addSpnToEnvironment : true
328+ inlineScript : |
329+ set -e
330+ [[ -n $SYSTEM_DEBUG ]] && [[ $SYSTEM_DEBUG =~ $IS_TRUE ]] && set -x || set +x
331+
332+ az role assignment create \
333+ --role "Storage Blob Data Contributor" \
334+ --assignee "$ACNCI_MANAGEDIDENTITY_OBJECTID" \
335+ --assignee-principal-type "ServicePrincipal" \
336+ --scope "$ACNCI_STORAGEACCOUNT_ID"
337+ env :
338+ ACNCI_BUILD_RESOURCEGROUP_ID : $(resourcegroups.ACNCI_BUILD_RESOURCEGROUP_ID)
339+ ACNCI_MANAGEDIDENTITY_OBJECTID : $(managedidentity.ACNCI_MANAGEDIDENTITY_OBJECTID)
340+ ACNCI_STORAGEACCOUNT_ID : $(storageaccounts.ACNCI_STORAGEACCOUNT_ID)
341+
344342- task : AzureCLI@2
345343 name : artifact_blob
346344 displayName : " [Output] Get Blob Path"
0 commit comments