azure - 无法从 Azure 应用程序注册中删除 URL

标签 azure azure-cli azure-app-registration

我正在尝试从 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 use az 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/

相关文章:

Azure AD 管理员同意吗? Multi-Tenancy 应用程序管理

Azure 应用程序注册获得 Multi-Tenancy 应用程序的同意日期

python - 创建 Azure Blob 服务容器并使其可供公开读取

azure - 无法使用 Web 平台安装程序安装 Service Bus 1.1

bash - 如何直接在bash脚本中运行PowerShell核心命令?

regex - Azure CLI\Powershell 如何排除要求

azure - 在 Azure ML 上将 csv 文件注册为 mltable 时出错 : "A well-defined MLTable file was not found at the root of the selected folder."

azure - 如何在 Azure Devops 上安装多个 .NET Core SDK 版本

linux - 如何修复 bash az 命令未找到

azure - Azure Active Directory 应用程序中的应用程序角色和组声明(作为角色发出)