【发布时间】:2020-05-20 17:22:16
【问题描述】:
我创建了认知服务帐户。我想获取认知服务帐户密钥并使用 powershell 脚本将其存储在变量中。
我使用了以下脚本:
$resourceGroup = "Demo"
$AccountName = "DemoCs"
$Key = Get-AzCognitiveServicesAccountKey -ResourceGroupName $resourceGroup -Name $AccountName
Write-Host "account key 1 = " $Key
脚本执行后的结果是:
2020-05-20T08:30:31Z [信息] 信息:帐户密钥 1 = Microsoft.Azure.Commands.Management.CognitiveServices.Models.PSCognitiveServicesAccountKeys
上面的脚本可以列出 cloud shell 中的键,但不能在 powershell 函数应用中列出。
【问题讨论】:
标签: azure powershell azure-cognitive-services azure-function-app