PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, September 26, 2022

[FIXED] Why does Azure Pipelines say "The environment does not exist or has not been authorized for use"?

 September 26, 2022     azure-pipelines, azure-pipelines-yaml, cicd, continuous-deployment     No comments   

Issue

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.

Automatically created environment

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?


Solution

I have same issue and according to documentation it's not possible to create Environment this way.

If you are using runtime parameters for creating the environment, it will fail as these parameters are expanded at run time. Environment creation happens at compile time, so we have to use variables to create the environment.

For more info please check here.



Answered By - Sasa Prodanovic
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing