In Azure Pipelines YAML, you can specify an environment for a job to run in.
jobs:
- deployment: Deploy
displayName: Deploy
environment: $(environment)
Passing a new value to the pipeline should automatically create the Environment in DevOps.
However, I have recently gotten this error when attempting to deploy to a new environment:
Job Deploy: Environment [environment-name] could not be found. The environment does not exist or has not been authorized for use.
After I created the environment manually, the pipeline deployed successfully.
Is there any configuration or something I'm missing that would allow the environment to be created automatically?