2

I am trying to use Azure Managed Service Identity with Azure functions and KeyVault. I want to be able to get secrets from the vault and also use ADAL to authenticate with a certificate to get access to SharePoint Online. I'm developing locally with Visual Studio 2017.

I want to use 3.19.8 of Microsoft.IdentityModel.Clients.ActiveDirectory and the nuget package for Microsoft.Azure.Services.AppAuthentication states a dependency of Microsoft.IdentityModel.Clients.ActiveDirectory (>= 3.14.2). However, it seems to be hard linked to 3.14.2. I get an exception 'Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.14.2.11' if I try to access the vault.

If I try to use 3.14.2 then I get exceptions with authenticating with the cert saying method isn't found.

So I am wondering if the description in Nuget is incorrect or if it is possible to use a later version of Microsoft.IdentityModel.Clients.ActiveDirectory in an Azure Function which doesn't seem to allow Redirection of assembly versions.

Thanks

Jeremy
  • 21
  • 2
  • Hmm, it looks like it is an issue with Visual Studio. I have tried it on a PC at home and it works okay. – Jeremy Jul 02 '18 at 08:58

2 Answers2

0

Older versions of NuGet / Visual Studio use project hint paths to reference the packaged dependencies. Upgrading with newer versions of NuGet does not seem to work, as the old hint path is not updated.

Please edit your csproj manually to remove these.

Bogdan Gavril MSFT
  • 20,615
  • 10
  • 53
  • 74
0

This was very odd. After finding that I could get it to work on my PC at home, I re-entered the credentials in Visual Studio and removed and re-added the Microsoft.Azure.Services.AppAuthentication package and it started working on my work PC as well.

Jeremy
  • 21
  • 2