File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -258,16 +258,19 @@ steps:
258258 set -e
259259 [[ -n $SYSTEM_DEBUG ]] && [[ $SYSTEM_DEBUG =~ $IS_TRUE ]] && set -x || set +x
260260
261+ R_QUERY="[? principalId == '$ACNCI_MANAGEDIDENTITY_OBJECTID' ]"
261262 MI_ROLE_DATA=$(az role assignment list \
262263 --role "$ACNCI_BUILDUSER_ROLE_NAME"
263- --assignee "$ACNCI_MANAGEDIDENTITY_OBJECTID" \
264+ --resource-group "$ACNCI_BUILD_RESOURCEGROUP"
265+ --query "$R_QUERY"
264266 --output json | jq -rc '.')
265267 MI_ROLE_DATA_LENGTH=$(echo "$MA_ROLE_DATA" | jq length)
266268 echo >&2 "##vso[task.setvariable variable=MI_ROLE_DATA;]$MI_ROLE_DATA"
267269 echo >&2 "##vso[task.setvariable variable=MI_ROLE_LENGTH;]$MI_ROLE_DATA_LENGTH"
268270 env :
269271 ACNCI_BUILDUSER_ROLE_NAME : $(ACNCI_BUILDUSER_ROLE_NAME)
270272 ACNCI_MANAGEDIDENTITY_OBJECTID : $(managedidentity.ACNCI_MANAGEDIDENTITY_OBJECTID)
273+ ACNCI_BUILD_RESOURCEGROUP : $(resourcegroups.ACNCI_BUILD_RESOURCEGROUP)
271274
272275- task : AzureCLI@2
273276 displayName : " [Provision] Build User ManagedIdentity Roles"
@@ -301,7 +304,7 @@ steps:
301304 ACNCI_MANAGEDIDENTITY_OBJECTID : $(managedidentity.ACNCI_MANAGEDIDENTITY_OBJECTID)
302305 ACNCI_BUILDUSER_ROLE_NAME : $(ACNCI_BUILDUSER_ROLE_NAME)
303306 MI_ROLE_DATA : $(MI_ROLE_DATA)
304- MI_ROLE_DATALENGTH : $(MI_ROLE_DATA_LENGTH)
307+ MI_ROLE_DATA_LENGTH : $(MI_ROLE_DATA_LENGTH)
305308
306309
307310# - task: AzureCLI@2
You can’t perform that action at this time.
0 commit comments