I have an event grid triggered function app. I am using the below code to get function URL.
function Get-Function-Key {
return (Invoke-AzResourceAction `
-Action listKeys `
-ResourceType 'Microsoft.Web/sites/functions/' `
-ResourceGroupName $ResourceGroup `
-ResourceName "$FuncAppName/$FuncName" `
-Force).default
}
$functionKey = Get-Function-Key -FuncAppName $FuncAppName -FuncName $FuncName `
-ResourceGroup $ResourceGroup
$apiUrl = "https://$FuncAppName.azurewebsites.net/runtime/webhooks/EventGrid?functionName=$FuncName&code=$functionKey"
I noticed the function URL uses masterkey instead of function key. Is there any command in powershell to get master key of the function URL.
paramblock, yet you call it using parameters??param([string]$FuncAppName, [string]$FuncName, [string]$ResourceGroup)