AZ-400 Exam QuestionsBrowse all questions from this exam

AZ-400 Exam - Question 171


You have a GitHub repository that contains multiple workflows and a secret stored at the environment level.

You need to ensure that the secret can be used by all the workflows.

What should you do first?

Show Answer
Correct Answer: B

To ensure that a secret can be used by all workflows in a specific GitHub repository, you should recreate the secret at the repository level. By doing this, the secret will be accessible to all workflows within that repository. Organization-level secrets are used when you want to share a secret across multiple repositories within the same organization, but that is not necessary in this case where the requirement is only for one repository.

Discussion

9 comments
Sign in to comment
kay000001Option: B
Jun 7, 2023

Answer should be B. Creating secrets at the repository level ensures that it is available to all workflows within that repository.

zellckOption: B
Jun 8, 2023

B is the answer. https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository

vsvaidOption: A
Dec 31, 2023

I think A is correct https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-an-organization

ghaboolOption: A
Sep 21, 2023

I choose A Recreating the secret at the repository level would not make it available to all the workflows, as repository secrets are only accessible within the repository they are defined in

catfood
Jul 6, 2023

its also possible to enable the approvers/reviewers for each worfklow to access the secret at environment level. The question doesn't give us a motive eg. easiest, most secure....

vector_bcoOption: A
Oct 31, 2023

all workflows inside the repository already have access to the environment secrets within this repository at the same time if we really need to be able to use secrets in ALL the repositories (within the any repo) we need recreate secrets on a higher level - organization - answer A

ozbonnyOption: B
Feb 22, 2024

since the question says all workflows but doesn't specify organization I infer that it is related to the repository B. Recreate the secret at the repository level.

chloausOption: A
Apr 12, 2024

For secrets stored at the organization-level, you can use access policies to control which repositories can use organization secrets. Organization-level secrets let you share secrets between multiple repositories, which reduces the need for creating duplicate secrets. Updating an organization secret in one location also ensures that the change takes effect in all repository workflows that use that secret. https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-encrypted-secrets-for-an-organization

SkankhuntOption: B
Jul 16, 2024

I'm going with B, the question reads "You have A (one) GitHub repo". In this case, recreating it at the Org level would be an "over assignment".