Azure Function strop working after storing the configuration values inside Key Vault

Steel Contributor

I have created an Azure Function which is working well locally and after deploying it to Azure. the azure function works on timely bases. the Azure Function integrate with SharePoint using Azure Active Directory App using certificate.

but when i stored the Azure Function's configuration values as secrets inside Key Vault, i start receiving those errors:-

 

 

 

2023-03-02T10:45:00.187 [Error] Executed 'Function1' (Failed, Id=47b9c6b7-dfe3-4202-815f-1d52bc24c3fa, Duration=166ms)System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException : Value cannot be null. (Parameter 'certificate')at Microsoft.Identity.Client.ConfidentialClientApplicationBuilder.WithCertificate(X509Certificate2 certificate)at PnP.Core.Auth.X509CertificateAuthenticationProvider.Init(PnPCoreAuthenticationCredentialConfigurationOptions options)at PnP.Core.Auth.X509CertificateAuthenticationProvider..ctor(String clientId,String tenantId,PnPCoreAuthenticationX509CertificateOptions options)at ShipSigma.Startup.<>c__DisplayClass0_0.<Configure>b__0(PnPCoreOptions options)

 

 

now the certificate thumbprint is stored inside azure function's configuration as follow:-

 
 

image.png

 

now if i reference the actual thumbprint value directly it will work, any advice??

I already added the Azure Function as an Identity + reference the azure function app inside key vault's access policy with Read & List permission on the secret permissions

 
 

image.png

 

but when i added the key vault reference inside the Azure Function configuration, i got this red icon, as follow:-

image.png

so what is causing this error? and my azure function to stop working when storing its configuration inside key vault?

 

0 Replies