Azure function app v1 with KeyVault. Getting Azure.core not found

Viewed 395

This has been driving me nuts for the past few days.

I'm trying to write an Azure Function App V1 that integrates with Microsoft Dynamics CRM. Because Dynamics uses System.Web.Services I can't use any higher version of function app above v1.

I've tried to create a simple project that currently has Azure.Identity (1.5.0) with Azure.Security.KeyVault.Secrets (4.2.0) but every time I try to run this it blows up with...

Could not load file or assembly 'Azure.Core, Version=1.15.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'

I can see that Azure.Security.KetVault.Secrets has the requirment Azure.Core >= 1.15.0 and Azure.Identity is 1.20.0.

This is a new project with the following settings...

<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <TargetFramework>net472</TargetFramework>
     <AzureFunctionsVersion>v1</AzureFunctionsVersion>   </PropertyGroup>   <ItemGroup>
     <PackageReference Include="Azure.Identity" Version="1.5.0" />
     <PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.2.0" />
     <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.38" />   </ItemGroup>   ItemGroup>
     <Reference Include="Microsoft.CSharp" />   </ItemGroup>   <ItemGroup>
     <None Update="host.json">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Update="local.settings.json">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToPublishDirectory>Never</CopyToPublishDirectory>
     </None>   
</ItemGroup>
 </Project>

And in the code all I'm doing is the following....

 string keyVaultName = "**************";
 var kvUri = "https://" + keyVaultName + ".vault.azure.net";

 var client = new SecretClient(new Uri(kvUri), new DefaultAzureCredential());

From the above it should work?

What I'm doing, is it possible with V1 function apps?

0 Answers
Related