Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job DeployManagementGroupsJob: Environment main could not be found #173

Closed
autocloudarc opened this issue Feb 22, 2022 · 4 comments · Fixed by #175
Closed

Job DeployManagementGroupsJob: Environment main could not be found #173

autocloudarc opened this issue Feb 22, 2022 · 4 comments · Fixed by #175
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request scripts Bash, Windows, PowerShell scripts
Milestone

Comments

@autocloudarc
Copy link
Contributor

When running the management-groups-ci, this error appears (see image). Following instructions from reference: [CanadaPubSecALZ/azure-devops-pipelines.md at main · Azure/CanadaPubSecALZ · GitHub] https://github.com/Azure/CanadaPubSecALZ/blob/main/docs/onboarding/azure-devops-pipelines.md) Step 3.3: Configure Azure DevOps Pipeline. management-group-ci

@autocloudarc
Copy link
Contributor Author

Discovered a functional workaround as follows:

  1. Manually created a new environment named: dev
  2. in the ...\config\variables\common.yml file, added the following entry at the top of the variables list (line 12): environment: dev
  3. In the .../pipelines/management-groups.yml file, configured the jobs: environment property to reference the new common variable created in 2. above: environment: ${{ variables['environment'] }}

NOTE: I'm not sure if this is the best approach that is acceptable, but I am now able to run the pipeline job without issues and the management group structure was properly created this time :

add-environment-to-common-variables

@SenthuranSivananthan
Copy link
Contributor

SenthuranSivananthan commented Feb 22, 2022

Thanks for raising this @autocloudarc. This is because you will have to define an environment in Azure DevOps under Pipelines -> Environments. This name should match that of the branch.

In the past, this was auto created by ADO when missing and looks like it is no longer. Reference: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/environments?view=azure-devops

I'll get the doc updated to reference the environment setting.

@SenthuranSivananthan
Copy link
Contributor

@autocloudarc - Feel free to checkout the PR with the instructions: https://github.com/Azure/CanadaPubSecALZ/pull/175/files

@SenthuranSivananthan SenthuranSivananthan added the documentation Improvements or additions to documentation label Feb 22, 2022
@SenthuranSivananthan SenthuranSivananthan added this to the v0.8.0 milestone Feb 22, 2022
@SenthuranSivananthan SenthuranSivananthan self-assigned this Feb 22, 2022
@skeeler
Copy link
Contributor

skeeler commented Feb 23, 2022

Reopening to associate an additional code change to the onboarding scripts so that the create-pipelines.bat script automatically detects when the environment (named after the branch) does not already exist and automatically creates it.

@skeeler skeeler added enhancement New feature or request scripts Bash, Windows, PowerShell scripts labels Feb 23, 2022
@skeeler skeeler self-assigned this Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request scripts Bash, Windows, PowerShell scripts
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants