[azure-ai-evaluation] Add Entra authentication for App Insights writeback#48250
Open
RabsB wants to merge 4 commits into
Open
[azure-ai-evaluation] Add Entra authentication for App Insights writeback#48250RabsB wants to merge 4 commits into
RabsB wants to merge 4 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2c234682-eb8a-47b6-add7-ba0edb243d8a
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2c234682-eb8a-47b6-add7-ba0edb243d8a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2c234682-eb8a-47b6-add7-ba0edb243d8a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2c234682-eb8a-47b6-add7-ba0edb243d8a
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Entra authentication for Application Insights evaluation-result writeback while preserving API-key support.
Changes:
- Extends
AppInsightsConfigwith credential options. - Adds scoped credential delegation and export-failure tracking.
- Adds authentication, failure, timeout, and compatibility tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
_model_configurations.py |
Adds authentication fields to App Insights configuration. |
_evaluate/_evaluate.py |
Implements scoped Entra authentication and failure handling. |
test_evaluate.py |
Tests authentication modes and exporter behavior. |
| export_result_tracker: Optional["_ExportResultTrackingLogExporter"] = None | ||
| log_exporter: Any = azure_log_exporter | ||
| if use_entra_authentication: | ||
| export_result_tracker = _ExportResultTrackingLogExporter(azure_log_exporter, LogExportResult.FAILURE) |
Comment on lines
+1543
to
+1544
| if credential_type is None or credential_type == "ApiKey": | ||
| return exporter_options |
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.
Summary
credential_typeandTokenCredentialfields toAppInsightsConfig.ProjectManagedIdentityauthentication while retaining the Application Insights connection string for resource identification and ingestion routing.https://monitor.azure.com/.default.ApiKeyas a first-class authentication mode and retain backward-compatible API-key behavior when the discriminator is absent.DefaultAzureCredentialor falling back to another authentication mode.Testing
Deployment notes
The caller remains responsible for supplying the project identity credential.
Monitoring Metrics PublisherRBAC on the connected Application Insights resource is external to this SDK change.