Hello Folks, on this article I will show you how to store secrets in a variable group on Azure Devops.
A variable group is a logical container that stores variables and their properties (like key/value pairs). They can contain API keys, database connection strings, or API endpoints.
Let´s create a variable group to store the credentials and secrets needed to access your Azure subscription and provision resources – as Infrastructure as Code (IaC). Variable groups can also be shared across the pipelines.
Creating a variable group on Azure Devops:
1. Go to your Azure Devops account and select your project – http://devops.azure.com
2. In your Azure DevOps project, navigate to the Pipelines icon on the left panel and select Library and click on +Variable group as shown below
Now provide a name to the variable group:
Add the variables to the variable group with their corresponding value:
If you´re using any secrets/password i.e. a service principals secret you can mark the Service_Principals_Secret variable as a secret by clicking the lock icon to the left of your variable
Once you finish adding the variables click save on the top menu:
Now you have created a variable group to store the credentials and secrets needed to access the Azure subscription and provision resources. This variable group could be shared across the different pipelines you need them for your own purpose.