Skip to content

Fix variable assignments in Azure CLI commands#128613

Open
atsushina wants to merge 1 commit into
MicrosoftDocs:mainfrom
atsushina:patch-13
Open

Fix variable assignments in Azure CLI commands#128613
atsushina wants to merge 1 commit into
MicrosoftDocs:mainfrom
atsushina:patch-13

Conversation

@atsushina

Copy link
Copy Markdown
Contributor

Azure CLI script is wrong and it doesn't work.
I'm proposing the fixed code.

Azure CLI script is wrong and it doesn't work.
I'm proposing the fixed code
@prmerger-automator

Copy link
Copy Markdown
Contributor

@atsushina : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

1 similar comment
@prmerger-automator

Copy link
Copy Markdown
Contributor

@atsushina : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit f3f5715:

✅ Validation status: passed

File Status Preview URL Details
articles/app-service/includes/tutorial-microsoft-graph-as-app/introduction.md ✅Succeeded

For more details, please refer to the build report.

@Court72 Court72 requested a review from Copilot July 6, 2026 14:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +93 to 105
$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"
Comment on lines +103 to 105
$body="{'principalId':'$spId','resourceId':'$graphResourceId','appRoleId':'$appRoleId'}"

az rest --method post --uri $uri --body $body --headers "Content-Type=application/json"
@Court72

Court72 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@cephalin

Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator Bot added the aq-pr-triaged tracking label for the PR review team label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants