Azure Function Secured with Certificate

Omayma Khammassi
3 min readDec 17, 2020

This blog explains in quick steps the whole process from development to deployment of Azure Function secured with certificate.
The feature of this article is to facilitate the use of certification in Azure.

Introduction

Azure Function is an Azure resource, enables users to run lines of code (C#, Java, PHP) triggered by an event that occurred in Azure. It may be an HTTP request, Timer, or Queue…

Create Azure Function

To create a new Azure Functions with HTTP Triggers Project, Open Visual Studio and Click on “Create a new project”. Choose Azure, click on Azure Functions, and then click Next.

Next, we need to configure some parameters:
1.Select Azure Functions v3 (.NET Core)
2.Configure the Storage Account to None,
3.Set the Authorization Level to Anonymous
4.The most important thing, Choose the trigger, in our case we select HTTP trigger in the templates list.

Now your Azure Function is ready to be tested and deployed.

Publish Azure Function

To deploy a resource in Azure, you must have an Azure Subscription.

From the Solution Explorer, right-click on the Project Name and click on Publish.

In the Publish wizard, choose Azure as a Target and click on Next.

On the next screen, the wizard will allow you to deploy your application under Windows or Linux.

In the create Function App window, Choose the name of your Azure Function along with other details. And click Next.

When the creation process is completed, click on Finish.

Now, you will simply need to click on the Publish button.

Add Certification

First, you need to browse to the Azure Portal and go to your function app resource .
Click on the name of the function that you have deployed earlier.
To use certification you need to navigate to TLS/SSL settings,

and Click “Private Key Certificates(.pfx)” to Upload the .pfx certificate file. Give the same password that you used for generating the certificate.

Now go to the Configuration section, in the application settings section,
add a new setting with Name WEBSITE_LOAD_CERTIFICATES and the thumbprint as the Value.

Test Azure Function

On the Overview page, click on Get Function Url.

Finally To check the result, simply can copy the Function URL to a new tab in your browser for example, or use Postman!

Conclusion

In this article, we learned to create and publish Azure Function.
We focus on how we can upload a certification in Azure to secure the Function.
Happy to help!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Omayma Khammassi
Omayma Khammassi

Written by Omayma Khammassi

Software developer and a lifelong learner.Passionate about Dot.Net application and the Microsoft Azure platforms.

No responses yet

Write a response