question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bot packages incompatibility with Azure Key Vault

See original GitHub issue

Version

4.7.0

Describe the bug

When adding Microsoft.Bot.Builder package to a working ASP.NET Core 3.1 app using Azure Key Vault make the app crash since Microsoft.IdentityModel.Clients.ActiveDirectory.Platform package cannot be found. This package doesn’t exist anymore, something in the required packages of Microsoft.Bot.Builder should be wrong.

To Reproduce

  • clone the project on https://github.com/nimbusparis/TestAKVWithBot

  • Remove the package Microsoft.Bot.Builder from the project

  • Deploy under Linux

  • Deploy a Azure Certificate on the server

  • Run the app, it should work.

  • Restore the package Microsoft.Bot.Builder in the project

  • Run the app

  • It crash with the following stack: `Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.14.2.11, Culture=neutral, PublicKeyToken=31bf3856ad364e35’. The system cannot find the file specified.

File name: ‘Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.14.2.11, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ at Microsoft.Extensions.Configuration.AzureKeyVault.AzureKeyVaultConfigurationOptions.GetTokenFromClientCertificate(String authority, String resource, String clientId, X509Certificate2 certificate) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.Extensions.Configuration.AzureKeyVault.AzureKeyVaultConfigurationOptions.GetTokenFromClientCertificate(String authority, String resource, String clientId, X509Certificate2 certificate) at Microsoft.Extensions.Configuration.AzureKeyVault.AzureKeyVaultConfigurationOptions.<>c__DisplayClass1_0.<.ctor>b__0(String authority, String resource, String scope) at Microsoft.Azure.KeyVault.KeyVaultCredential.PostAuthenticate(HttpResponseMessage response) at Microsoft.Azure.KeyVault.KeyVaultCredential.ProcessHttpRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Azure.KeyVault.KeyVaultClient.GetSecretsWithHttpMessagesAsync(String vaultBaseUrl, Nullable1 maxresults, Dictionary2 customHeaders, CancellationToken cancellationToken) at Microsoft.Azure.KeyVault.KeyVaultClientExtensions.GetSecretsAsync(IKeyVaultClient operations, String vaultBaseUrl, Nullable1 maxresults, CancellationToken cancellationToken) at Microsoft.Extensions.Configuration.AzureKeyVault.AzureKeyVaultConfigurationProvider.LoadAsync() at Microsoft.Extensions.Configuration.AzureKeyVault.AzureKeyVaultConfigurationProvider.Load() at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList1 providers) at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration() at Microsoft.Extensions.Hosting.HostBuilder.Build() at TestAKVWithBot.Program.Main(String[] args) in /opt/TestAKVWithBot/TestAKVWithBot/Program.cs:line 17 `

Expected behavior

Bot Builder should work with Azure Key Vault, not asking an obsolete library.

Additional context

This occurs on Linux when using Certificates to access to AKV.

[bug]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
pakrymcommented, Mar 25, 2020

There is a preview of replacement: https://www.nuget.org/packages/Azure.Extensions.Configuration.Secrets/1.0.0-preview.1

But we are not GAing it this month.

1reaction
EricDahlvangcommented, Feb 2, 2020

Thanks @nimbusparis

We should be able to keep this open until the packages are updated.

Jan 28th we were informed here https://github.com/Azure/azure-sdk-for-net/issues/7457#issuecomment-579539881 the Microsoft.IdentityModel.Clients.ActiveDirectory dependency in Microsoft.Azure.Services.AppAuthentication should be updated “within the next couple of weeks” After this rolls out, Microsoft.Extensions.Configuration.AzureKeyVault will need to be updated to use it. (Edit: bot builder will not need an update, since it is already using the latest version of the library causing this).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Key Vault Configuration 3.0 updates · Issue #12346
Azure Key Vault Configuration 3.0 updates #12346 ... It is required for docs.microsoft.com ➟ GitHub issue linking. ... @dotnet-bot ...
Read more >
Microsoft.Azure.KeyVault.Core doesn't Restore with ...
As the warning shows that you install the package Microsoft.Azure.KeyVault.Core 1.0.0 which has no dependencies.
Read more >
Azure Key Vault integration
Bot Agent within your customer environment where automations run and access customer applications. Important: You can edit the external key ...
Read more >
Tutorial - Use Azure Key Vault with an Azure web app in .NET
In this tutorial, you'll configure an Azure web app in an ASP.NET Core application to read a secret from your key vault.
Read more >
Azure Key Vault Administration client library for Python
Secrets management (azure-keyvault-secrets) - securely store and control access to tokens, passwords, certificates, API keys, and other secrets ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found