New-AzMySqlFlexibleServerFirewallRule

Creates a new firewall rule for MySQL flexible server

Syntax

New-AzMySqlFlexibleServerFirewallRule
   -ResourceGroupName <String>
   -ServerName <String>
   [-Name <String>]
   [-SubscriptionId <String>]
   -EndIPAddress <String>
   -StartIPAddress <String>
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzMySqlFlexibleServerFirewallRule
   -ResourceGroupName <String>
   -ServerName <String>
   [-Name <String>]
   [-SubscriptionId <String>]
   -ClientIPAddress <String>
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzMySqlFlexibleServerFirewallRule
   -ResourceGroupName <String>
   -ServerName <String>
   [-Name <String>]
   [-SubscriptionId <String>]
   [-AllowAll]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Creates a new firewall rule for MySQL flexible server

Examples

Example 1: Create a new MySql server Firewall Rule

New-AzMySqlFlexibleServerFirewallRule -Name firewallrule-test -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -EndIPAddress 0.0.0.1 -StartIPAddress 0.0.0.0

Name              StartIPAddress EndIPAddress
----------------- -------------- ------------
firewallrule-test 0.0.0.0        0.0.0.1

This cmdlets create a MySql server Firewall Rule.

Example 2: Create a new MySql Firewall Rule using -ClientIPAddress.

New-AzMySqlFlexibleServerFirewallRule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -ClientIPAddress 0.0.0.1

Name                                StartIPAddress EndIPAddress
----                                -------------- ------------
ClientIPAddress_2020-08-11_18-19-27 0.0.0.1        0.0.0.1

This cmdlets create a MySql Firewall Rule using -ClientIPAddress.

Example 3: Create a new MySql Firewall Rule to allow all IPs

New-AzMySqlFlexibleServerFirewallRule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -AllowAll

Name                         StartIPAddress EndIPAddress
----                         -------------- ------------
AllowAll_2020-08-11_18-19-27 0.0.0.0        255.255.255.255

This cmdlets create a new MySql Firewall Rule to allow all IPs.

Parameters

-AllowAll

Present to allow all range IPs, from 0.0.0.0 to 255.255.255.255.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-AsJob

Run the command as a job

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

-ClientIPAddress

Client specified single IP of the server firewall rule. Must be IPv4 format.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EndIPAddress

The end IP address of the server firewall rule. Must be IPv4 format.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the server firewall rule. If not specified, the default is undefined. If AllowAll is present, the default name is AllowAll_yyyy-MM-dd_HH-mm-ss.

Type:String
Aliases:FirewallRuleName
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NoWait

Run the command asynchronously

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

-ResourceGroupName

The name of the resource group. The name is case insensitive.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ServerName

The name of the server.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StartIPAddress

The start IP address of the server firewall rule. Must be IPv4 format.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

IFirewallRule