Skip to content

Get-AzFirewallPolicy does not work without parameters #27437

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

Open
matsest opened this issue Mar 25, 2025 · 3 comments
Open

Get-AzFirewallPolicy does not work without parameters #27437

matsest opened this issue Mar 25, 2025 · 3 comments
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Network - Firewall Service Attention This issue is responsible by Azure service team.

Comments

@matsest
Copy link
Contributor

matsest commented Mar 25, 2025

Description

When running Get-AzFirewallPolicy I am prompted for name and resource group. Seems like this is an issue with the parameter sets for the functions.

The expected behavior when running this without any parameters is that it will list by either subscription (with no params given) or by resource group (if only resourcegroup is given).

Relevant file: https://github.com/Azure/azure-powershell/blob/main/src/Network/Network/AzureFirewallPolicy/GetAzureFirewallPolicyCommand.cs

This section of the cmdlet seems to never be evaluated due to the parameter set:

else
{
IPage<FirewallPolicy> azureFirewallPage = ShouldListBySubscription(ResourceGroupName, Name)
? this.AzureFirewallPolicyClient.ListAll()
: this.AzureFirewallPolicyClient.List(this.ResourceGroupName);
// Get all resources by polling on next page link
var azureFirewallResponseLIst = ListNextLink<FirewallPolicy>.GetAllResourcesByPollingNextLink(azureFirewallPage, this.AzureFirewallPolicyClient.ListNext);
var psAzureFirewallPolicies = azureFirewallResponseLIst.Select(firewall =>
{
var psAzureFirewallPolicy = this.ToPsAzureFirewallPolicy(firewall);
psAzureFirewallPolicy.ResourceGroupName = NetworkBaseCmdlet.GetResourceGroup(firewall.Id);
return psAzureFirewallPolicy;
}).ToList();
WriteObject(TopLevelWildcardFilter(ResourceGroupName, Name, psAzureFirewallPolicies), true);

Issue script & Debug output

get-azfirewallpolicy

cmdlet Get-AzFirewallPolicy at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Name:

get-azfirewallpolicy -ResourceGroupName <name>

cmdlet Get-AzFirewallPolicy at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Name:

Environment data

$psversionTable

Name                           Value
----                           -----
PSVersion                      7.5.0
PSEdition                      Core
GitCommitId                    7.5.0
OS                             Microsoft Windows 10.0.26120
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                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     4.0.0                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     7.11.0                Az.Network                          {Add-AzApplicationGatewayAuthenticationCertificate, Add-AzApplicationGatewayBackendAddressPool, Add-AzApplicationGateway…
Script     1.1.3                 Az.Tools.Predictor                  {Disable-AzPredictor, Enable-AzPredictor, Open-AzPredictorSurvey, Send-AzPredictorRating}

Error output

N/A
@matsest matsest 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 Mar 25, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported needs-triage This is a new issue that needs to be triaged to the appropriate team. and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Mar 25, 2025
@isra-fel
Copy link
Member

Since the SDK has the capability to list all, might as well expose it as a parameter set.

@isra-fel isra-fel added Service Attention This issue is responsible by Azure service team. Network - Firewall and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Mar 27, 2025
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @gopimsft, @gimotwanMSFT, @avripintoms.

1 similar comment
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @gopimsft, @gimotwanMSFT, @avripintoms.

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 Network - Firewall Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

2 participants