You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support least-privilege RBAC for apiops publish — avoid requiring Resource Group Reader in preflight #303
apiops publish fails preflight validation unless the executing identity has Reader (or broader) at the Resource Group scope, even though publishing
itself only ever touches the target APIM service/workspace.
validatePreFlight() (src/clients/apim-client.ts) performs two sequential
existence checks before publishing:
GET {armEndpoint}/subscriptions/{sub}/resourceGroups/{rg} — requires Microsoft.Resources/subscriptions/resourceGroups/read, granted only by Reader (or higher) at resource group or subscription scope.
GET {baseUrl} (the APIM service resource itself) — satisfied by Reader/Service Reader at APIM service scope.
Step 1 fails with a 403 for any identity scoped only to the APIM service,
before step 2 (the actually-relevant check) even runs:
AuthorizationFailed: The client does not have authorization to perform action
'Microsoft.Resources/subscriptions/resourceGroups/read' over scope
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
Use case: organizations running a shared-APIM, multi-team model (one
resource group, several teams' service principals) currently must choose
between granting every team broad RG-scoped read access to every other
resource in the RG (other APIM instances, storage, App Insights, etc.), or
funneling all publishes through a single centrally-scoped identity — both
work against per-team least privilege. This also breaks parity with extract,
where workspace-scoped Reader + Service Reader (no RG scope) is already
sufficient.
Proposed solution
Scope the preflight check down to only what publish actually needs: read
access to the target APIM service. Step 2 above already GETs the APIM
service resource directly and will itself return 404 if the resource group
or instance doesn't exist, so the RG-level check in step 1 is purely
diagnostic (a slightly clearer "resource group not found" message) and isn't
load-bearing for correctness. Two options, in order of preference:
Drop the RG-level check entirely and rely on the APIM-service GET
(step 2) for existence validation. Slightly less specific error message
on a missing RG vs. missing APIM instance, but removes the RG Reader
requirement entirely.
Make the RG check non-fatal: if it returns 403 specifically, log a
warning and continue to step 2, only hard-failing on a genuine 404.
Preserves the diagnostic for identities that do have RG-level access,
without hard-blocking least-privilege ones.
This issue is still relevant for us. The Resource Group-level Reader requirement continues to prevent us from using a least-privilege identity scoped only to the target APIM service/workspace.
Activity
mwalser commentedon Oct 2, 2026
We're hitting this too. It's blocking our migration from apiops (https://github.com/Azure/apiops).
I would suggest just dropping the RG check in
validatePreFlight(). Its not really adding a lot of value for the issues it causes.github-actions commentedon Nov 2, 2026
It will be automatically closed after 60 days of inactivity.
To keep this issue open:
stalelabel.mwalser commentedon Nov 2, 2026
No progress happened; The issue is still current.
michelversluijs commentedon Nov 3, 2026
This issue is still relevant for us. The Resource Group-level Reader requirement continues to prevent us from using a least-privilege identity scoped only to the target APIM service/workspace.