gpt4 book ai didi

azure - Get-AzApiManagementSubscription 命令返回订阅列表,但键值为空

转载 作者:行者123 更新时间:2023-12-03 07:02:35 26 4
gpt4 key购买 nike

当我在我的机器上运行命令时

$apimContext = New-AzApiManagementContext -ResourceGroupName "xxxxxxxxxxxxx" -ServiceName "xxxxxxxxx"

Get-AzApiManagementProduct -Context $apimContext -ProductId "xxxxxxxxx"

Get-AzApiManagementSubscription -Context $apimContext -ProductId "xxxxxxxxx"

结果是一个带有空键的订阅对象

SubscriptionId    : xxxxxxxxxxxxxxxx
UserId : 1
OwnerId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxx
xxxx/providers/Microsoft.ApiManagement/service/xxxxx
xxxxx/users/1
ProductId : xxxxxx
Scope : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxx
xxxx/providers/Microsoft.ApiManagement/service/xxxxx
xxxx/products/xxxxxx
Name :
State : Active
CreatedDate : 29/04/2022 15:03:33
StartDate : 29/04/2022 00:00:00
ExpirationDate :
EndDate :
NotificationDate :
PrimaryKey :
SecondaryKey :
StateComment :
AllowTracing : True
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxx
xxxxx/providers/Microsoft.ApiManagement/service/xxxxx
xxxx/products/xxxxxx/subscriptions/xxxxxxxxxxxxxxx
ResourceGroupName : xxxxxxxxxxxxxx
ServiceName : xxxxxxxxxxx

正如我们所看到的,键显示为空,但在文档示例中它提供了值。如果我使用我的帐户访问 Azure 门户,我可以看到这些值

enter image description here

在个人计算机或 azure 管道中运行时,我可以做些什么来获取关键值吗?

最佳答案

代码结果示例与 Get-AzApiManagementSubscription 的文档冲突

The Get-AzApiManagementSubscription cmdlet gets a specifiedsubscription, or all subscriptions, if no subscription is specified.Keys will not be included into result details. To get keys, useGet-AzApiManagementSubscriptionKey.

参见Get-AzApiManagementSubscriptionKey

关于azure - Get-AzApiManagementSubscription 命令返回订阅列表,但键值为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72102215/

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