Get Azure Function keys from an Azure Function at deployment time?

后端 未结 5 1263
伪装坚强ぢ
伪装坚强ぢ 2021-02-06 14:41

I\'m sending an email in Azure Functions using the SendGrid bindings. As part of the contents of that email, I\'d like to include a link to one of the HTTP methods in the Azure

5条回答
  •  攒了一身酷
    2021-02-06 15:11

    Powershell way:

    $funcKey = (Invoke-AzResourceAction `
        -Action listKeys `
        -ResourceType 'Microsoft.Web/sites/functions/' `
        -ResourceGroupName $resourceGroup `
        -ResourceName "$funcAppName/$funcName" `
        -Force).default
    

提交回复
热议问题