New-AzMySqlFirewallRule
Creates a new firewall rule or updates an existing firewall rule.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
New-AzMySqlFirewallRule
-ResourceGroupName <String>
-ServerName <String>
-EndIPAddress <String>
-StartIPAddress <String>
[-Name <String>]
[-SubscriptionId <String>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-Confirm]
[-WhatIf]
[<CommonParameters>]
New-AzMySqlFirewallRule
-ResourceGroupName <String>
-ServerName <String>
-AllowAll
[-Name <String>]
[-SubscriptionId <String>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-Confirm]
[-WhatIf]
[<CommonParameters>]
New-AzMySqlFirewallRule
-ResourceGroupName <String>
-ServerName <String>
-ClientIPAddress <String>
[-Name <String>]
[-SubscriptionId <String>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-Confirm]
[-WhatIf]
[<CommonParameters>]
Description
Creates a new firewall rule or updates an existing firewall rule.
Examples
Example 1: Create a new MySql server Firewall Rule
PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -EndIPAddress 0.0.0.1 -StartIPAddress 0.0.0.0
Name StartIPAddress EndIPAddress
---- -------------- ------------
rule 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.
PS C:\> New-AzMySqlFirewallRule -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
PS C:\> New-AzMySqlFirewallRule -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
Present to allow all range IPs, from 0.0.0.0 to 255.255.255.255.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Run the command as a job
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Client specified single IP of the server firewall rule. Must be IPv4 format.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | PSObject |
| Aliases: | AzureRMContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The end IP address of the server firewall rule. Must be IPv4 format.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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 |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Run the command asynchronously
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the resource group. The name is case insensitive.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the server.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The start IP address of the server firewall rule. Must be IPv4 format.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The ID of the target subscription.
| Type: | String |
| Position: | Named |
| Default value: | (Get-AzContext).Subscription.Id |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Outputs
Notes
ALIASES