File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -227,21 +227,23 @@ steps:
227227 ls -la
228228 DEFS_FOUND=$(az role definition list \
229229 --name "$ACNCI_BUILDUSER_ROLE_NAME" \
230- --resource-group "$ACNCI_BUILDUSER_ROLE_NAME" \
231230 --custom-role-only -ojson | jq length)
232231
233232 DEF=$(cat ./azure-container-networking/.pipelines/templates/mi-build-role.json | \
234233 jq -rc \
235- --arg RESOURCEID "$ACNCI_BUILD_RESOURCEGROUP_ID " \
234+ --arg RESOURCEID "/subscriptions/$SUBSCRIPTION_ID " \
236235 '.assignableScopes[] = $RESOURCEID')
237236
238237 echo $DEF | jq .
239238 if (( $DEFS_FOUND < 1 )); then
240239 az role definition create \
241240 --role-definition "$DEF"
242- else
241+ else if (( $DEFS_FOUND == 0 )); then
243242 az role definition update \
244243 --role-definition "$DEF"
244+ else
245+ echo >&2 "##[error]There was an error creating/updating the role definition."
246+ exit 1
245247 fi
246248 env :
247249 ACNCI_BUILD_RESOURCEGROUP_ID : $(resourcegroups.ACNCI_BUILD_RESOURCEGROUP_ID)
You can’t perform that action at this time.
0 commit comments