Hey Guys !! Today I created a number of resources in my Azure subscription. As I was creating the KeyVaults , I realized that this was a time spending exercise for me, because I was in need to have 6 KeyVaults, and each KeyVault there were around 5 secrets. And for each KeyVault I would have to assign the required permissions. These permission were with Users of AD, Objects of Deployments (Service Principal cretead in Azure Devops), and the Azure App Services by which these Key Vaults were need to be access. Then suddenly , I though that there should be way to reduce the time of resource creation.
I was aware that we can do it with the help of Azure Resource Manager templates. So I though , lets try Azure Resource Manager Template deployments.
I did google and after some doing some analysis, I was able to do it very well.
So Guys, I will update in todays session that How I was able to save my time with the help Azure Resource Manager Template Deploymnets.
There are some steps that I followed for creating the KeyVaults with template deploymnets. These steps can be used to deploy any resource, not even only for KeyValus.
So here are the Steps that I followed..
- Export a Template from existing resource.
- Edit Template
- Deploy Template
Export Template
This export option is available in almost all resources. We can either Copy that template or we can download that template or we can add that Template in Library section. For me, I simply copy and paste the content of that template in a text file.I realized that , each templates carries 3 important sections, which are
- Parameters
- Variables
- Resources
Edit Template
I updated it's value to , "parameters": {
Deploy Template
Now, I went to search section of Azure and typed "deploy", and there I found "Deploy a Custom Template" under the Services section. I clicked on that service.
There I clicked on "Build your own template in the editor", pasted my updated template and Saved it.
After clicking on Save button , I found that I was able to change the values, which I found as Parameters in template. I provided the Resource Group name, and the Parameter value, I clicked on "Review+Create", and then on "Cretae" button.
I realized that in few minutes, KeyVault was ready but I got error as "BadRequest" for deployment/creation secrets.
Error message was "The parameter value is not specified."
I found that when we export a Template of KeyVault, it export the secret name but it does exports it Value. So We have to add the value by own.
I find the section of secret and added it's value. For me , it was some thing like this..
I repeated the 3rd step "Template Deployment" for all my other keyVaults, and I was able to save my lots of time.
Thanks to Azure Resource Template deployments feature.
Wonderful blog to check out and reference links also related to the topic.
ReplyDeleteDevOps certification in Chennai
DevOps Online Course
Best DevOps Training in Bangalore