How to list all the features of an Azure Function app

I can use the PowerShell cmdlet Get-AzureRMResource

to list all Azure resources.

Is there a cmdlet that accepts ResourceGroupName

and SiteName

, and it returns all the functionality of this "site".

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

+3


source to share


3 answers


As Fabio Cavalcante said, Azure PowerShell doesn't support this, you can use the Rest API to get it. Here's an example of 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

      

enter image description here

+2


source


Not a PowerShell cmdlet, but you can use the ListFunctions API as described here



+3


source


This is possible using a cmdlet Get-AzureRmResource

.

$Params = @{
    ResourceGroupName = $ResourceGroupName
    ResourceType      = 'Microsoft.Web/sites/functions'
    ResourceName      = $AppName
    ApiVersion        = '2015-08-01'
}
Get-AzureRmResource @Params

      

+1


source







All Articles