Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az ad app update --id $clientId --reply-urls $oauthCallbackURL returns unrecognized arguments: --reply-urls #23193

Closed
dbiegunski opened this issue Jul 13, 2022 · 6 comments
Assignees
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Graph az ad
Milestone

Comments

@dbiegunski
Copy link

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command
az ad app update --id $clientId --reply-urls $oauthCallbackURL

Describe the bug
unrecognized arguments: --reply-urls

Was this flag changed by another one ? What would be the new equivalent ?

Thank you so much

@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Graph az ad labels Jul 13, 2022
@ghost ghost assigned jiasli Jul 13, 2022
@ghost ghost added this to the Backlog milestone Jul 13, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Jul 13, 2022

@jiasli for awareness

@jiasli
Copy link
Member

jiasli commented Jul 14, 2022

This is due to the Microsoft Graph migration.

  1. We documented Microsoft Graph migration at https://docs.microsoft.com/en-us/cli/azure/microsoft-graph-migration:

    Split --reply-urls into --web-redirect-uris and --public-client-redirect-uris

  2. We announced Microsoft Graph migration in the release notes for May 24, 2022 release: https://learn.microsoft.com/en-us/cli/azure/release-notes-azure-cli#may-24-2022

    [BREAKING CHANGE] az az/role: Migrate the underlying API of az ad and az role from AD Graph API to Microsoft Graph API. For more details, see Microsoft Graph migration

  3. In Azure CLI 2.34.0~2.37.0, we print an in-tool warning for Microsoft Graph migration: [Role] Add warning to role and ad commands about Microsoft Graph migration #21302
  4. We also pinned issue Azure CLI is migrated to Microsoft Graph in 2.37.0 #22580

@jiasli jiasli closed this as completed Jul 14, 2022
@farchide
Copy link

We have a managed service fabric deployment and we should set Reply-url for SPN to properly configure the Explorer. What would be the replacement for that?

@jiasli
Copy link
Member

jiasli commented Jul 15, 2022

@farchide, that depends on your scenario to choose whether --web-redirect-uris or --public-client-redirect-uris. You may contact AAD support if you have questions about the service usage.

@savcic-milorad
Copy link

I have tried updating the web.redirectUris in two ways and both of them have failed when I pass multiple redirect URIs.

Attempt 1

az ad app update --id '<client-id>' --web-redirect-uris "https://hostname.com/callbackx https://hostname.com/callbacky"

One or more properties contains invalid values.

Attempt 2
This one fails regardless of number of redirectUris that are passed

az ad app update --id '<client-id>' --set "web.redirectUris=['https://hostname.com/callbackx', 'https://hostname.com/callbacky']"

Couldn't find 'web' in ''. Available options: []

I have a scenario where my pipeline should update the app registration with an additional redirectUrl.
I have managed to extract the current web.redirectUris with the following:

existing_urls=$(az ad app show --id '<client-id>' --query "[web.redirectUris]" --output tsv)

I would like to achieve something like this

existing_urls=$(az ad app show --id '<client-id>' --query "[web.redirectUris]" --output tsv)
az ad app update --id '<client-id>' --web-redirect-uris "$existing_urls https://hostname.com/newCallback"

@MoChilia
Copy link
Member

MoChilia commented Jun 6, 2023

Hi @savcic-milorad,
For Attempt 1, since --web-redirect-uris only supports space-separated values, the correct format should be

az ad app update --id '<client-id>' --web-redirect-uris "https://hostname.com/callbackx" "https://hostname.com/callbacky"

Spaces shouldn’t occur between double quotes, otherwise spaces will be parsed as literals.

For Attempt 2, this is a known issue that --set is only supported to use on the root level of a Graph object and using --set on sub-levels currently doesn't work.

For the same reason as Attempt 1, the command in the scenario you want to achieve should be

az ad app update --id '<client-id>' --web-redirect-uris $existing_urls "https://hostname.com/newCallback"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Graph az ad
Projects
None yet
Development

No branches or pull requests

6 participants