【发布时间】:2020-11-05 08:02:44
【问题描述】:
我正在尝试从同一资源组“rg-mobileplans”下的 Powershell 功能应用程序中获取存储帐户的密钥。
我确定我拥有正确的 Azure 上下文,并且在列出所有存储帐户时,我看到了我试图从中检索密钥的那个 - “stmobileplansstaging”。
Write-Host ((Get-AzContext).Subscription)
Write-Host (Get-AzStorageAccount -ResourceGroupName rg-mobileplans).StorageAccountName
输出:
<Subscription ID Hidden for Privacy>
stmobileplansstaging storageaccountrgmob83d8
但是当我尝试获取密钥本身时,我收到一条错误消息,提示找不到存储帐户。
Get-AzStorageAccountKey -ResourceGroupName rg-mobileplans -AccountName stmobileplansstaging
输出:
ERROR: Get-AzStorageAccountKey : The Resource 'Microsoft.Storage/storageAccounts/stmobileplansstaging ' under resource group 'rg-mobileplans' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
请记住,我是从函数应用程序运行这些命令。从 Powershell 运行它们是可行的。
我为函数应用创建了一个系统管理的身份,并授予它“所有者”访问整个“rg-mobileplans”资源组和“stmobileplansstaging”存储帐户的权限。
我错过了什么?
【问题讨论】:
标签: azure powershell azure-function-app azure-storage-account