Repository navigation
Use Entra ID and asset-scoped runtime roles - #41
Open
Paul Yuknewicz (paulyuk) wants to merge 1 commit into
Open
Paul Yuknewicz (paulyuk) wants to merge 1 commit into
Paul Yuknewicz (paulyuk) wants to merge 1 commit into
Conversation
Remove gateway runtime keys and use refreshed Entra tokens. Scope model access to the developer and actual hosted instance identity, and tool access to the project connection. Preserve Bash and PowerShell parity and validate the supported gateway SKU and model defaults. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
af5c1cfc41f90840f8e315d60fdd23c88ca16840↑ Fresh azd deployment completed; hosted model and GitHub tools succeeded; delegated calls returned 200 on the granted alias and 403 on an ungranted alias.
↓ PowerShell hooks were exercised locally, but a full Windows deployment was not run.
Problem
The sample creates an AI Gateway runtime key, retrieves it during provisioning, and documents key-based access. That bypasses the intended Entra runtime authorization boundary and leaves users managing an unnecessary credential.
Solution
Use Microsoft Entra ID throughout, with no gateway runtime key resource, secret retrieval, API-key headers, or key fallback.
https://ai.gateway.azure.com/.defaultfor hosted calls. Local Python calls explicitly request the delegatedhttps://ai.gateway.azure.com/Data.Allscope through Azure CLI, with bounded execution and in-memory token caching and refresh.gpt-5-minideployment defaults.No
disableLocalAuthtemplate property is added because the current resource API does not expose it. The sample creates no runtime keys and supplies no key authentication path.Deploy and call
gh auth status --hostname github.com az login azd auth login azd up uv sync azd ai agent invoke "Create a concise daily repo digest for microsoft/agent-framework."Call the granted gateway alias directly:
Do not print or persist tokens or enable shell tracing. The README includes equivalent PowerShell commands and local agent instructions.
Validation
Ran the applicable repository workflow steps locally: Bicep builds, lifecycle and model-registration tests, Python unit tests, Docker build, and container smoke. Also ran Bicep lint, Bash syntax checks, PowerShell parsing, and execution tests for both script implementations.
A fresh
azd up --no-promptcompleted in temporary resource groups. The final hosted invocation returned HTTP 200 with a completed response, no failed response, and all three expected GitHub function calls. A delegated local call returned 200 ongpt-latest; the same caller received 403 on the ungrantedgpt-mini-latest.Deleted the temporary resource groups, scoped role assignments, generated Entra identities and blueprint, and deployment records. Purged the temporary Foundry accounts and verified absence. No existing gateway was modified.
Full end-to-end Windows deployment remains untested.