The objective of this packet is to simplify the variable transfer from Azure DevOps to .env file, making it easier to run the application locally, without the need to copy and paste the variables manually.
Make sure to attend to the following requirements before executing the command:
- Install Azure CLI Azure CLI
- Authenticate to Azure CLI login
- Run this command on your terminal:
az login --allow-no-subscriptions
-
After first try, it will install azure-devops extension if not installed. After that, run the command above again and it will work
-
Azure CLI might ask you to inform your organization. In order to do that, run the following command, don't forget to change '/my_org_name/' to your organization name.
az devops configure --defaults organization=https://dev.azure.com/my_org_name/
- Make sure to have access to the Azure DevOps libraries
- Install this packet globally
To install this packet globally, run the following command on your terminal:
npm install -g azure-get-enviroment-variables
After authenticating to Azure CLI, run the following command in your terminal:
npx azure-get-enviroment-variables 'project name' -- 'library name'
Make sure to replace 'project name' and 'library name' with the real project and library names.