gpt4 book ai didi

azure - 添加-AzureADApplicationPolicy : Error occurred while executing AddApplicationPolicy (Request_ResourceNotFound)

转载 作者:行者123 更新时间:2023-12-02 23:20:23 25 4
gpt4 key购买 nike

使用适用于 Powershell 的 AzureADPreview (2.0.1.18),我正在尝试向应用程序添加策略:

 Add-AzureADApplicationPolicy -Id dc1b1cbf-356a-4d0a-a3b2-e7a0e3125aa2 -RefObjectId 36e8328a-17b5-4d64-a12f-dfac959c3b8b

但是我得到:

Add-AzureADApplicationPolicy : Error occurred while executing AddApplicationPolicy
Code: Request_ResourceNotFound
Message: Resource 'dc1b1cbf-356a-4d0a-a3b2-e7a0e3125aa2' does not exist or one of its queried reference-property objects are not present.
InnerError:
RequestId: 0663394a-b556-4bb6-a3c1-96a8fac3e5ec
DateTimeStamp: Wed, 12 Sep 2018 09:04:58 GMT
HttpStatusCode: NotFound
HttpStatusDescription: Not Found
HttpResponseStatus: Completed
At line:1 char:1
+ Add-AzureADApplicationPolicy -Id dc1b1cbf-356a-4d0a-a3b2-e7a0e3125aa2 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-AzureADApplicationPolicy], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.MSGraphBeta.Client.ApiException,Microsoft.Open.MSGraphBeta.PowerShell.AddApplicationPolicy

看来它找不到该应用程序。但是我能够找到这样的应用程序:

Get-AzureADApplication -Filter "AppId eq 'dc1b1cbf-356a-4d0a-a3b2-e7a0e3125aa2'"

ObjectId AppId DisplayName
-------- ----- -----------
9125a684-e262-4215-8e35-5d3d628d27f2 dc1b1cbf-356a-4d0a-a3b2-e7a0e3125aa2 MyAppname

我之前已经能够使用相同的策略对同一租户执行此操作。所以发生了一些事情导致了这种情况。我已尝试为租户使用其他应用程序,但收到相同的错误。

最佳答案

您需要提供应用程序的对象 ID 而不是 applicationId

在您的情况下,对象 ID 为 9125a684-e262-4215-8e35-5d3d628d27f2

所以命令是

Add-AzureADApplicationPolicy -Id 9125a684-e262-4215-8e35-5d3d628d27f2 -RefObjectId 36e8328a-17b5-4d64-a12f-dfac959c3b8b

关于azure - 添加-AzureADApplicationPolicy : Error occurred while executing AddApplicationPolicy (Request_ResourceNotFound),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52291870/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com