Share via

How to set https on when creating an azure function through the cli

Aaron W Pedwell 21 Reputation points
2021-01-14T13:14:56.827+00:00

I am creating an azure function using the cli step in a release pipeline. I have the following line to set some config. How do I add httpsOnly to this

az functionapp config set --use-32bit-worker-process false --name '$(ProcessorFunctionName)' --resource-group '$(resourceGroupName)' --ftps 'FtpsOnly'

How do I add httpsOnly to this?

So far I can use

az functionapp update -n '$(ProcessorFunctionName)' -g '$(resourceGroupName)' --set 'httpsOnly=true'

to set it but surely this should be able to be added to config set command

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.

0 comments No comments

Answer accepted by question author

Andriy Bilous 12,181 Reputation points MVP
2021-01-14T13:59:07.187+00:00

Hello @Aaron W Pedwell
Unfortunately there is no option to create functionapp with https only set to true or on, as az cli does not appear to support this feature.
Microsoft is planning to add https only option to az cli in next releases

https://github.com/Azure/azure-cli/issues/14165
https://github.com/Azure/Azure-Functions/issues/1647

However you can use --generic-configurations option and specify HttpsOnly=true there
az functionapp config set --use-32bit-worker-process false --name '$(ProcessorFunctionName)' --resource-group '$(resourceGroupName)' --ftps 'FtpsOnly' --generic-configuration "{"HttpsOnly": true}"

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Ping 1 Reputation point
    2022-05-04T12:52:21.857+00:00

    az functionapp update --name '<function name>' --resource-group '<resource group name>' --set httpsOnly=true

    Found here: https://stackoverflow.com/questions/55996994/programmatically-configure-https-only-for-azure-function-app

    Was this answer helpful?

    0 comments No comments

  2. Aaron W Pedwell 21 Reputation points
    2021-01-14T14:20:37.267+00:00

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.