Azure setup: grant only Application.ReadWrite.OwnedBy - #471
Merged
Conversation
Porter's only Microsoft Graph operation is managing federated identity credentials on its own app registration. The script granted seven tenant-wide Graph permissions inherited from the client-secret era; replace them with Application.ReadWrite.OwnedBy, make the service principal an owner of its own app registration (OwnedBy only reaches registrations the caller owns), and remove the legacy grants — manifest entries and consented app role assignments — from app registrations that still carry them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3cL9QN3RQYJ3R8zTiervJ
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Revoking the seven tenant-wide permissions is out of scope for setup: a setup script should only grant, and stripping permissions could break a working connection (the backend still accepts Application.ReadWrite.All). Existing customers who want to shed the legacy grants get a one-time swap procedure instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3cL9QN3RQYJ3R8zTiervJ
bengreenberg5
marked this pull request as ready for review
August 31, 2026 14:56
JessicaGCarvalho
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to https://github.com/porter-dev/code/pull/8155 — RUN-4375: Least-privileged Azure permissions for ModelML.
Porter's only Microsoft Graph operation is managing FICs on its own app registration, so the setup script now grants a single, ownership-scoped permission (
Application.ReadWrite.OwnedBy) instead of seven tenant-wide ones.Merge after https://github.com/porter-dev/code/pull/8155 is deployed.
Script changes
add_api_permissionsgrants onlyApplication.ReadWrite.OwnedBy.ensure_app_ownermakes the service principal an owner of its own app registration (az ad app owner add) —OwnedByonly reaches registrations the caller owns.main:create_app_registration → assign_custom_role → ensure_app_owner → add_api_permissions → grant_admin_consent → create_federated_credential. Removing the legacy tenant-wide permissions is deliberately NOT part of setup — revocation could break a working connection; ModelML will get a one-time swap procedure instead.Docs
cloud-accounts/connecting-a-cloud-account.mdxdescribes the new steps and what the single permission does.🤖 Generated with Claude Code