AZ-305 Practice Question 81: Workload Identity Federation CI/CD

Microsoft Azure Solutions Architect Expert (AZ-305) · Test 9 · question 1 of 10

Identity, Governance & Monitoringmedium

A company builds its container images in a GitHub Actions workflow hosted entirely on GitHub's own runners, outside Azure. The pipeline needs to push images to Azure Container Registry and deploy to Azure Kubernetes Service on every merge to main. The security team sets these requirements:

- No client secret, certificate, or Azure credential of any kind may be stored as a GitHub secret or checked into the repository. - Access must be scoped to a single Microsoft Entra application whose permissions can be revoked in Azure without touching GitHub. - The credential used by a workflow run must be short lived and tied to that specific repository and branch. - Managed identity cannot be used, because the workload does not run on an Azure compute resource.

What should you configure?

Select one answer
Show answer and explanation

Answer:

  • D. Add a federated identity credential to the Microsoft Entra application that trusts GitHub's OpenID Connect issuer for the specific repository and branch, and grant the application the required roles on the registry and the cluster

Workload identity federation lets an external workload, such as a GitHub Actions job, exchange a token it already holds (GitHub's OIDC token, scoped to a repository and branch) for an Azure access token, without any secret ever being stored. The trust relationship is configured once, as a federated identity credential on the Microsoft Entra application, and it can be scoped to a subject claim that matches exactly one repository and branch. Because the exchanged token is short lived and the trust lives entirely on the Entra application, access can be revoked centrally in Azure at any time.

Option A stores exactly the kind of long-lived secret the requirements forbid, and rotating it with a runbook still leaves a window where a leaked secret is valid.

Option B does not fit the constraint that the workload runs outside Azure. Standing up a self-hosted runner on an Azure VM just to get a managed identity adds infrastructure the company does not want and does not match "hosted entirely on GitHub's own runners."

Option C replaces a client secret with a private key, but the key still has to be generated, stored as a GitHub secret, and rotated before it expires, which is the same class of standing credential the design must avoid.

Reference: Workload identity federation

Practice Test 9 ›

Study guides for AZ-305