Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Functions: Force HTTPS

Is there a way with Azure Functions to force connections to be over HTTPS?

I'm not seeing it in the App Settings, and I don't see any reference to web.config for Azure Functions.

like image 497
Doug Avatar asked Feb 22 '17 22:02

Doug


People also ask

How do I enable https on Azure function app?

You can do it by going to your function app in azure portal. Under the settings section you will see the "custom domains" as a selection option. Now on the new page you will see the toggle called HTTPS Only, On it and you will be able to access you api endpoint with "https". Like this as below.

Can you trigger an Azure function using an HTTP request?

The HTTP trigger lets you invoke a function with an HTTP request. You can use an HTTP trigger to build serverless APIs and respond to webhooks. The default return value for an HTTP-triggered function is: HTTP 204 No Content with an empty body in Functions 2.

How do I make my Azure function secure?

To fully secure your function endpoints in production, consider implementing one of the following Function app-level security options: Turn on App Service authentication and authorization for your Functions app. See Authorization keys. Use Azure API Management (APIM) to authenticate requests.


1 Answers

Update November 2017

In the Azure portal, go to your function app.

Platform features > Custom Domains > toggle HTTPS Only to 'On'.

Anyone using HTTP will receive a 301 Moved Permanently and be redirected to the HTTPS endpoint. You do not need to actually add a new hostname/domain to toggle this feature. This appears to work with both consumption and app service plans.

like image 104
Cody Avatar answered Sep 28 '22 12:09

Cody