Skip to main content
Version: Next

Task 05: Configure Environment Variables

Runbook GitHub GitLab Azure DevOps

DOCUMENT CATEGORY: Runbook Step
SCOPE: CI/CD pipeline variable configuration
PURPOSE: Configure environment variables for Azure authentication
MASTER REFERENCE: See platform-specific docs below

Status: Active


Objective

Configure CI/CD pipeline environment variables for each target Azure subscription.


Prerequisites

  • Environments created (Task 04)
  • Bootstrap values from Task 01 (ARM_CLIENT_ID, ARM_CLIENT_SECRET)

Variables from variables.yml

VariableConfig PathExample
Tenant IDazure.tenant_idxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Subscription IDazure.subscription.idxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SPN Client IDidentity.service_principal.app_idxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SPN Client Secretkeyvault://<vault>/automation-spn-secret(Key Vault reference)

Required Variables

Configure the following variables for each target Azure subscription:

VariableDescriptionSensitivity
ARM_TENANT_IDEntra ID tenant IDMasked
ARM_SUBSCRIPTION_IDAzure subscription IDMasked
ARM_CLIENT_IDazurelocal-cicd App Registration ID (from Task 01)Masked
ARM_CLIENT_SECRETazurelocal-cicd App Registration secret (from Task 01)Secret

Procedure

Configure Repository Secrets

  1. Navigate to your repository → SettingsSecrets and variablesActions
  2. Click New repository secret for each variable:
Secret NameValue
ARM_TENANT_IDEntra ID tenant ID
ARM_SUBSCRIPTION_IDAzure subscription ID
ARM_CLIENT_IDApp Registration client ID
ARM_CLIENT_SECRETApp Registration client secret

For multi-environment deployments, use environment-scoped secrets:

  1. Go to SettingsEnvironments → select environment (e.g. azr-prod-us)
  2. Under Environment secrets, click Add secret
  3. Add environment-specific values for ARM_SUBSCRIPTION_ID (and others if they differ per environment)

Tip: Repository-level secrets apply to all environments. Use environment secrets to override per environment.


Verification

  • All required variables configured per environment
  • Sensitive values are masked/secret
  • Variables scoped to correct environments
  • Test pipeline can authenticate to Azure

Next Steps

Deploy Runners


References


Toolkit Reference

Scripts for this task are located in the azurelocal-toolkit repository under scripts/deploy/ in the appropriate task folder.


Alternatives

The procedures in this task use the scripted methods shown in the tabs above. Additional deployment methods including Azure CLI and Bash scripts are available in the azurelocal-toolkit repository under scripts/deploy/.

MethodDescription
Azure CLIPowerShell-based Azure CLI scripts for Azure resource operations
BashLinux/macOS compatible shell scripts for pipeline environments
PreviousUpNext
← Task 04: Create EnvironmentsPhase 01: CI/CD SetupTask 06: Deploy Runners ->

Troubleshooting

IssueCauseResolution
Variable group not accessiblePipeline authorization missingAuthorize the pipeline to use the variable group
Secret variables not resolvingKey vault integration misconfiguredVerify key vault access policy and service connection

Version Control

VersionDateAuthorChanges
1.0.02025-03-25Azure Local CloudInitial release