16
votes

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.

3
You're able to configure your Function App to use SSL using your certificate. In this way, you'll keep your Functions safer. This can be configured at Platform Feature on Functions Portal. There you'll able to find this option. - José Roberto Araújo
Does this disable HTTP? I didn't think it would? - Doug

3 Answers

23
votes

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.

5
votes

I don't think there is a way today, but I could see making a case for enforcing this globally (or at least as an option).

Please open an issue https://github.com/Azure/azure-webjobs-sdk-script/ so it can get properly tracked.

0
votes

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. enter image description here

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.

enter image description here