Skip to content

FEAT: Deprecate use_entra_auth and add auto-detect auth for Azure Speech converters#1634

Merged
varunj-msft merged 6 commits into
microsoft:mainfrom
varunj-msft:varunj-msftvarunj-msft/7679-AzureSpeechTextToAudioConverter-remove-use_entra_auth
Apr 22, 2026
Merged

FEAT: Deprecate use_entra_auth and add auto-detect auth for Azure Speech converters#1634
varunj-msft merged 6 commits into
microsoft:mainfrom
varunj-msft:varunj-msftvarunj-msft/7679-AzureSpeechTextToAudioConverter-remove-use_entra_auth

Conversation

@varunj-msft
Copy link
Copy Markdown
Contributor

Description

Deprecates the use_entra_auth parameter across both Azure Speech converters and the scorer pass-through chain, replacing it with auto-detection logic that matches the OpenAI target pattern.

Auth is now resolved automatically:

  • String azure_speech_key (or AZURE_SPEECH_KEY env var) -> API key auth
  • Callable azure_speech_key (sync or async token provider) -> Entra token auth via aad#{resource_id}#{token} format
  • Neither provided -> automatic Entra ID auth via DefaultAzureCredential + azure_speech_resource_id

The deprecated use_entra_auth param is kept with a DeprecationWarning (removal target: v0.15.0) for backward compatibility.

Note: Both converters now enforce keyword-only args (*) per style guide. All existing callers already use keyword args, but this is technically a breaking change for positional usage. Also, azure_speech_key is no longer visible in the backend converter catalog since its type changed from Optional[str] to Union[str, Callable, None] - users configure the key via the AZURE_SPEECH_KEY env var in the backend.

Files changed:

  • azure_speech_text_to_audio_converter.py - primary target
  • azure_speech_audio_to_text_converter.py - identical auth logic
  • audio_transcript_scorer.py, audio_true_false_scorer.py, audio_float_scale_scorer.py - deprecate pass-through param
  • .env_example - updated comment

Tests and Documentation

  • 26/26 converter unit tests pass (was 11 before; added tests for auto-detect, callable providers, async providers, deprecation warnings, env var fallback, missing credential errors)
  • 963 passed, 8 skipped on broader unit suite (0 regressions)
  • Ruff check clean, pre-commit hooks pass (ruff format, mypy strict)
  • Doc notebooks (doc/code/converters/2_audio_converters.py/.ipynb) don't use use_entra_auth - no JupyText changes needed

Comment thread pyrit/prompt_converter/azure_speech_audio_to_text_converter.py Outdated
Comment thread pyrit/prompt_converter/azure_speech_audio_to_text_converter.py Outdated
Comment thread pyrit/prompt_converter/azure_speech_audio_to_text_converter.py Outdated
Comment thread pyrit/prompt_converter/azure_speech_text_to_audio_converter.py Outdated
Comment thread pyrit/prompt_converter/azure_speech_audio_to_text_converter.py
Comment thread pyrit/prompt_converter/azure_speech_audio_to_text_converter.py Outdated
Comment thread pyrit/prompt_converter/azure_speech_audio_to_text_converter.py Outdated
Comment thread .env_example Outdated
Comment thread pyrit/score/audio_transcript_scorer.py Outdated
Comment thread pyrit/prompt_converter/azure_speech_audio_to_text_converter.py
Comment thread pyrit/score/audio_transcript_scorer.py
Comment thread tests/integration/converter/test_entra_auth_converters.py
Comment thread pyrit/prompt_converter/azure_speech_text_to_audio_converter.py Outdated
Comment thread pyrit/prompt_converter/azure_speech_text_to_audio_converter.py Outdated
Comment thread pyrit/prompt_converter/azure_speech_audio_to_text_converter.py
varunj-msft and others added 3 commits April 22, 2026 19:25
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…scorer deprecation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@varunj-msft varunj-msft force-pushed the varunj-msftvarunj-msft/7679-AzureSpeechTextToAudioConverter-remove-use_entra_auth branch from 8a66c90 to c971505 Compare April 22, 2026 20:27
@varunj-msft varunj-msft merged commit ccfc9a2 into microsoft:main Apr 22, 2026
39 checks passed
@varunj-msft varunj-msft deleted the varunj-msftvarunj-msft/7679-AzureSpeechTextToAudioConverter-remove-use_entra_auth branch April 22, 2026 20:51
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.

3 participants