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

john john 926 Reputation points
2023-03-02T10:58:30.3366667+00:00

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

but when i stored the 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:-

User's image

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 valult's access policy with Read & List permission on the secret permissions

User's image

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

User's image

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,207 questions
{count} votes