Get Function & Host Keys of Azure Function In Powershell

前端 未结 4 735
孤街浪徒
孤街浪徒 2020-12-09 20:56

I have deployed Azure function using Arm template. I need the Function Key & host Key of deployed Azure Function in Powershell. Currently I am trying to get the keys Fro

4条回答
  •  悲&欢浪女
    2020-12-09 21:25

    I got it working by using the following:

        "outputs": {
        "FunctionAppName": {
            "type": "string",
            "value": "[parameters('functionName')]"
        },
        "Key": {
            "type": "string",
            "value": "[listsecrets(resourceId('Microsoft.Web/sites/functions', parameters('existingFunctionAppName'), parameters('functionName')),'2015-08-01').key]"
        },        
        "Url": {
            "type": "string",
            "value": "[listsecrets(resourceId('Microsoft.Web/sites/functions', parameters('existingFunctionAppName'), parameters('functionName')),'2015-08-01').trigger_url]"
        }        
    }
    

    I couldn't find any examples either. But by using the above, a quickstart sample at GitHub and the documentation of resource functions along with a some trial and error, I got it to out.

    Please note the variables/parameters and names have been changed.

提交回复
热议问题