获取 Azure 自动化账户的 Sku

Get the Sku of Azure automation account

我正在尝试对不同订阅中的现有自动化帐户启用诊断设置。

到目前为止,我的脚本不包含以下主题。

这很好用。 但我现在面临的问题是 sku 在这里设置为基本。但我不能确定我使用 get-AzAutomationAccount 命令检索到的每个自动化帐户都是这种情况。

我已搜索从 get-AzAutomationAccount 中获取计划值并将其保存在 ARM 模板中,但似乎是空的。

是否有任何其他方法来检索每个 Azure 自动化帐户的 sku。

此外,如果我阅读 the official doc of Microsoft,通常不需要 SKU 对象。但是每当我删除 sku 对象或将其留空时,部署就会失败。

有谁知道如何解决这个问题吗?

命令 Get-AzAutomationAccount 不会 return sku 属性,它只是 return Plan.

如果你想得到sku,你可以使用下面的命令。

$sku = (Get-AzResource -ResourceGroupName "<resource group name>" -ResourceType Microsoft.Automation/automationAccounts -ResourceName "<automation account name>").properties.sku
$sku | ConvertTo-Json