Coder Perfect

Using Bicep, output the newly formed function app key.


In a dedicated module, I have a bicep template that builds a function app. I’d like the function app key removed from the module. Is there a way to get the function key?

I can’t seem to find it in the property list:

Asked by Rob Bowman

Solution #1

If you want to get the default host key, use the listkeys function:

param functionAppName string

resource functionApp 'Microsoft.Web/sites@2018-11-01' = {
  name: functionAppName

output defaultHostKey string = listkeys('${}/host/default', '2016-08-01').functionKeys.default

Answered by Thomas

Post is based on