@@ -224,8 +224,8 @@ steps:
224224 echo >&2 "##vso[task.setvariable variable=ACNCI_MANAGEDIDENTITY_ID;isoutput=true]$MI_ID"
225225 MI_PRINCIPALID=$(echo "$MI_DATA" | jq -r '.principalId')
226226 echo >&2 "##vso[task.setvariable variable=ACNCI_MANAGEDIDENTITY_OBJECTID;isoutput=true]$MI_PRINCIPALID"
227- MI_ID =$(echo "$MI_DATA" | jq -r '.clientId')
228- echo >&2 "##vso[task.setvariable variable=ACNCI_MANAGEDIDENTITY_APPID;isoutput=true]$MI_ID "
227+ MI_APPID =$(echo "$MI_DATA" | jq -r '.clientId')
228+ echo >&2 "##vso[task.setvariable variable=ACNCI_MANAGEDIDENTITY_APPID;isoutput=true]$MI_APPID "
229229 MI_NAME=$(echo "$MI_DATA" | jq -r '.name')
230230 echo >&2 "##vso[task.setvariable variable=ACNCI_MANAGEDIDENTITY_NAME;isoutput=true]$MI_NAME"
231231 env :
@@ -307,16 +307,16 @@ steps:
307307
308308 if [[ -n $MI_ROLE_DATA_LENGTH ]] && \
309309 [[ $MI_ROLE_DATA != null ]] && \
310- (( $MI_ROLE_DATA_LENGTH > 0 )); then
311- az role assignment create \
312- --role "$ACNCI_BUILDUSER_ROLE_NAME"
310+ (( " $MI_ROLE_DATA_LENGTH" > 0 )); then
311+ az role assignment update \
312+ --role "$ACNCI_BUILDUSER_ROLE_NAME" \
313313 --assignee-object-id "$ACNCI_MANAGEDIDENTITY_OBJECTID" \
314314 --assignee-principal-type ServicePrincipal \
315315 --scope "$ACNCI_BUILD_RESOURCEGROUP_ID"
316316
317317 else
318- az role assignment update \
319- --role "$ACNCI_BUILDUSER_ROLE_NAME"
318+ az role assignment create \
319+ --role "$ACNCI_BUILDUSER_ROLE_NAME" \
320320 --assignee-object-id "$ACNCI_MANAGEDIDENTITY_OBJECTID" \
321321 --assignee-principal-type ServicePrincipal \
322322 --scope "$ACNCI_BUILD_RESOURCEGROUP_ID"
0 commit comments