Add early storage validation and improve error messaging for Red Team scans#44389
Closed
Add early storage validation and improve error messaging for Red Team scans#44389
Conversation
Co-authored-by: slister1001 <103153180+slister1001@users.noreply.github.com>
Co-authored-by: slister1001 <103153180+slister1001@users.noreply.github.com>
Co-authored-by: slister1001 <103153180+slister1001@users.noreply.github.com>
Co-authored-by: slister1001 <103153180+slister1001@users.noreply.github.com>
Co-authored-by: slister1001 <103153180+slister1001@users.noreply.github.com>
Co-authored-by: slister1001 <103153180+slister1001@users.noreply.github.com>
Co-authored-by: slister1001 <103153180+slister1001@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update error messaging for storage account upload failures
Add early storage validation and improve error messaging for Red Team scans
Dec 11, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds early storage validation for Red Team scans to detect misconfigured storage before running attacks (which can take hours), and improves error messages when storage upload fails. The implementation adds a test_storage_upload() method that validates connectivity using a minimal in-memory test upload, integrated into the Red Team scan workflow right after MLFlow run initialization with visual feedback.
Key Changes:
- Added early storage connectivity validation that fails fast before running attacks
- Enhanced error messages with storage account names and actionable troubleshooting steps
- Implemented test coverage for both OneDP and non-OneDP project scenarios
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
azure/ai/evaluation/_common/evaluation_onedp_client.py |
Adds test_storage_upload() method that validates storage connectivity using BytesIO for in-memory test data |
azure/ai/evaluation/red_team/_mlflow_integration.py |
Adds test_storage_upload() wrapper that delegates to OneDP client for validation or skips for non-OneDP projects |
azure/ai/evaluation/red_team/_red_team.py |
Integrates storage validation into scan workflow with visual feedback after MLFlow initialization |
azure/ai/evaluation/_common/utils.py |
Enhances error messages in upload() to include storage account name and troubleshooting guidance |
tests/unittests/test_redteam/test_storage_validation.py |
Adds comprehensive unit tests for storage validation success/failure scenarios |
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_common/evaluation_onedp_client.py
Show resolved
Hide resolved
sdk/evaluation/azure-ai-evaluation/tests/unittests/test_redteam/test_storage_validation.py
Outdated
Show resolved
Hide resolved
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_common/evaluation_onedp_client.py
Outdated
Show resolved
Hide resolved
sdk/evaluation/azure-ai-evaluation/tests/unittests/test_redteam/test_storage_validation.py
Outdated
Show resolved
Hide resolved
…/evaluation_onedp_client.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/evaluation_onedp_client.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…m/test_storage_validation.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…m/test_storage_validation.py Co-authored-by: Copilot <175728472+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.
Description
Red Team scans upload results to storage at the end after all attacks complete (potentially hours). If storage is misconfigured, users waste significant time. This PR adds early storage validation and improves error messages.
Changes
Early Storage Validation
test_storage_upload()inEvaluationServiceOneDPClientthat validates storage connectivity before running attacksBytesIOfor efficient in-memory test data with UUID-based unique identifiersRedTeam.scan()workflow immediately after MLFlow run initializationEnhanced Error Messages
upload()inutils.pyto include storage account name and actionable troubleshooting steps:SYSTEM_ERROR(connectivity issues may be user config or system failures)Test Coverage
test_storage_validation.pywith unit tests covering success/failure scenarios for both OneDP and non-OneDP projectsImpact
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
pypi.org/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python python -m pip install --quiet pylint(dns block)/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python -m pip download --progress-bar off --disable-pip-version-check --only-binary=:all: --no-deps --python-version 3.9 -d /home/REDACTED/.local/share/virtualenv/wheel/house setuptools==77.0.3(dns block)/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python -m pip download --progress-bar off --disable-pip-version-check --only-binary=:all: --no-deps --python-version 3.9 -d /home/REDACTED/.local/share/virtualenv/wheel/house pip==24.0(dns block)pypi.python.org/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python -m pip download --progress-bar off --disable-pip-version-check --only-binary=:all: --no-deps --python-version 3.9 -d /home/REDACTED/.local/share/virtualenv/wheel/house setuptools==77.0.3(dns block)/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python -m pip download --progress-bar off --disable-pip-version-check --only-binary=:all: --no-deps --python-version 3.9 -d /home/REDACTED/.local/share/virtualenv/wheel/house pip==24.0(dns block)scanning-api.github.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.