为什么AZ CLI不返回PowerShell Get-Azapimanagementsubscription查询中的主键?有办法吗?

发布于 2025-02-07 17:58:35 字数 1099 浏览 3 评论 0原文

为什么AZ CLI在PowerShell Get-azapimanagementsubscription查询中不返回primarykey?有办法吗?请参阅下面,主要私钥和次要私钥都是空的。我可能需要特别的许可吗?

PS /Users/me> Get-AzApiManagementSubscription -Context $apimContext                                                     

SubscriptionId    : {obfuscated}
UserId            : 1
OwnerId           : /subscriptions/{obfuscated}/resourceGroups/my-test/providers/Microsoft.ApiManagement/service/my-apim-test/users/1
ProductId         : starter
Scope             : /subscriptions/{obfuscated}/resourceGroups/my-test/providers/Microsoft.ApiManagement/service/my-apim-test/products/starter
Name              : 
State             : Active
CreatedDate       : 4/23/2022 12:28:31 AM
StartDate         : 
ExpirationDate    : 
EndDate           : 
NotificationDate  : 
PrimaryKey        : 
SecondaryKey      : 
StateComment      : 
AllowTracing      : True
Id                : /subscriptions/{obfuscated}/resourceGroups/my-test/providers/Microsoft.ApiManagement/service/my-apim-test/subscriptions/{obfuscated}
ResourceGroupName : my-test
ServiceName       : my-apim-test

Why does az cli not return PrimaryKey in the powershell Get-AzApiManagementSubscription query? Is there a way? See below, both the Primary and Secondary private keys are empty. Is it a special permission I require perhaps?

PS /Users/me> Get-AzApiManagementSubscription -Context $apimContext                                                     

SubscriptionId    : {obfuscated}
UserId            : 1
OwnerId           : /subscriptions/{obfuscated}/resourceGroups/my-test/providers/Microsoft.ApiManagement/service/my-apim-test/users/1
ProductId         : starter
Scope             : /subscriptions/{obfuscated}/resourceGroups/my-test/providers/Microsoft.ApiManagement/service/my-apim-test/products/starter
Name              : 
State             : Active
CreatedDate       : 4/23/2022 12:28:31 AM
StartDate         : 
ExpirationDate    : 
EndDate           : 
NotificationDate  : 
PrimaryKey        : 
SecondaryKey      : 
StateComment      : 
AllowTracing      : True
Id                : /subscriptions/{obfuscated}/resourceGroups/my-test/providers/Microsoft.ApiManagement/service/my-apim-test/subscriptions/{obfuscated}
ResourceGroupName : my-test
ServiceName       : my-apim-test

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南渊 2025-02-14 17:58:35

要使用cmdlet在Azure APIM实例中获得订阅的主要键和次要键,请:

$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-East-US" -ServiceName "contoso"
Get-AzApiManagementSubscriptionKey -Context $apimContext -SubscriptionId "0123456789"

img src =“ https://i.sstatic.net/pwffe.png”

< :

“在此处inter

在上面的cmdlet中,订阅ID是APIM订阅的ID,如启动器,无限,无限和内置 -在所有访问中。

“在此处输入图像说明”

To get the Primary key and secondary key of subscriptions available in the Azure APIM Instance using the cmdlet is:

$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-East-US" -ServiceName "contoso"
Get-AzApiManagementSubscriptionKey -Context $apimContext -SubscriptionId "0123456789"

enter image description here

Result:

enter image description here

In the above cmdlet, Subscription Id is the Id of APIM Subscription like Starter, Unlimited, and Built-in all access.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文