如何列出Azure Function应用程序中的所有功能 [英] How to list all the functions in an Azure Function App

查看:57
本文介绍了如何列出Azure Function应用程序中的所有功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用PowerShell cmdlet Get-AzureRMResource列出所有Azure资源.

I can use the PowerShell cmdlet Get-AzureRMResource to list all Azure resources.

是否有一个包含ResourceGroupNameSiteName的cmdlet,它返回该站点"中的所有功能.

Is there a cmdlet that takes a ResourceGroupName and a SiteName and it returns all the functions in that "Site".

或者,我可以使用cmdlet的组合来获取这些详细信息.

Or, a combination of cmdlets that I can use to get these details.

推荐答案

正如Fabio Cavalcante所说,Azure PowerShell不支持此功能,您可以使用Rest API来获取它.这是一个如何使用PowerShell获取功能的示例.

As Fabio Cavalcante said, Azure PowerShell does not support this, you could use Rest API to get it. Here is a example how to get Functions with PowerShell.

#

#get token
$TENANTID="<tenantid>"
$APPID="<application id>"
$PASSWORD="<app password>"
$result=Invoke-RestMethod -Uri https://login.microsoftonline.com/$TENANTID/oauth2/token?api-version=1.0 -Method Post -Body @{"grant_type" = "client_credentials"; "resource" = "https://management.core.windows.net/"; "client_id" = "$APPID"; "client_secret" = "$PASSWORD" }
$token=$result.access_token

##set Header
$Headers=@{
    'authorization'="Bearer $token"
    'host'="management.azure.com"
}

$functions = Invoke-RestMethod  -Uri "https://management.azure.com/subscriptions/<subscriptions id>/resourceGroups/<group name>/providers/Microsoft.Web/sites/<function name>/functions?api-version=2015-08-01"  -Headers $Headers -ContentType "application/json" -Method GET

$functions.value

这篇关于如何列出Azure Function应用程序中的所有功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