如何从PowerShell获取EventHub命名空间SAS键



以前的PowerShell模块AzureRm.EventHub具有Get-AzureRmEventHubNamespaceKey,并且很容易获取键。由于Powershell V5,现在已将其删除。现在,如何获得EventHubNamespace SAS密钥。这是我在计算机中发现的PowerShell获取CMDLET的列表。

Get-AzureRmEventHub
Get-AzureRmEventHubAuthorizationRule
Get-AzureRmEventHubConsumerGroup
Get-AzureRmEventHubGeoDRConfiguration
Get-AzureRmEventHubKey
Get-AzureRmEventHubNamespace
Get-AzureRmIotHubEventHubConsumerGroup

谢谢

您可以使用Invoke-AzureRmResourceAction来做到这一点:

Invoke-AzureRmResourceAction -ResourceGroupName rgName -ResourceType Microsoft.EventHub/namespaces/AuthorizationRules -ResourceName eventhubName/RootManageSharedAccessKey -Action listKeys -ApiVersion 2015-08-01 -Force

最新更新