Geert-Jan Smulders

My development blog

Azure: How to add a Host Key to your Azure Function App using a script

In order to make life easier, you might want to consider to have a predefined Host Key for your Azure Function Apps in your development/test environment. This can enable you to run (automated) tests without needing to find/update the host key after every new deployment.

Disclaimer: Setting a predefined Host Key to your Azure Function App (even if it’s “SuperDuperSecret1!”) is a serious security hazard and should not be applied to any production environment!

Bash

Below script is an adaptation of this script on Github.

PowerShell

If PowerShell has your preference, you can use below block. A service principal is used to login due to it being used in a  Azure DevOps deployment pipeline. If you’re running this from an environment where you’re already logged on, you can remove that part.

Thanks/Acknowledgements

Thanks to:

Next Post

© 2024 Geert-Jan Smulders

Theme by Anders Norén