我正在尝试从 Azure 应用程序注册中删除特定 URL。我尝试了以下命令。
az ad app update --id <app-id> --remove web-redirect-uris 0
我使用“0”(索引),因为它不允许我们删除 URL 值。但它给出了以下错误。
Couldn't find 'web' in 'web.redirect'. Available options: []
已更新
az rest \
--method PATCH \
--uri "https://graph.microsoft.com/v1.0/applications/<object-id>" \
--headers 'Content-Type=application/json' \
--body “{web:{redirectUris: https://URL1}}”
unrecognized arguments: https://URL1}}”
新
az rest \
--method "delete" \
--uri "https://graph.microsoft.com/v1.0/applications/<object-id>" \
--headers "{'Content-Type': 'application/json'}" \
--body "{'web': 'redirectUris': [ 'https://URL1' ] }"
最佳答案
自 2022 年 8 月起,不再支持它(由于 MS Graph 迁移)。
来自documentation :
Generic update arguments
--add
,--set
and--remove
currently don't work. You may useaz rest
to directly call Microsoft Graph API for non-supported properties.
您可以在此处跟踪 github 问题:Azure CLI cannot set values on nested properties .
所以在你的情况下类似的东西应该有效
az rest \
--method "patch" \
--uri "https://graph.microsoft.com/v1.0/applications/<object-id>" \
--headers "{'Content-Type': 'application/json'}" \
--body "{'web': 'redirectUris': [ 'https://URL1' ] }"
关于azure - 无法从 Azure 应用程序注册中删除 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73276735/