Azure / Azure/azure-powershell

Get-AzResource doesn't return subresource for Microsoft.Web/sites/instances

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

Description

### Description

When running the command

```PowerShell
Get-AzResource -ResourceType 'Microsoft.Web/sites/instances' -Name $($appPlanApps[0].Name) -ResourceGroupName $($appPlanApps[0].ResourceGroup) -Verbose -Debug
```

Nothing is returned to the command output.

The debug output shows the following URI being called

```
Absolute Uri:
https://management.azure.com/subscriptions/REDACTED/resourceGroups/REDACTED/resources?$filter=resourceType EQ 'Microsoft.Web/sites/instances'&api-version=2021-04-01
```

Now, when i run the same command **but** add the ```-ApiVersion '2018-02-01' ``` I **do** get back the expected list of instances.

### Issue script & Debug output

```PowerShell
Absolute Uri:
https://management.azure.com/subscriptions/REDACTED/resourceGroups/REDACTED/resources?$filter=resourceType EQ 'Microsoft.Web/sites/instances'&api-version=2021-04-01

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Cache-Control : no-cache
Pragma : no-cache
x-ms-ratelimit-remaining-subscription-reads: 11998
x-ms-request-id : dbb2ffec-a4e4-434a-8cb7-e3c5033e86db
x-ms-correlation-request-id : dbb2ffec-a4e4-434a-8cb7-e3c5033e86db
x-ms-routing-request-id : CENTRALUS:20220426T233813Z:dbb2ffec-a4e4-434a-8cb7-e3c5033e86db
Strict-Transport-Security : max-age=31536000; includeSubDomains
X-Content-Type-Options : nosniff
Date : Tue, 26 Apr 2022 23:38:12 GMT

Body:
{
"value": []
}

DEBUG: AzureQoSEvent: Module: Az.Resources:5.6.0; CommandName: Get-AzResource; PSVersion: 7.2.2; IsSuccess: True; Duration: 00:00:00.5404264
DEBUG: Finish sending metric.
DEBUG: 7:38:13 PM - GetAzureResourceCmdlet end processing.
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 7.2.2
PSEdition Core
GitCommitId 7.2.2
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```

### Module versions

```PowerShell
Name Version
---- -------
Az.Accounts 2.7.6
Az.Resources 5.6.0
Az.Websites 2.10.0
```

### Error output

```PowerShell
None, blank
```

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.