Get-AzApiManagementSubscription 命令 returns 订阅列表,但键值为空
Get-AzApiManagementSubscription command returns the subscription list but the keys values are empty
当我 运行 在我的机器中时,命令
$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 门户,我可以看到值
当 运行 在个人计算机或 azure 管道中时,我可以做些什么来获取键值吗?
代码结果示例与 Get-AzApiManagementSubscription
的文档冲突
The Get-AzApiManagementSubscription cmdlet gets a specified
subscription, or all subscriptions, if no subscription is specified.
Keys will not be included into result details. To get keys, use
Get-AzApiManagementSubscriptionKey.
当我 运行 在我的机器中时,命令
$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 门户,我可以看到值
当 运行 在个人计算机或 azure 管道中时,我可以做些什么来获取键值吗?
代码结果示例与 Get-AzApiManagementSubscription
的文档冲突The Get-AzApiManagementSubscription cmdlet gets a specified subscription, or all subscriptions, if no subscription is specified. Keys will not be included into result details. To get keys, use Get-AzApiManagementSubscriptionKey.