Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-AzPolicyAlias - value cannot be null #16370

Closed
anwather opened this issue Nov 10, 2021 · 1 comment · Fixed by #16467
Closed

Get-AzPolicyAlias - value cannot be null #16370

anwather opened this issue Nov 10, 2021 · 1 comment · Fixed by #16467
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported good first issue Issues suited for folks who want to help for the first time. Policy Azure Resource Policy question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@anwather
Copy link
Contributor

Description

Running Get-AzPolicyAlias - error is generated Value cannot be null. (Parameter 'source')

Running with debug seems to return results up to a certain point and then it errors out

Issue script & Debug output

DEBUG: AzureQoSEvent: Module: Az.Resources:4.4.1; CommandName: Get-AzPolicyAlias; PSVersion: 7.2.0; IsSuccess: False; Duration: 00:00:14.0233222; Exception: Value cannot be null. (Parameter 'source');
DEBUG: Finish sending metric.
DEBUG: 10:42:14 AM - GetAzurePolicyAlias end processing.

Environment data

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

Module versions

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     2.6.1                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave…}
Script     2.6.0                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave…}
Script     2.5.4                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave…}
Script     1.7.1                 Az.Automation                       Core,Desk {Get-AzAutomationHybridWorkerGroup, Remove-AzAutomationHybridWorkerGroup, Get-AzAutomationJobOutputRecord, Import-AzAutomationDs…
Script     4.17.1                Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-AzAvailabilitySet, Update-AzAvailabilitySet…}
Script     2.2.3                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContainerRegistry, Update-AzContainerRegistry, Remove-AzContainerRegistry…}
Script     1.5.0                 Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get-AzIntegrationAccountAssembly, Get-AzIntegrationAccountBatchConfiguration, Get-AzIntegrat…
Script     1.4.1                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicyStateSummary, Get-AzPolicyRemediation…}
Script     0.11.0                Az.ResourceGraph                    Core,Desk {Search-AzGraph, Get-AzResourceGraphQuery, New-AzResourceGraphQuery, Remove-AzResourceGraphQuery…}
Script     4.4.1                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRoleAssignment, Get-AzRoleAssignment, New-AzRoleAssignment…}
Script     4.4.0                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRoleAssignment, Get-AzRoleAssignment, New-AzRoleAssignment…}
Script     3.12.0                Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAccountKey, New-AzStorageAccount, New-AzStorageAccountKey…}
Script     2.8.3                 Az.Websites

Error output

Value cannot be null. (Parameter 'source')
@anwather anwather added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Nov 10, 2021
@ghost ghost added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Nov 10, 2021
@dingmeng-xue dingmeng-xue added good first issue Issues suited for folks who want to help for the first time. Policy Azure Resource Policy labels Nov 11, 2021
@dingmeng-xue
Copy link
Member

Thanks for reporting. We will look into it.

vidai-msft added a commit to vidai-msft/azure-powershell that referenced this issue Nov 23, 2021
vidai-msft added a commit to vidai-msft/azure-powershell that referenced this issue Nov 26, 2021
… for command Get-AzPolicyAlias

Added coalesce check for collection objects in the Provider object
Updated mock test object for command Get-AzPolicyAlias accordingly (Fixed Azure#16370)
vidai-msft added a commit to vidai-msft/azure-powershell that referenced this issue Nov 29, 2021
… for command Get-AzPolicyAlias

Added coalesce check for collection objects in the Provider object
Updated mock test object for command Get-AzPolicyAlias accordingly (Fixed Azure#16370)
isra-fel pushed a commit that referenced this issue Nov 29, 2021
…test cases accordingly (#16370) (#16467)

* Added if condition to check the value of the parameter NamespaceMatch for command Get-AzPolicyAlias
Added coalesce check for collection objects in the Provider object
Updated mock test object for command Get-AzPolicyAlias accordingly (Fixed #16370)

* Update ChangeLog.md

Co-authored-by: Vincent Dai <vidai@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported good first issue Issues suited for folks who want to help for the first time. Policy Azure Resource Policy question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
3 participants