Azure / Azure/azure-powershell
Set-AzApplicationGatewayWebApplicationFirewallConfiguration PowerShell command not working as documented
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description
I'm building Az Application Gateway WAF's via Powershell and I'm attempting to save the configuration with **Set-AzApplicationGatewayWebApplicationFirewallConfiguration**, but the **-RuleSetVersion** parameter won't set to a value other than 3.0 and **-DisabledRuleGroups** won't properly set New-AzApplicationGatewayFirewallDisabledRuleGroupConfig objects on the gateway. These parameters seem to work ok via **New-AzApplicationGatewayWebApplicationFirewallConfiguration**, but I want to apply to an existing application gateway.
### Issue script & Debug output
```PowerShell
Too much sensitive info.
```
### Environment data
```PowerShell
> $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
> Get-Module Az*
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.7.5 Az.Accounts {Add-AzEnvironment, Clear-AzContext, Clear-AzDefault, Connect-AzAccount...}
Script 4.16.0 Az.Network {Add-AzApplicationGatewayAuthenticationCertificate, Add-AzApplicationGatewayBackendAddressPool, Add-AzApplicationGatewayBackendHttpSetting, Add-AzApplicationGatewayCustomError...}
```
### Error output
```PowerShell
> Resolve-AzError
DEBUG: 11:06:54 AM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 11:06:54 AM - using account id 'xxx'...
WARNING: Upcoming breaking changes in the cmdlet 'Resolve-AzError' :
The `Resolve-Error` alias will be removed in a future release. Please change any scripts that use this alias to use
`Resolve-AzError` instead.
Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
HistoryId: 2
Message : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more
information.
StackTrace : at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Microsoft.PowerShell.Commands.AddTypeCommand.LoadAssemblyFromPathOrName(List`1 generatedTypes)
at Microsoft.PowerShell.Commands.AddTypeCommand.EndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
Exception : System.Reflection.ReflectionTypeLoadException
InvocationInfo : {Add-Type}
Line : Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null
Position : char:21
+ ... Add-Type -Path $_.FullName -ErrorAction Ignore | Out-N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 2
The Azure PowerShell team is listening, please let us know how we are doing: https://aka.ms/azpssurvey?Q_CHL=ERROR.
DEBUG: AzureQoSEvent: Module: Az.Accounts:2.7.5; CommandName: Resolve-AzError; PSVersion: 5.1.19041.1682; IsSuccess:
True; Duration: 00:00:00.0459511
DEBUG: Finish sending metric.
DEBUG: 11:06:54 AM - ResolveError end processing.
```
Contributor guide
Assessment
This issue has not been assessed yet.