Skip to content

Use identity-first runtime auth for default-disabled key access - #75

Open
Paul Yuknewicz (paulyuk) wants to merge 3 commits into
mainfrom
paulyuk-disabled-built-in-key-docs
Open

Paul Yuknewicz (paulyuk) wants to merge 3 commits into
mainfrom
paulyuk-disabled-built-in-key-docs

Conversation

@paulyuk

@paulyuk Paul Yuknewicz (paulyuk) commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 9ff02f477023091f7808b5ee25fccfe39641a1dc

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ Live quickstart deployments demonstrated alias-scoped Entra authorization with Bash and PowerShell.
↑ Strict labs, plugin, migration CI-equivalent, template and focused helper checks passed.
↓ Phase 2 default-disabled gateway behavior and new portal labels cannot yet be validated end to end; portal/theme/mobile walkthroughs remain unperformed.
Diagnosis confidence 9.5/10 ↑ Source review found key-first defaults, missing gateway-wide enablement prerequisites and dual-value regeneration guidance; the revision addresses each against the affirmed runtime-access contract.
Evidence fit 8.5/10 ↑ Documentation now distinguishes all-key disablement from named-key creation, requires Owner enablement, and specifies the expected runtime/control-plane errors.
↓ Default-disabled behavior awaits Phase 2 availability; existing live evidence validates Entra authorization, not the new key-access gate.

Intent

Make Microsoft Entra ID with least-privilege RBAC the expected runtime path and handle all key-based access being disabled by default in Phase 2. This is a gateway-wide control, not a setting for one built-in key.

The affirmed Phase 2 contract uses properties.disableLocalAuth: new gateways default to true, and existing gateways initialize to false to preserve current access. Only a gateway Owner can change it. Enabling requires risk acknowledgment and is subject to Azure Policy audit or denial.

Changes

  • Make the quickstart identity-first across portal, Azure CLI, Bicep + azd, and Terraform. Grant AI Gateway Models User on the specific alias, acquire a gateway-audience token, and call it from Bash or PowerShell. Separate caller authorization from the gateway's outbound Foundry identity.
  • Default quickstart root templates to no named app key. Retain the explicit key-client opt-in and shared-module compatibility defaults, plus Terraform's moved block for existing deployments. State that creating a named key does not enable key-based access. Do not add the unavailable gateway property or invent CLI flags.
  • Require Owner enablement before every scoped API-key-client exercise. Teach one value per named key, View key, and Regenerate key through regeneratePrimaryKey; update both regeneration helpers and add focused Bash/PowerShell regression checks. Planned overlap uses a second named key, not a secondary value.
  • Document Authorization: Bearer <key> or api-key, never x-api-key or both headers. Keys grant gateway-wide access within the hidden default workspace, not per-asset RBAC. Copying a client secret to Key Vault is distinct from future gateway-integrated customer-vault storage.
  • Add Phase 2 troubleshooting for runtime 401 with OTel audit reason KeyAuthenticationDisabled, authorized key create/update/listSecrets/regenerate returning 409 LocalAuthDisabled, and policy-denied enablement returning 403 RequestDisallowedByPolicy. Metadata reads and deletion remain available; Entra authentication is unaffected.
  • Update the previously affected labs, troubleshooting, home-page example, diagram and labs skill. Remove key-specific screenshots from the default playground instructions. Agent 365 MCP helpers accept Entra tokens, retain explicit named-key support, and reject ambiguous credentials.
  • Keep migration guidance normative: settle access on entra-rbac, require caller object IDs and least-privilege model/tool scopes through prereq:caller-rbac, complete every configuration phase, and verify caller cutover separately. Legacy plans targeting APIM's master require an updated tool and a new plan. Never recreate master, remove its target by hand, or skip/resume around a phase.

Scope

This PR includes the quickstart templates and supporting shell helpers as well as documentation. It does not change the migration engine. That implementation is separate in #76; its existing keys-behavior paragraph remains untouched here.

The rest of the lab catalog is a separate follow-up. Retained key-based SDK, notebook, migration and IaC exercises are explicitly labeled, not claimed to have been converted to Entra.

Open follow-ups

  • Adopt the gateway key-access control in templates and document the CLI/Owner enablement workflow once a supported gateway API version and CLI expose it. The current API and CLI do not, so no disableLocalAuth gateway property or fabricated risk-acknowledgment flag is added. Existing Foundry backend disableLocalAuth settings are unrelated and remain unchanged.
  • Validate end to end against a new default-disabled gateway when Phase 2 is available, including Owner acknowledgment, policy denial, blocked runtime and key-management operations, single-value regeneration, and the new portal labels. All-in-one templates that create a gateway and keys are explicitly not ready for new Phase 2 gateways until the Owner-enablement API is available.
  • Convert the remaining lab catalog to identity-first runtime authentication separately.

Validation

  • cd labs && npm run sync && npm run build && npm run check: passed with zero warnings across 35 labs. Strict plugin YAML/manifest validation and git diff --check passed.
  • Bicep compilation and Terraform format/validation passed for the changed quickstart and key-lab configurations. Earlier live azd up and final-template reprovision passed; Terraform apply and a subsequent no-change plan passed. The root key opt-in plan adds only app-first-call; an existing shared-module consumer still plans its named key.
  • On both earlier throwaway gateways, the caller received 403 before its alias-scoped role assignment and 200 after propagation. Both Bash and PowerShell model requests returned nonempty responses. No API-key values were retrieved. These checks do not establish the Phase 2 disabled-key state.
  • Focused regeneration tests passed in both shells: only the primary/single-value operation is used, legacy value selectors fail before Azure calls, a simulated 409 LocalAuthDisabled stops before secret retrieval, and the full value is not printed. MCP-helper tests passed for Entra tokens, explicit API keys, missing credentials and ambiguous credentials. Bash syntax and PowerShell parsing passed.
  • Migration CI matrix rerun on Python 3.10 and 3.13: 1,043 passed, 1 skipped on each. Capability compilation reported zero errors/warnings and the existing newer-release suggestion. The pinned b31 wheel's SHA-256, isolated installation, exporter self-test, fresh CLI-surface comparison and strict compilation against that surface passed.
  • The earlier verification resource groups were deleted, Foundry accounts purged and deployment history removed. This alignment pass created no Azure resources. Earlier local preview serving succeeded in the existing Edge session; visual automation was unavailable because that session disables Apple Events JavaScript. No portal, theme or mobile visual result is claimed.
  • All commits use the registered personal paulyuk 1Password signing key. GitHub verified the exact new signed commit object as verified: true, reason valid, before the branch push.

References

Use named app keys throughout the affected labs and qualify historical screenshots and migration output. Flag the current master-subscription mapping blocker without recreating a built-in key or bypassing any phase.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Make the quickstart identity-first with alias-scoped caller RBAC, token-based requests, and explicit key-client opt-in. Keep retained key exercises separate and migration configuration completion distinct from caller cutover.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@paulyuk Paul Yuknewicz (paulyuk) changed the title docs: handle API built-in keys being disabled Use identity-first runtime auth to handle disabled API built-in keys Dec 3, 2026
Require Owner enablement for API-key clients, document the Phase 2 API gap, and teach single-value key regeneration.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@paulyuk Paul Yuknewicz (paulyuk) changed the title Use identity-first runtime auth to handle disabled API built-in keys Use identity-first runtime auth for default-disabled key access Dec 3, 2026

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant