Skip to content

Document listSecrets access granted by Container Apps built-in roles - #128755

Draft
Tiago Alves Macambira (tmacam) wants to merge 6 commits into
MicrosoftDocs:mainfrom
tmacam:tiagoa-microsoft-container-apps-role-secrets-permissions
Draft

Document listSecrets access granted by Container Apps built-in roles#128755
Tiago Alves Macambira (tmacam) wants to merge 6 commits into
MicrosoftDocs:mainfrom
tmacam:tiagoa-microsoft-container-apps-role-secrets-permissions

Conversation

@tmacam

@tmacam Tiago Alves Macambira (tmacam) commented Sep 3, 2026

Copy link
Copy Markdown

Summary

Several Azure Container Apps built-in roles grant listSecrets operations through wildcard or explicit permissions. This PR documents which roles can read container app, job, and Dapr component secret values, clarifies that assignment scope determines the affected resources, and advises customers to create custom roles when built-in roles are broader than required.

It also documents an important jobs-specific boundary: Microsoft.App/jobs/start/action doesn't grant listSecrets, but the Jobs - Start API accepts an execution-template override. A caller who can start a job and knows a secret name can run a container of their choosing, reference that secret, and use managed identities configured to be available to the container.

Changes

  • Adds canonical role and custom-role guidance to manage-secrets.md, separates app and job secret permissions from Dapr component secret permissions, and includes a narrow execution viewer/stopper example.
  • Updates jobs.md with job-specific roles, exact permissions, a warning beside the execution-template override examples, and links to managed identity availability controls.
  • Adds least-privilege and remediation guidance to security.md and secure-deployment.md.
  • Adds warnings to the CI/CD runner and event-driven job tutorials where PATs or storage connection strings are stored as job secrets.
  • Adds a permissions cross-reference where dapr-component-connect-services.md documents platform-managed Dapr component secrets.
  • Corrects the built-in role name in relocate-region.md and documents its secret-access implications.

Verification

Role claims were checked against live ARM role definitions and articles/role-based-access-control/built-in-roles/containers.md. Operation names were confirmed through the Microsoft.App provider operations.

The Jobs - Start behavior was verified against the stable ARM OpenAPI contract and the Container Apps RP implementation:

  • Jobs_Start is gated by Microsoft.App/jobs/start/action and accepts an optional JobExecutionTemplate body.
  • The template supports caller-provided main and init container images, commands, arguments, and environment variables, including secretRef.
  • The RP applies the caller-provided containers to the stored job and validates secretRef against the stored job secrets.
  • Managed identity access is limited by the identities configured to be available to the overridden container type.

Reader roles are intentionally not listed because their */read permissions don't match .../listSecrets/action operations.

Several Container Apps built-in roles define permissions with wildcard
patterns that match the listSecrets action, so they grant read access to
secret values in plain text even when the role name or description
suggests narrower access.

- manage-secrets.md: add a 'Permissions for managing secrets' section
  listing the built-in roles that grant listSecrets, plus a custom role
  example that omits it.
- jobs.md: correct the Permissions section to name the Jobs Contributor
  and Jobs Operator roles, call out that both grant listSecrets, and fix
  the custom role action list (executions/read, stop/action,
  managedEnvironments/read).
- security.md: add secrets management best practices covering role
  review and custom roles.

Roles verified against live ARM role definitions and
articles/role-based-access-control/built-in-roles/containers.md.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@prmerger-automator

Copy link
Copy Markdown
Contributor

Tiago Alves Macambira (@tmacam) : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@prmerger-automator

Copy link
Copy Markdown
Contributor

Tiago Alves Macambira (@tmacam) : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit dbcb039:

✅ Validation status: passed

File Status Preview URL Details
articles/container-apps/jobs.md ✅Succeeded
articles/container-apps/manage-secrets.md ✅Succeeded
articles/container-apps/security.md ✅Succeeded

For more details, please refer to the build report.

…cess

The job start API accepts a template override that replaces the container
image, command, and environment variables for the execution. An identity
holding only Microsoft.App/jobs/start/action can therefore run an
arbitrary container with the job's secrets injected and read the values
from inside it. Omitting listSecrets from a custom role does not prevent
this, so the previous guidance was misleading.

- jobs.md: replace the vague 'you get access to all the secrets' note
  with an IMPORTANT callout explaining the override mechanism, and stop
  presenting the custom role action list as a way to run jobs without
  secret access.
- manage-secrets.md: change the custom role example to a monitor-only
  role that omits start/action, and add a WARNING covering the
  start/action escalation path.

Verified against the job start REST contract documented in jobs.md and
the --image/--command/--env-vars parameters of 'az containerapp job start'.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tmacam

Copy link
Copy Markdown
Author

Correcting an inaccuracy I introduced in the initial commit, raised in review.

The earlier revision framed a custom role that omits Microsoft.App/jobs/listSecrets/action as a way to let users run jobs "without granting access to job secrets." That claim is wrong.

Microsoft.App/jobs/start/action and Microsoft.App/jobs/listSecrets/action are separate operations, so start genuinely does not grant listSecrets in RBAC terms. But the job start API accepts a template override. As documented in this same article, the request body replaces the job's template for that execution:

