I receive the error message 'Job Job1: Environment $(environmentName) could not be found. The environment does not exist or has not been authorized for use.' when I run the pipeline below.
trigger:
- main
pool:
vmImage: ubuntu-latest
stages:
- stage: Dev
variables:
- group: Config.Dev
jobs:
- deployment:
environment: $(environmentName)
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: AzureCLI@2
inputs:
azureSubscription: $(azureSubscriptionName)
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az deployment sub create --location uksouth --template-file main.bicep
- stage: Prd
variables:
- group: Config.Prd
jobs:
- deployment:
environment: $(environmentName)
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: AzureCLI@2
inputs:
azureSubscription: $(azureSubscriptionName)
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az deployment sub create --location uksouth --template-file main.bicep