Skip to content

[#6889] CQA to support TokenCredential instead of key #6892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 28, 2025

Conversation

ceciliaavila
Copy link
Collaborator

Fixes #6889

Description

This PR adds the ability to use a Managed Identity ClientId to authenticate to the Language service.

Specific Changes

  • Added the Azure.Identity package as dependency in Microsoft.Bot.Builder.AI.QnA.
  • Added the ManagedIdentityClientId property to the QnAMakerEndpoint class.
  • Added an internal constructor in QnAMakerDialog to handle the Managed Identity Client Id.
  • Added WithEndpointKey and WithManagedIdentityClientId methods to the QnAMakerDialog class to configure which authentication the request will use.
  • Added the ability to detect and get the MSI token in the HttpRequestUtils class.

Testing

The following images show the 48.customQABot-all-features sample working with both authentication methods, EndpointKey (Emulator) and ManagedIdentityClientId (WebChat)
image

@ceciliaavila ceciliaavila added the Automation: No parity PR does not need to be applied to other languages. label May 8, 2025
@tracyboehrer tracyboehrer merged commit d77e238 into main May 28, 2025
1 check passed
@tracyboehrer tracyboehrer deleted the southworks/add/cqa-msi-support branch May 28, 2025 21:05
tracyboehrer pushed a commit that referenced this pull request May 29, 2025
* Add support for MSI to access CQA service

* Use IsNullOrWhiteSpace instead of IsNullOrEmpty

* Catch exception in GetTokenAsync call
tracyboehrer added a commit that referenced this pull request May 29, 2025
* Add support for .NET 9.0 (#6887)

* Add NET9 and remove NET6 target frameworks

* Configure NETAnalyzers version in Directory.Build.props

* Update yamls to support NET 9.0

* Update tests to pass on Mac build.

* [#6889] CQA to support TokenCredential instead of key (#6892)

* Add support for MSI to access CQA service

* Use IsNullOrWhiteSpace instead of IsNullOrEmpty

* Catch exception in GetTokenAsync call

* Fix MemoryStream Converter when serializing (#6888)

---------

Co-authored-by: Cecilia Avila <44245136+ceciliaavila@users.noreply.github.com>
Co-authored-by: Joel Mut <62260472+sw-joelmut@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Automation: No parity PR does not need to be applied to other languages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CQA to support TokenCredential instead of key
2 participants