POST .../providers/Microsoft.App/jobs/my-job/start?api-version=2023-05-01

{
    "containers": [
        { "image": "...", "name": "main", "command": ["echo", "..."] }
    ]
}

az containerapp job start exposes the same capability through --image, --command, --args, and --env-vars (which accepts secretref: values).

So an identity holding only start/action can run a container image of their choosing with the job's secrets injected, and read the values from inside that container. Omitting listSecrets from a custom role narrows the management-plane surface, but it is not a confidentiality boundary for a principal that can start the job.

Changes in ca961a5:

  • jobs.md — replaced the inherited, vague line "When you start a job execution, you also get access to all the secrets configured for the job" with an [!IMPORTANT] callout that explains the override mechanism and links to the on-demand start section. The custom role action list is retained, but now framed as avoiding the */action wildcard rather than as avoiding secret access.
  • manage-secrets.md — the custom role example previously included start/action while claiming no secret access. It is now a monitor-only role (read, executions/read, stop/action, managedEnvironments/read), with a [!WARNING] documenting the start/action escalation path.

Net guidance: treat permission to start a job as equivalent to permission to read that job's secrets.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit ca961a5:

✅ Validation status: passed

File Status Preview URL Details
articles/container-apps/jobs.md ✅Succeeded
articles/container-apps/manage-secrets.md ✅Succeeded
articles/container-apps/security.md ✅Succeeded

For more details, please refer to the build report.

@tmacam
Tiago Alves Macambira (tmacam) marked this pull request as draft September 3, 2026 01:32
@v-regandowner

Copy link
Copy Markdown
Contributor

Craig Shoemaker (@craigshoemaker)

Can you review the proposed changes?

IMPORTANT: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator Bot added the aq-pr-triaged tracking label for the PR review team label Sep 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to run its full agentic suite in this review.

Pull request overview

Documents that certain Azure Container Apps built-in roles grant access to secret values via wildcard */action permissions (matching listSecrets), and guides readers toward custom roles for narrower access.

Changes:

  • Adds a new secrets-permissions section listing built-in roles whose wildcards match listSecrets, plus guidance and a custom-role example.
  • Corrects Container Apps Jobs role recommendations and updates the custom-role action list for job scenarios.
  • Adds security best practices and cross-links to the new secrets-permissions documentation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
articles/container-apps/security.md Adds best-practice bullets and links to the new secrets permissions guidance.
articles/container-apps/manage-secrets.md Adds a roles/permissions table for listSecrets, callouts, and a narrower custom-role example.
articles/container-apps/jobs.md Updates recommended built-in roles for jobs, clarifies listSecrets wildcard impact, and corrects custom-role action guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread articles/container-apps/manage-secrets.md Outdated
Comment thread articles/container-apps/manage-secrets.md Outdated
Refine the role guidance after review:
- explain that job start can reference retained secrets rather than
  implying all secrets are injected automatically
- qualify managed identity access by container identity availability
- link directly to the Jobs - Start REST API
- replace Contributor requirements with jobs/start/action
- add individual execution read and stop operations to custom roles
- correct wildcard and ConnectedEnvironments role descriptions
- normalize the permissions table and scope the jobs-specific warning

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 6674a33:

✅ Validation status: passed

File Status Preview URL Details
articles/container-apps/jobs.md ✅Succeeded
articles/container-apps/manage-secrets.md ✅Succeeded
articles/container-apps/security.md ✅Succeeded

For more details, please refer to the build report.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit d195673:

❌ Validation status: errors

Please follow instructions here which may help to resolve issue.

File Status Preview URL Details
❌Error Details

  • [Error: CannotMergeCommit] Cannot merge commit d19567397f2efad16ea1cc8c1409b5917002395c in branch tiagoa-microsoft-container-apps-role-secrets-permissions of repository https://github.com/tmacam/azure-docs into branch main (commit 83eadeb61d00f8dd272c03bcf0104c8d466725ca). Please follow this documentation: https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/ to use git.exe to resolve you content conflicts locally and then push to remote.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 133252d:

✅ Validation status: passed

File Status Preview URL Details
articles/container-apps/jobs.md ✅Succeeded
articles/container-apps/manage-secrets.md ✅Succeeded
articles/container-apps/relocate-region.md ✅Succeeded
articles/container-apps/secure-deployment.md ✅Succeeded
articles/container-apps/security.md ✅Succeeded
articles/container-apps/tutorial-ci-cd-runners-jobs.md ✅Succeeded
articles/container-apps/tutorial-event-driven-jobs.md ✅Succeeded

For more details, please refer to the build report.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 8f9388f:

✅ Validation status: passed

File Status Preview URL Details
articles/container-apps/dapr-component-connect-services.md ✅Succeeded
articles/container-apps/jobs.md ✅Succeeded
articles/container-apps/manage-secrets.md ✅Succeeded
articles/container-apps/relocate-region.md ✅Succeeded
articles/container-apps/secure-deployment.md ✅Succeeded
articles/container-apps/security.md ✅Succeeded
articles/container-apps/tutorial-ci-cd-runners-jobs.md ✅Succeeded
articles/container-apps/tutorial-event-driven-jobs.md ✅Succeeded

For more details, please refer to the build report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants