gpt4 book ai didi

azure - 无法通过 azure 自动化 Runbook 创建存储帐户

转载 作者:行者123 更新时间:2023-12-03 03:04:55 26 4
gpt4 key购买 nike

我正在尝试使用 azure 自动化 Runbook,下面是我用来创建存储帐户的小脚本。

Param
(
[Parameter(Mandatory=$true)]
[String]
$AzureResourceGroup,
[Parameter(Mandatory=$true)]
[String]
$StorageAC,
[Parameter(Mandatory=$true)]
[String]
$Loc,
[Parameter(Mandatory=$true)]
[String]
$sku
)

$CredentialAssetName = "AutomationAccount";
$Cred = Get-AutomationPSCredential -Name $CredentialAssetName
if(!$Cred) {
Throw "Could not find an Automation Credential Asset named
'${CredentialAssetName}'. Make sure you have created one in this Automation
Account."
}

Add-AzureRmAccount -Credential $Cred
Add-AzureAccount -Credential $Cred

$storeac = Get-AzureRmStorageAccount -ResourceGroupName $AzureResourceGroup
if ($storeac.StorageAccountName -eq "testdd" ){
write-output " AC found !";

} else {
New-AzureRmStorageAccount -ResourceGroupName $AzureResourceGroup -Name
$StorageAC -Location $Loc -SkuName $sku
}

但是,当我在发布后运行它时,作业完成时出现错误(New-AzureRmStorageAccount:找不到与参数名称“SkuName”匹配的参数)

有人可以告诉我我做错了什么吗?

最佳答案

解决错误:

New-AzureRmStorageAccount : A parameter cannot be found that matches parameter name 'SkuName'

请更新自动化帐户中的 Azure 模块,然后单击“自动化帐户 => 模块”下的“更新 Azure 模块”,然后重试 Runbook

Update Azure Modules

关于azure - 无法通过 azure 自动化 Runbook 创建存储帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45280431/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com