Deploy azure keyvault with ARM template.

huangapple go评论77阅读模式
英文:

Deploy azure keyvault with ARM template

问题

在使用 Azure 门户创建密钥保管库时,在实际创建之前,我可以看到一个名为 "查看自动化模板" 的链接:
Deploy azure keyvault with ARM template.

在其中,我可以查看密钥保管库 ARM 模板,但我注意到 Azure CLI 命令 az keyvault create .. 不支持像 --template-file--parameters 这样的选项。我如何通过 Azure CLI 从门户部署 ARM 模板呢?

英文:

When I create a keyvault with azure portal, before actual creating I have a link called "View Automation Template":
Deploy azure keyvault with ARM template.

Where inside I can see a keyvault ARM template, but as I can see the azure cli command az keyvault create .. doesn't support options like --template-file or --parameters. How can I deploy the ARM template from the portal via azure CLI?

答案1

得分: 1

是的,您可以通过Azure CLI部署ARM模板来创建Azure Keyvault。

我已经按照这个MS文档来使用ARM模板创建Azure Keyvault。

Azure CLI命令

New-AzResourceGroupDeployment -ResourceGroupName "ResourceGroup-Name" TemplateFile .\ARM.json

注意:如果您从相同的目录运行命令,可以将模板文件提供为.\<JSON文件>

输出:

Deploy azure keyvault with ARM template.

如果要使用-TemplateParameterFile选项,您可以在同一目录中单独创建一个参数文件,然后使用以下命令:

New-AzResourceGroupDeployment -ResourceGroupName "ResourceGroup Name" TemplateFile .\ARM.json -TemplateParameterFile .\vault.parameters.json

参考: 使用ARM模板创建Azure Key Vault

英文:

> Where inside I can see a keyvault ARM template, but as I can see the azure cli command az keyvault create .. doesn't support options like --template-file or --parameters

Yes, You can deploy ARM template via azure CLI to create Azure Keyvault.

I have followed this MS Doc to create Azure Keyvault with ARM Template.

Azure CLI Command

New-AzResourceGroupDeployment -ResourceGroupName &quot;ResourceGroup-Name&quot; TemplateFile .\ARM.json

> Note: If you are running the command from the same directory, you can provide the template file as .\&lt;JSON File&gt;

Output:

Deploy azure keyvault with ARM template.

If you want to use the -TemplateParameterFile option, you can create a parameter file separately in the same directory and use the command as shown below.

New-AzResourceGroupDeployment -ResourceGroupName &quot;ResourceGroup Name&quot; TemplateFile .\ARM.json -TemplateParameterFile .\vault.parameters.json

Reference: Create an Azure Key Vault using an ARM template

答案2

得分: 1

你要找的CLI命令是 az deployment group create,它使用ARM模板和参数来在资源组中部署该模板。

当您想要通过直接指定其属性作为命令参数而不是使用ARM模板和参数来创建KeyVault资源时,可以使用az keyvault create

英文:

The CLI command you are looking for is az deployment group create which makes use of an ARM template and parameters to deploy that template in a resource group.

You would use az keyvault create when you want to create a KeyVault resource by directly specifying its properties as command parameters instead of using an ARM template and parameters.

huangapple
  • 本文由 发表于 2023年6月27日 17:30:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/76563477.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定