When I create a keyvault with azure portal, before actual creating I have a link called "View Automation 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?
2
Answers
Yes, You can deploy
ARM
template via azure CLI to create Azure Keyvault.I have followed this MS Doc to create
Azure Keyvault
withARM Template
.Azure CLI Command
Output:
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.Reference: Create an Azure Key Vault using an ARM template
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.