Skip to content

{AzureFrontDoor} fixes Azure/azure-powershell#20870 Adding Tag parameter to New-AzFrontDoorWafPolicy #20908

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

Merged
merged 6 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/FrontDoor/FrontDoor/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Fixed New-AzFrontDoorWafPolicy cmdlet to support adding Tags for the Azure Frontdoor waf policy

## Version 1.9.0
* Allowed rule engine action creation without RouteConfigurationOverride for `New-AzFrontDoorRulesEngineActionObject`.
Expand Down
10 changes: 9 additions & 1 deletion src/FrontDoor/FrontDoor/Cmdlets/NewFrontDoorWafPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.Linq;
using System.Management.Automation;
using System.Text;
using System.Collections;

namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
{
Expand Down Expand Up @@ -90,7 +91,13 @@ public class NewFrontDoorWafPolicy : AzureFrontDoorCmdletBase
/// </summary>
[Parameter(Mandatory = false, HelpMessage = "Custom Response Body")]
public string CustomBlockResponseBody { get; set; }


/// <summary>
/// The tags to associate with the Front Door Waf Policy.
/// </summary>
[Parameter(Mandatory = false, HelpMessage = "The tags associate with the Front Door Waf Policy.")]
public Hashtable Tag { get; set; }

/// <summary>
/// Defines if the body should be inspected by managed rules. Possible values include: 'Enabled', 'Disabled'
/// </summary>
Expand Down Expand Up @@ -118,6 +125,7 @@ public override void ExecuteCmdlet()
}
var updateParameters = new Management.FrontDoor.Models.WebApplicationFirewallPolicy
{
Tags = Tag?.ToDictionaryTags(),
Location = "global",
CustomRules = new Management.FrontDoor.Models.CustomRuleList()
{
Expand Down
17 changes: 16 additions & 1 deletion src/FrontDoor/FrontDoor/help/New-AzFrontDoorWafPolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Create WAF policy
New-AzFrontDoorWafPolicy -ResourceGroupName <String> -Name <String> [-EnabledState <PSEnabledState>]
[-Mode <String>] [-Customrule <PSCustomRule[]>] [-ManagedRule <PSManagedRule[]>] [-RedirectUrl <String>]
[-CustomBlockResponseStatusCode <Int32>] [-CustomBlockResponseBody <String>] [-RequestBodyCheck <String>]
[-Sku <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-Tag <Hashtable>] [-Sku <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -192,6 +192,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Tag
The tags associate with the FrontDoor WAF Policy.

```yaml
Type: System.Collections.Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ResourceGroupName
The resource group name

Expand Down