The APIM developer portal cannot be configured for Azure AD sign-in.
Every write attempt to the /identityProviders/aad ARM sub-resource
returns HTTP 502 Bad Gateway. The ARM GET on /identityProviders
returns 200 with 0 results, confirming no provider has ever been
saved.
What was attempted
- Portal wizard ("Enable Azure AD") — ran twice. All 5 steps show
green checkmarks but nothing is written. Developer portal confirms no
AAD sign-in option appears.
- Manual "Add identity provider" form (Identities blade) — same 502.
- ARM REST API — tested on API versions 2021-08-01, 2022-08-01,
2023-09-01-preview — all 502 on PUT.
- APIM direct management API with admin SAS token — 502.
- After assigning API Management Service Contributor RBAC and
re-authenticating interactively — still 502.
What works on the same instance
- GET /identityProviders → 200 (0 results)
- PUT /openidConnectProviders → succeeds
- All other APIM management operations work normally
This confirms the 502 is specific to the /identityProviders write
path on this instance, not a general management plane outage.
App registration — fully configured per MS recommendations
- ✅ SPA redirect URI (new developer portal)
- ✅ Web redirect URI (deprecated portal)
- ✅ Access tokens and ID tokens enabled
- ✅ Directory.ReadAll Application permission — admin consent granted
- ✅ User.Read Delegated permission — admin consent granted
- ✅ Optional claims (email, family_name, given_name) on ID token
- ✅ Client secret valid, not expired
- ✅ MSAL selected as client library
Error is unchanged after all of the above.
Question
Is this a known issue with the BasicV2 management plane for the
/identityProviders sub-resource? The openidConnectProviders path
works on the same instance, so the fault appears specific to the
identity providers backend. Is there a way to repair this without
recreating the APIM instance?