Azure / Azure/azure-powershell

'Get-AzWebApp -AppServicePlan $asp' doesn't return all deployed Azure Functions within an AppServicePlan

Open
#20,304 2 comments 0 reactions 0 assignees View on GitHub
bug customer-reported Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

Using powershell we try to resolve the number of function-apps deployed within an AppServicePlan using the 'Get-AzWebApp -AppServicePlan $asp' powershell call.
Currently it doesn't return all the hosted function-apps, but only 100. After investigating the Azure portal it looks the issue is also available within the Azure portal. Also there only 100 function-apps can be shown. The 'load more' button also doesn't load the additional function-apps that are deployed. So also the Azure portal has a bug. After investigating the requests executed in the Azure Portal using the Network tracing it is working based on the first 100, and than a nextLink url needs to be called.
The question is now, should the Get-AzWebApp need to execute the nextLink logic, so retrieve all the available function-apps?
If not, please let me know how I can get all the number of function-apps using the Powershell modules, because there is no function or module I can use to call the nextLink logic.

When running the below code it returns this:
Retrieving list of FunctionApps from 'ipaas-asp-functions-d'
Found 113 FunctionApps
But next it only displays the first 100 apps.

### Issue script & Debug output

```PowerShell
Install-Module Az.Functions -AllowClobber -Force -Scope CurrentUser
Import-Module Az.Functions
Install-Module Az.Websites -AllowClobber -Force -Scope CurrentUser
Import-Module Az.Websites

Write-Host -Verbose "Retrieving list of FunctionApps from 'ipaas-asp-functions-d'"
$asp = Get-AzAppServicePlan -ResourceGroupName "rg-functions-d" -Name "ipaas-asp-functions-d"
$apps = Get-AzWebApp -AppServicePlan $asp
Foreach($app in $apps)
{
Write-Host -Verbose Stopping FunctionApp $app.Name
#Stop-AzFunctionApp -Name $app.Name -ResourceGroupName $app.ResourceGroup -Force
}
```

### Environment data

```PowerShell
PS C:\dev\git\Internal-Cleanup> $PSVersionTable

Name Value
---- -----
PSVersion 5.1.19041.1682
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1682
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```

### Module versions

```PowerShell
PS C:\dev\git\Internal-Cleanup> Get-Module Az*

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.10.3 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault...}
Script 6.4.0 Az.Resources {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment...}
Script 2.11.5 Az.Websites {Add-AzWebAppAccessRestrictionRule, Add-AzWebAppTrafficRouting, Edit-AzWebAppBackupConfiguration, Enter-AzWebAppContainerPSSessio...
```

### Error output

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.