Skip to content

Set-AzFirewallPolicy fails on child policies #27436

Open
@matsest

Description

@matsest

Description

I was encouraged through a support ticket to do a Get/Set-update on our firewall policies in Azure.

There was no issues with the base firewall policy, but when running the get/set on firewall policies that has a base policy it fails.

Seems to be an error with the type referenced here in the cmdlet:

BasePolicy = this.BasePolicy != null ? new Microsoft.Azure.Management.Network.Models.SubResource(this.BasePolicy) : null,

Issue script & Debug output

$fwp = get-azfirewallpolicy -Name <ame> -ResourceGroupName <rg name>
$fwp | Set-AzFirewallPolicy
Set-AzFirewallPolicy: Invalid URI. The requested URI Microsoft.Azure.Management.Network.Models.SubResource is not a valid path.
StatusCode: 400
ReasonPhrase: Bad Request
Status: Failed
ErrorCode: InvalidUri
ErrorMessage: Invalid URI. The requested URI Microsoft.Azure.Management.Network.Models.SubResource is not a valid path.
OperationID : <redacted>

Environment data

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

RequestId      :
Message        : Invalid URI. The requested URI Microsoft.Azure.Management.Network.Models.SubResource is not a valid path.
                 StatusCode: 400
                 ReasonPhrase: Bad Request
                 Status: Failed
                 ErrorCode: InvalidUri
                 ErrorMessage: Invalid URI. The requested URI Microsoft.Azure.Management.Network.Models.SubResource is not a valid path.
                 OperationID : <redacted>
ServerMessage  :
ServerResponse :
RequestMessage :
InvocationInfo : {Set-AzFirewallPolicy}
Line           : $fwp | set-azfirewallpolicy
Position       : At line:1 char:8
                 + $fwp | set-azfirewallpolicy
                 +        ~~~~~~~~~~~~~~~~~~~~
StackTrace     :    at Microsoft.Azure.Commands.Network.NetworkBaseCmdlet.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
HistoryId      : 72

Metadata

Metadata

Assignees

No one assigned

    Labels

    Network - FirewallService AttentionThis issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reported

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions