使用 Terraform 的 Azure AD 应用程序注册中的应用程序 ID URI 抛出错误

Application ID URI Throwing Error in Azure AD App Registration using Terraform

我有一个网络应用程序和相应的应用程序注册。几个月前,在应用程序注册的“公开 API”部分,我能够添加我的网络应用程序的 URI,即“https://app-coalsa-api.azurewebsites.net” 现在,当我尝试使用 Terraform 对另一个具有类似环境的项目执行相同操作时,我收到了屏幕截图中所附的错误。 知道这个错误是否是由于新的 Azure AD 提供程序而出现的,以及理想情况下应该在应用注册

中的“Expose an API”

难道这个应用注册配置为多租户?

多租户应用程序注册要求具有使用 Azure AD 租户中已验证域之一的 App ID URI。

因为 azurewebsites.net 由 Microsoft 管理,所以它不可能是您租户的已验证域,这可以解释更新失败的原因。

见下文:

For a multi-tenant application, it must be globally unique so Azure AD can find the application across all tenants. Global uniqueness is enforced by requiring the App ID URI to have a host name that matches a verified domain of the Azure AD tenant.

来自 https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-convert-app-to-be-multi-tenant#update-registration-to-be-multi-tenant.

看起来答案就在错误消息本身。您可以更新 Expose An API 中的值,可能的值为 api://{object-IF-GUID} 或 https://{FQDN}.

每当创建任何 Azure AD 应用程序注册时,它都会生成一个对象 ID,并链接在 Azure AD 中触发应用程序 ID 创建的人员。

您可以使用任何本机 Azure 服务或映射到它的任何自定义域来更新这些值,但不能更改或映射到全新的应用程序,否则会导致失败。

我已经试过了,收到以下错误信息: {"error":{"code":"HostNameNotOnVerifiedDomain","message":"identifierUris 属性 的值必须使用经过验证的组织域或其子域:'https://{test-rohit-app-name}.azurewebsites.net'","details":[{"code":"HostNameNotOnVerifiedDomain","target":"identifierUris","message":"identifierUris 的值 属性 必须使用经过验证的组织域或它的子域:'https://{test-rohit-app-name}.azurewebsites.net'"}]

在您的方案中,接受的值是 {webappname}。azurewebsites.net 或映射到此网络应用程序的自定义域。