Fix variable assignments in Azure CLI commands#128613
Conversation
Azure CLI script is wrong and it doesn't work. I'm proposing the fixed code
|
@atsushina : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
1 similar comment
|
@atsushina : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
|
Learn Build status updates of commit f3f5715: ✅ Validation status: passed
For more details, please refer to the build report. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR aims to fix a non-working Azure CLI snippet in the App Service tutorial by adjusting how variables are assigned before calling az rest.
Changes:
- Updated variable assignments in the Azure CLI example to use
$variable=...form. - Wrapped the REST URI and body values in double quotes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $webAppName="SecureWebApp-20201106120003" | ||
|
|
||
| spId=$(az resource list -n $webAppName --query [*].identity.principalId --out tsv) | ||
| $spId=$(az resource list -n $webAppName --query [*].identity.principalId --out tsv) | ||
|
|
||
| graphResourceId=$(az ad sp list --display-name "Microsoft Graph" --query [0].id --out tsv) | ||
| $graphResourceId=$(az ad sp list --display-name "Microsoft Graph" --query [0].id --out tsv) | ||
|
|
||
| appRoleId=$(az ad sp list --display-name "Microsoft Graph" --query "[0].appRoles[?value=='User.Read.All' && contains(allowedMemberTypes, 'Application')].id" --output tsv) | ||
| $appRoleId=$(az ad sp list --display-name "Microsoft Graph" --query "[0].appRoles[?value=='User.Read.All' && contains(allowedMemberTypes, 'Application')].id" --output tsv) | ||
|
|
||
| uri=https://graph.microsoft.com/v1.0/servicePrincipals/$spId/appRoleAssignments | ||
| $uri="https://graph.microsoft.com/v1.0/servicePrincipals/$spId/appRoleAssignments" | ||
|
|
||
| body="{'principalId':'$spId','resourceId':'$graphResourceId','appRoleId':'$appRoleId'}" | ||
| $body="{'principalId':'$spId','resourceId':'$graphResourceId','appRoleId':'$appRoleId'}" | ||
|
|
||
| az rest --method post --uri $uri --body $body --headers "Content-Type=application/json" |
| $body="{'principalId':'$spId','resourceId':'$graphResourceId','appRoleId':'$appRoleId'}" | ||
|
|
||
| az rest --method post --uri $uri --body $body --headers "Content-Type=application/json" |
|
Can you review the proposed changes? Important: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
Azure CLI script is wrong and it doesn't work.
I'm proposing the fixed code.