Azure / Azure/azure-powershell
Get-AzADApplication Does Not Return Results in USGov
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 54
Description
### Description
When using the `Get-AzADApplication` cmdlet in US Gov cloud, the cmdlet does not return any results. This issue does not repro when using AAD Public.
Proof that the app in the repro below exists:
### Issue script & Debug output
```PowerShell
PS C:\Users\eric> Connect-AzAccount -Environment AzureUSGovernment
PS C:\Users\eric> $objectId = (Get-AzADApplication -ApplicationId $applicationId).Id
PS C:\Users\eric> echo $objectId # no results, expected to return object ID of app in screenshot above.
PS C:\Users\eric> echo $applicationId
5ac3cfa7-a42a-4a42-9600-177bf6ab55e0
PS C:\Users\eric> Get-AzADApplication -Count # no results - expected result: 2 apps
```
### Environment data
```PowerShell
PS C:\Users\eric> $PSVersionTable.PSVersion
Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
7 4 2
```
### Module versions
```PowerShell
PS C:\Users\eric> Get-Module Az*
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.15.1 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, …
Script 6.15.1 Az.Resources {Export-AzResourceGroup, Export-AzTemplateSpec, Get-A…
```
### Error output
_No response_
Contributor guide
Research direction
Start with the Get-AzADApplication cmdlet in the Az.Resources module and reproduce the issue after connecting with AzureUSGovernment. Compare its application lookup and count behavior with AAD Public; done means the application ID returns its object ID and Get-AzADApplication -Count returns the expected two applications.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, powershell
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100