Abhay Chandramouli Thanks for posting your question in Microsoft Q&A. Based on the description, you are looking to add TLS/SSL certificate to function app and then access the certificate and send it when making API call.
- You can upload TLS/SSL certificate directly to Azure Functions, but the recommended way is to keep it in Azure Key Vault and import the certificate in the Function app. Here is the detailed doc: https://learn.microsoft.com/en-us/azure/app-service/configure-ssl-certificate?toc=%2Fazure%2Fazure-functions%2Ftoc.json&tabs=apex for App service which is applicable for Functions too.
- To access the certificate in your app code, add setting "WEBSITE_LOAD_CERTIFICATES" as described in the doc: https://learn.microsoft.com/en-us/azure/app-service/configure-ssl-certificate-in-code or simply add
*
to access all added certificates. - Then using the code snippet shared in the doc, you can retrieve the certificate info in your application code and make targeted HTTP call which vary depending on the implementation. Here is reference guide for ASP.NET core Implement an HttpClient using a certificate and IHttpClientFactory.
Check out similar discussion in SO thread (other discussion) with the sample code snippet that will help you get started. I hope this helps and let me know if any questions.
If you found the answer to your question helpful, please take a moment to mark it as Yes
for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.