是否有任何选项可以为 Azure 仪表板编写导出脚本?
Is there any option to script the export for an Azure Dashboard?
在 Azure 中,您可以使用门户上的按钮创建仪表板并导出它们。但是,似乎没有通过 API/SDK/CLI 导出 ARM 的选项。我错了吗,或者这确实是仪表板体验中的一个差距?
您也可以通过Azure CLI, PowerShell, and the REST API导出资源组模板。
更新:
您可以看到如下描述here:
Shared dashboards in Azure are resources just like virtual machines
and storage accounts. Therefore, they can be managed programmatically
via the Azure Resource Manager REST APIs, the Azure CLI, Azure
PowerShell commands, and many Azure portal features build on top of
these APIs to make resource management easier.
实际上,您在Azure Dashboard 中通过按钮下载的不是资源,因此您无法通过命令或API 将其导出。您需要的是将仪表板模板制作为资源,然后您可以使用命令(Azure CLI 或 PowerShell)和 API 将其导出。
这是门户中作为资源的示例:
然后使用 Azure CLI 命令导出模板,如下所示:
az group deployment export -g grouName -n templateName > dashboard.json
在 Azure 中,您可以使用门户上的按钮创建仪表板并导出它们。但是,似乎没有通过 API/SDK/CLI 导出 ARM 的选项。我错了吗,或者这确实是仪表板体验中的一个差距?
您也可以通过Azure CLI, PowerShell, and the REST API导出资源组模板。
更新:
您可以看到如下描述here:
Shared dashboards in Azure are resources just like virtual machines and storage accounts. Therefore, they can be managed programmatically via the Azure Resource Manager REST APIs, the Azure CLI, Azure PowerShell commands, and many Azure portal features build on top of these APIs to make resource management easier.
实际上,您在Azure Dashboard 中通过按钮下载的不是资源,因此您无法通过命令或API 将其导出。您需要的是将仪表板模板制作为资源,然后您可以使用命令(Azure CLI 或 PowerShell)和 API 将其导出。
这是门户中作为资源的示例:
然后使用 Azure CLI 命令导出模板,如下所示:
az group deployment export -g grouName -n templateName > dashboard.json