You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
az role assignment create --assignee-object-id $MI_PRINCIPAL_ID --assignee-principal-type ServicePrincipal --role "API Management Service Contributor" --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$apimRg"
az role assignment create --assignee-object-id "$MI_PRINCIPAL_ID" --assignee-principal-type ServicePrincipal --role "API Management Service Contributor" --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$apim_rg"
370
+
apim_instance_var="APIM_INSTANCE_\${env_upper}"
371
+
apim_instance_id="\${!apim_instance_var}"
372
+
373
+
echo "Assigning roles for $env environment (APIM: $apim_instance_id)"
374
+
375
+
# API Management Service Reader Role (for extract pipeline)
376
+
az role assignment create \\
377
+
--assignee-object-id "$MI_PRINCIPAL_ID" \\
378
+
--assignee-principal-type ServicePrincipal \\
379
+
--role "API Management Service Reader Role" \\
380
+
--scope "$apim_instance_id"
381
+
382
+
# API Management Service Contributor (for publish pipeline)
383
+
az role assignment create \\
384
+
--assignee-object-id "$MI_PRINCIPAL_ID" \\
385
+
--assignee-principal-type ServicePrincipal \\
386
+
--role "API Management Service Contributor" \\
387
+
--scope "$apim_instance_id"
338
388
done
389
+
390
+
echo ""
391
+
echo "ℹ️ Note: RBAC role assignments can take 5-10 minutes to propagate."
az role assignment list --assignee "$MI_PRINCIPAL_ID" --scope "$apim_instance_id" --query "[].{Role:roleDefinitionName, Scope:scope}" -o table
417
+
done
418
+
\`\`\`
419
+
420
+
> **Expected Output:** You should see both "API Management Service Reader Role" and "API Management Service Contributor" roles listed for each environment.
421
+
341
422
---
342
423
343
424
## Step 3: Configure Azure DevOps CLI
@@ -524,7 +605,7 @@ az pipelines variable-group create \`
0 commit comments