diff --git a/src/MySql/Az.MySql.psd1 b/src/MySql/Az.MySql.psd1 index cc8e037baae0..31f38df6ea0d 100644 --- a/src/MySql/Az.MySql.psd1 +++ b/src/MySql/Az.MySql.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 8/12/2020 +# Generated on: 8/18/2020 # @{ @@ -45,7 +45,7 @@ PowerShellVersion = '5.1' DotNetFrameworkVersion = '4.7.2' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -# CLRVersion = '' +# ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' diff --git a/src/MySql/ChangeLog.md b/src/MySql/ChangeLog.md index 02cad124d94c..c303401e7ebd 100644 --- a/src/MySql/ChangeLog.md +++ b/src/MySql/ChangeLog.md @@ -18,14 +18,14 @@ - Additional information about change #1 --> ## Upcoming Release -* Remove legacy SkuSize from input and output (#11725) -* Specify a default name when create MySql firewall rule without name and add AllowAll mode (#11932) -* Enable EndIpAddress to be absent if only one IP to be authorized in firewall rule (#11933) -* Add validateset for parameter StorageAutogrow (#11936) -* Rename New-AzMySqlServerReplica to New-AzMySqlReplica (#11938) -* Use 'master' and 'replica' to avoid confusion when create mysql replica server (#11939) -* Provide hint in doc to use Update-AzMySqlServer & Update-AzMySqlServerConfiguration as a candidate for each other (#11954) +* Removed legacy SkuSize from input and output (#11725) +* Added AllowAll & ClientIpAddress Modes to firewall rule cmdlets (#11932) +* specified a default name when created MySql firewall rule without a name (#11932) +* Added validateset for parameter StorageAutogrow (#11936) +* Renamed New-AzMySqlServerReplica to New-AzMySqlReplica (#11938) +* Used 'master' and 'replica' to avoid confusion when created mysql replica server (#11939) +* Provided hint in doc to use Update-AzMySqlServer & Update-AzMySqlServerConfiguration as a candidate for each other (#11954) ## Version 0.1.0 -* the first preview release +* The first preview release diff --git a/src/MySql/custom/New-AzMySqlFirewallRule.ps1 b/src/MySql/custom/New-AzMySqlFirewallRule.ps1 index c38f39cb2a4a..2cf05c6706f7 100644 --- a/src/MySql/custom/New-AzMySqlFirewallRule.ps1 +++ b/src/MySql/custom/New-AzMySqlFirewallRule.ps1 @@ -52,7 +52,7 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] [System.String] # The end IP address of the server firewall rule. @@ -64,9 +64,15 @@ param( [System.String] # The start IP address of the server firewall rule. # Must be IPv4 format. - # If range contains one IP, use StartIPAddress only. ${StartIPAddress}, + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] + [System.String] + # Client specified single IP of the server firewall rule. + # Must be IPv4 format. + ${ClientIPAddress}, + [Parameter(ParameterSetName='AllowAll', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] [System.Management.Automation.SwitchParameter] @@ -146,15 +152,23 @@ process { $null = $PSBoundParameters.Remove('AllowAll') } - else + elseif($PSBoundParameters.ContainsKey('ClientIPAddress')) { + $PSBoundParameters['StartIPAddress'] = $PSBoundParameters['ClientIPAddress'] + $PSBoundParameters['EndIPAddress'] = $PSBoundParameters['ClientIPAddress'] + if(!$PSBoundParameters.ContainsKey('Name')) { - $PSBoundParameters['Name'] = "undefined" + $PSBoundParameters['Name'] = "ClientIPAddress_" + (Get-Date -Format "yyyy-MM-dd_HH-mm-ss") } - if(!$PSBoundParameters.ContainsKey('EndIPAddress')) + + $null = $PSBoundParameters.Remove('ClientIPAddress') + } + else + { + if(!$PSBoundParameters.ContainsKey('Name')) { - $PSBoundParameters['EndIPAddress'] = $PSBoundParameters['StartIPAddress'] + $PSBoundParameters['Name'] = "undefined" } } diff --git a/src/MySql/custom/Update-AzMySqlFirewallRule.ps1 b/src/MySql/custom/Update-AzMySqlFirewallRule.ps1 index 69faa7c9c4fb..367eadaabbcd 100644 --- a/src/MySql/custom/Update-AzMySqlFirewallRule.ps1 +++ b/src/MySql/custom/Update-AzMySqlFirewallRule.ps1 @@ -24,6 +24,7 @@ function Update-AzMySqlFirewallRule { [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] [Alias('FirewallRuleName')] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [System.String] @@ -31,6 +32,7 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [System.String] # The name of the resource group. @@ -38,12 +40,14 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [System.String] # The name of the server. ${ServerName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='ClientIPAddress')] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -51,27 +55,37 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ClientIPAddressViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] [System.String] # The end IP address of the server firewall rule. # Must be IPv4 format. ${EndIPAddress}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] [System.String] # The start IP address of the server firewall rule. # Must be IPv4 format. - # If range contains one IP, use StartIPAddress only. ${StartIPAddress}, + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] + [Parameter(ParameterSetName='ClientIPAddressViaIdentity', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] + [System.String] + # Client specified single IP of the server firewall rule. + # Must be IPv4 format. + ${ClientIPAddress}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -134,9 +148,11 @@ param( process { try { - if(!$PSBoundParameters.ContainsKey('EndIPAddress')) + if($PSBoundParameters.ContainsKey('ClientIPAddress')) { - $PSBoundParameters['EndIPAddress'] = $PSBoundParameters['StartIPAddress'] + $PSBoundParameters['StartIPAddress'] = $PSBoundParameters['ClientIPAddress'] + $PSBoundParameters['EndIPAddress'] = $PSBoundParameters['ClientIPAddress'] + $null = $PSBoundParameters.Remove('ClientIPAddress') } Az.MySql.internal\Update-AzMySqlFirewallRule @PSBoundParameters } catch { diff --git a/src/MySql/examples/New-AzMySqlFirewallRule.md b/src/MySql/examples/New-AzMySqlFirewallRule.md index d6602ff94f3b..3a87d6a001ce 100644 --- a/src/MySql/examples/New-AzMySqlFirewallRule.md +++ b/src/MySql/examples/New-AzMySqlFirewallRule.md @@ -9,16 +9,16 @@ 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 use only one parameter StartIPAddress when only one IP needs to be authorized +### Example 2: Create a new MySql Firewall Rule using -ClientIPAddress. ```powershell -PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -StartIPAddress 0.0.0.1 +PS C:\> New-AzMySqlFirewallRule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -ClientIPAddress 0.0.0.1 -Name StartIPAddress EndIPAddress ----- -------------- ------------ -rule 0.0.0.1 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 use only one parameter StartIPAddress when only one IP needs to be authorized. +This cmdlets create a MySql Firewall Rule using -ClientIPAddress. ### Example 3: Create a new MySql Firewall Rule to allow all IPs ```powershell diff --git a/src/MySql/examples/Update-AzMySqlFirewallRule.md b/src/MySql/examples/Update-AzMySqlFirewallRule.md index e5f7a398c09b..04e665d895bc 100644 --- a/src/MySql/examples/Update-AzMySqlFirewallRule.md +++ b/src/MySql/examples/Update-AzMySqlFirewallRule.md @@ -21,14 +21,14 @@ rule 0.0.0.2 0.0.0.3 These cmdlets update MySql Firewall Rule by identity. -### Example 3: Update MySql Firewall Rule use only one parameter StartIPAddress when only one IP needs to be authorized +### Example 3: Update MySql Firewall Rule by -ClientIPAddress. ```powershell PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/firewallRules/rule" -PS C:\> Update-AzMySqlFirewallRule -InputObject $ID -StartIPAddress 0.0.0.2 +PS C:\> Update-AzMySqlFirewallRule -InputObject $ID --ClientIPAddress 0.0.0.2 Name StartIPAddress EndIPAddress ---- -------------- ------------ -rule 0.0.0.2 0.0.0.3 +rule 0.0.0.2 0.0.0.2 ``` -These cmdlets update MySql Firewall Rule use only one parameter StartIPAddress when only one IP needs to be authorized. \ No newline at end of file +These cmdlets update MySql Firewall Rule by -ClientIPAddress. \ No newline at end of file diff --git a/src/MySql/exports/New-AzMySqlFirewallRule.ps1 b/src/MySql/exports/New-AzMySqlFirewallRule.ps1 index efa3d67fa041..401c8cede7b9 100644 --- a/src/MySql/exports/New-AzMySqlFirewallRule.ps1 +++ b/src/MySql/exports/New-AzMySqlFirewallRule.ps1 @@ -25,11 +25,11 @@ Name StartIPAddress EndIPAddress ---- -------------- ------------ rule 0.0.0.0 0.0.0.1 .Example -PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -StartIPAddress 0.0.0.1 +PS C:\> New-AzMySqlFirewallRule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -ClientIPAddress 0.0.0.1 -Name StartIPAddress EndIPAddress ----- -------------- ------------ -rule 0.0.0.1 0.0.0.1 +Name StartIPAddress EndIPAddress +---- -------------- ------------ +ClientIPAddress_2020-08-11_18-19-27 0.0.0.1 0.0.0.1 .Example PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -AllowAll @@ -75,20 +75,26 @@ param( # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] + [System.String] + # The end IP address of the server firewall rule. + # Must be IPv4 format. + ${EndIPAddress}, + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] [System.String] # The start IP address of the server firewall rule. # Must be IPv4 format. - # If range contains one IP, use StartIPAddress only. ${StartIPAddress}, - [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] [System.String] - # The end IP address of the server firewall rule. + # Client specified single IP of the server firewall rule. # Must be IPv4 format. - ${EndIPAddress}, + ${ClientIPAddress}, [Parameter(ParameterSetName='AllowAll', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] @@ -165,9 +171,10 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ CreateExpanded = 'Az.MySql.custom\New-AzMySqlFirewallRule'; + ClientIPAddress = 'Az.MySql.custom\New-AzMySqlFirewallRule'; AllowAll = 'Az.MySql.custom\New-AzMySqlFirewallRule'; } - if (('CreateExpanded', 'AllowAll') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded', 'ClientIPAddress', 'AllowAll') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/src/MySql/exports/ProxyCmdletDefinitions.ps1 b/src/MySql/exports/ProxyCmdletDefinitions.ps1 index e93685f48073..9ed23fc974f7 100644 --- a/src/MySql/exports/ProxyCmdletDefinitions.ps1 +++ b/src/MySql/exports/ProxyCmdletDefinitions.ps1 @@ -2287,11 +2287,11 @@ Name StartIPAddress EndIPAddress ---- -------------- ------------ rule 0.0.0.0 0.0.0.1 .Example -PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -StartIPAddress 0.0.0.1 +PS C:\> New-AzMySqlFirewallRule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -ClientIPAddress 0.0.0.1 -Name StartIPAddress EndIPAddress ----- -------------- ------------ -rule 0.0.0.1 0.0.0.1 +Name StartIPAddress EndIPAddress +---- -------------- ------------ +ClientIPAddress_2020-08-11_18-19-27 0.0.0.1 0.0.0.1 .Example PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -AllowAll @@ -2337,20 +2337,26 @@ param( # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] + [System.String] + # The end IP address of the server firewall rule. + # Must be IPv4 format. + ${EndIPAddress}, + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] [System.String] # The start IP address of the server firewall rule. # Must be IPv4 format. - # If range contains one IP, use StartIPAddress only. ${StartIPAddress}, - [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] [System.String] - # The end IP address of the server firewall rule. + # Client specified single IP of the server firewall rule. # Must be IPv4 format. - ${EndIPAddress}, + ${ClientIPAddress}, [Parameter(ParameterSetName='AllowAll', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] @@ -2427,9 +2433,10 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ CreateExpanded = 'Az.MySql.custom\New-AzMySqlFirewallRule'; + ClientIPAddress = 'Az.MySql.custom\New-AzMySqlFirewallRule'; AllowAll = 'Az.MySql.custom\New-AzMySqlFirewallRule'; } - if (('CreateExpanded', 'AllowAll') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded', 'ClientIPAddress', 'AllowAll') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -3361,11 +3368,11 @@ Name StartIPAddress EndIPAddress rule 0.0.0.2 0.0.0.3 .Example PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/firewallRules/rule" -PS C:\> Update-AzMySqlFirewallRule -InputObject $ID -StartIPAddress 0.0.0.2 +PS C:\> Update-AzMySqlFirewallRule -InputObject $ID --ClientIPAddress 0.0.0.2 Name StartIPAddress EndIPAddress ---- -------------- ------------ -rule 0.0.0.2 0.0.0.3 +rule 0.0.0.2 0.0.0.2 .Inputs Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity @@ -3395,6 +3402,7 @@ function Update-AzMySqlFirewallRule { [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] [Alias('FirewallRuleName')] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [System.String] @@ -3402,6 +3410,7 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [System.String] # The name of the resource group. @@ -3409,18 +3418,21 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [System.String] # The name of the server. ${ServerName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='ClientIPAddress')] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='ClientIPAddressViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity] @@ -3428,20 +3440,29 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] + [System.String] + # The end IP address of the server firewall rule. + # Must be IPv4 format. + ${EndIPAddress}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] [System.String] # The start IP address of the server firewall rule. # Must be IPv4 format. - # If range contains one IP, use StartIPAddress only. ${StartIPAddress}, - [Parameter()] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] + [Parameter(ParameterSetName='ClientIPAddressViaIdentity', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] [System.String] - # The end IP address of the server firewall rule. + # Client specified single IP of the server firewall rule. # Must be IPv4 format. - ${EndIPAddress}, + ${ClientIPAddress}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -3512,9 +3533,11 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ UpdateExpanded = 'Az.MySql.custom\Update-AzMySqlFirewallRule'; + ClientIPAddress = 'Az.MySql.custom\Update-AzMySqlFirewallRule'; + ClientIPAddressViaIdentity = 'Az.MySql.custom\Update-AzMySqlFirewallRule'; UpdateViaIdentityExpanded = 'Az.MySql.custom\Update-AzMySqlFirewallRule'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded', 'ClientIPAddress') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/src/MySql/exports/Update-AzMySqlFirewallRule.ps1 b/src/MySql/exports/Update-AzMySqlFirewallRule.ps1 index 66cba41f02be..c8d79e4fef0f 100644 --- a/src/MySql/exports/Update-AzMySqlFirewallRule.ps1 +++ b/src/MySql/exports/Update-AzMySqlFirewallRule.ps1 @@ -33,11 +33,11 @@ Name StartIPAddress EndIPAddress rule 0.0.0.2 0.0.0.3 .Example PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/firewallRules/rule" -PS C:\> Update-AzMySqlFirewallRule -InputObject $ID -StartIPAddress 0.0.0.2 +PS C:\> Update-AzMySqlFirewallRule -InputObject $ID --ClientIPAddress 0.0.0.2 Name StartIPAddress EndIPAddress ---- -------------- ------------ -rule 0.0.0.2 0.0.0.3 +rule 0.0.0.2 0.0.0.2 .Inputs Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity @@ -67,6 +67,7 @@ function Update-AzMySqlFirewallRule { [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] [Alias('FirewallRuleName')] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [System.String] @@ -74,6 +75,7 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [System.String] # The name of the resource group. @@ -81,18 +83,21 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [System.String] # The name of the server. ${ServerName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='ClientIPAddress')] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='ClientIPAddressViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity] @@ -100,20 +105,29 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] + [System.String] + # The end IP address of the server firewall rule. + # Must be IPv4 format. + ${EndIPAddress}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] [System.String] # The start IP address of the server firewall rule. # Must be IPv4 format. - # If range contains one IP, use StartIPAddress only. ${StartIPAddress}, - [Parameter()] + [Parameter(ParameterSetName='ClientIPAddress', Mandatory)] + [Parameter(ParameterSetName='ClientIPAddressViaIdentity', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MySql.Category('Body')] [System.String] - # The end IP address of the server firewall rule. + # Client specified single IP of the server firewall rule. # Must be IPv4 format. - ${EndIPAddress}, + ${ClientIPAddress}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -184,9 +198,11 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ UpdateExpanded = 'Az.MySql.custom\Update-AzMySqlFirewallRule'; + ClientIPAddress = 'Az.MySql.custom\Update-AzMySqlFirewallRule'; + ClientIPAddressViaIdentity = 'Az.MySql.custom\Update-AzMySqlFirewallRule'; UpdateViaIdentityExpanded = 'Az.MySql.custom\Update-AzMySqlFirewallRule'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded', 'ClientIPAddress') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/src/MySql/help/New-AzMySqlFirewallRule.md b/src/MySql/help/New-AzMySqlFirewallRule.md index 4c9205e54af4..731c8476850f 100644 --- a/src/MySql/help/New-AzMySqlFirewallRule.md +++ b/src/MySql/help/New-AzMySqlFirewallRule.md @@ -14,8 +14,8 @@ Creates a new firewall rule or updates an existing firewall rule. ### CreateExpanded (Default) ``` -New-AzMySqlFirewallRule -ResourceGroupName -ServerName -StartIPAddress - [-Name ] [-SubscriptionId ] [-EndIPAddress ] [-DefaultProfile ] [-AsJob] +New-AzMySqlFirewallRule -ResourceGroupName -ServerName -EndIPAddress + -StartIPAddress [-Name ] [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] ``` @@ -26,6 +26,13 @@ New-AzMySqlFirewallRule -ResourceGroupName -ServerName -AllowA [] ``` +### ClientIPAddress +``` +New-AzMySqlFirewallRule -ResourceGroupName -ServerName -ClientIPAddress + [-Name ] [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + ## DESCRIPTION Creates a new firewall rule or updates an existing firewall rule. @@ -42,16 +49,16 @@ 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 use only one parameter StartIPAddress when only one IP needs to be authorized +### Example 2: Create a new MySql Firewall Rule using -ClientIPAddress. ```powershell -PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -StartIPAddress 0.0.0.1 +PS C:\> New-AzMySqlFirewallRule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -ClientIPAddress 0.0.0.1 -Name StartIPAddress EndIPAddress ----- -------------- ------------ -rule 0.0.0.1 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 use only one parameter StartIPAddress when only one IP needs to be authorized. +This cmdlets create a MySql Firewall Rule using -ClientIPAddress. ### Example 3: Create a new MySql Firewall Rule to allow all IPs ```powershell @@ -96,6 +103,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ClientIPAddress +Client specified single IP of the server firewall rule. +Must be IPv4 format. + +```yaml +Type: System.String +Parameter Sets: ClientIPAddress +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. @@ -120,7 +143,7 @@ Type: System.String Parameter Sets: CreateExpanded Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False @@ -193,7 +216,6 @@ Accept wildcard characters: False ### -StartIPAddress The start IP address of the server firewall rule. Must be IPv4 format. -If range contains one IP, use StartIPAddress only. ```yaml Type: System.String diff --git a/src/MySql/help/Update-AzMySqlFirewallRule.md b/src/MySql/help/Update-AzMySqlFirewallRule.md index 07b8971e92de..2e3b54ae6b30 100644 --- a/src/MySql/help/Update-AzMySqlFirewallRule.md +++ b/src/MySql/help/Update-AzMySqlFirewallRule.md @@ -15,13 +15,26 @@ Creates a new firewall rule or updates an existing firewall rule. ### UpdateExpanded (Default) ``` Update-AzMySqlFirewallRule -Name -ResourceGroupName -ServerName - -StartIPAddress [-SubscriptionId ] [-EndIPAddress ] [-DefaultProfile ] + -EndIPAddress -StartIPAddress [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] ``` +### ClientIPAddress +``` +Update-AzMySqlFirewallRule -Name -ResourceGroupName -ServerName + -ClientIPAddress [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-Confirm] [-WhatIf] [] +``` + +### ClientIPAddressViaIdentity +``` +Update-AzMySqlFirewallRule -InputObject -ClientIPAddress + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + ### UpdateViaIdentityExpanded ``` -Update-AzMySqlFirewallRule -InputObject -StartIPAddress [-EndIPAddress ] +Update-AzMySqlFirewallRule -InputObject -EndIPAddress -StartIPAddress [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] ``` @@ -53,17 +66,17 @@ rule 0.0.0.2 0.0.0.3 These cmdlets update MySql Firewall Rule by identity. -### Example 3: Update MySql Firewall Rule use only one parameter StartIPAddress when only one IP needs to be authorized +### Example 3: Update MySql Firewall Rule by -ClientIPAddress. ```powershell PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/firewallRules/rule" -PS C:\> Update-AzMySqlFirewallRule -InputObject $ID -StartIPAddress 0.0.0.2 +PS C:\> Update-AzMySqlFirewallRule -InputObject $ID --ClientIPAddress 0.0.0.2 Name StartIPAddress EndIPAddress ---- -------------- ------------ -rule 0.0.0.2 0.0.0.3 +rule 0.0.0.2 0.0.0.2 ``` -These cmdlets update MySql Firewall Rule use only one parameter StartIPAddress when only one IP needs to be authorized. +These cmdlets update MySql Firewall Rule by -ClientIPAddress. ## PARAMETERS @@ -82,6 +95,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ClientIPAddress +Client specified single IP of the server firewall rule. +Must be IPv4 format. + +```yaml +Type: System.String +Parameter Sets: ClientIPAddress, ClientIPAddressViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. @@ -103,10 +132,10 @@ Must be IPv4 format. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False @@ -119,7 +148,7 @@ To construct, see NOTES section for INPUTOBJECT properties and create a hash tab ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.IMySqlIdentity -Parameter Sets: UpdateViaIdentityExpanded +Parameter Sets: ClientIPAddressViaIdentity, UpdateViaIdentityExpanded Aliases: Required: True @@ -134,7 +163,7 @@ The name of the server firewall rule. ```yaml Type: System.String -Parameter Sets: UpdateExpanded +Parameter Sets: ClientIPAddress, UpdateExpanded Aliases: FirewallRuleName Required: True @@ -165,7 +194,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: UpdateExpanded +Parameter Sets: ClientIPAddress, UpdateExpanded Aliases: Required: True @@ -180,7 +209,7 @@ The name of the server. ```yaml Type: System.String -Parameter Sets: UpdateExpanded +Parameter Sets: ClientIPAddress, UpdateExpanded Aliases: Required: True @@ -193,11 +222,10 @@ Accept wildcard characters: False ### -StartIPAddress The start IP address of the server firewall rule. Must be IPv4 format. -If range contains one IP, use StartIPAddress only. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded Aliases: Required: True @@ -212,7 +240,7 @@ The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: UpdateExpanded +Parameter Sets: ClientIPAddress, UpdateExpanded Aliases: Required: False diff --git a/src/MySql/internal/New-AzMySqlFirewallRule.ps1 b/src/MySql/internal/New-AzMySqlFirewallRule.ps1 index 170a375a8d6f..644f4e427d60 100644 --- a/src/MySql/internal/New-AzMySqlFirewallRule.ps1 +++ b/src/MySql/internal/New-AzMySqlFirewallRule.ps1 @@ -25,11 +25,11 @@ Name StartIPAddress EndIPAddress ---- -------------- ------------ rule 0.0.0.0 0.0.0.1 .Example -PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -StartIPAddress 0.0.0.1 +PS C:\> New-AzMySqlFirewallRule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -ClientIPAddress 0.0.0.1 -Name StartIPAddress EndIPAddress ----- -------------- ------------ -rule 0.0.0.1 0.0.0.1 +Name StartIPAddress EndIPAddress +---- -------------- ------------ +ClientIPAddress_2020-08-11_18-19-27 0.0.0.1 0.0.0.1 .Example PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -AllowAll diff --git a/src/MySql/internal/ProxyCmdletDefinitions.ps1 b/src/MySql/internal/ProxyCmdletDefinitions.ps1 index 4152d50f296c..bcbe5ed285d5 100644 --- a/src/MySql/internal/ProxyCmdletDefinitions.ps1 +++ b/src/MySql/internal/ProxyCmdletDefinitions.ps1 @@ -1595,11 +1595,11 @@ Name StartIPAddress EndIPAddress ---- -------------- ------------ rule 0.0.0.0 0.0.0.1 .Example -PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -StartIPAddress 0.0.0.1 +PS C:\> New-AzMySqlFirewallRule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -ClientIPAddress 0.0.0.1 -Name StartIPAddress EndIPAddress ----- -------------- ------------ -rule 0.0.0.1 0.0.0.1 +Name StartIPAddress EndIPAddress +---- -------------- ------------ +ClientIPAddress_2020-08-11_18-19-27 0.0.0.1 0.0.0.1 .Example PS C:\> New-AzMySqlFirewallRule -Name rule -ResourceGroupName PowershellMySqlTest -ServerName mysql-test -AllowAll @@ -4146,11 +4146,11 @@ Name StartIPAddress EndIPAddress rule 0.0.0.2 0.0.0.3 .Example PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/firewallRules/rule" -PS C:\> Update-AzMySqlFirewallRule -InputObject $ID -StartIPAddress 0.0.0.2 +PS C:\> Update-AzMySqlFirewallRule -InputObject $ID --ClientIPAddress 0.0.0.2 Name StartIPAddress EndIPAddress ---- -------------- ------------ -rule 0.0.0.2 0.0.0.3 +rule 0.0.0.2 0.0.0.2 .Inputs Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule diff --git a/src/MySql/internal/Update-AzMySqlFirewallRule.ps1 b/src/MySql/internal/Update-AzMySqlFirewallRule.ps1 index 124b1fa05e34..720309f4363c 100644 --- a/src/MySql/internal/Update-AzMySqlFirewallRule.ps1 +++ b/src/MySql/internal/Update-AzMySqlFirewallRule.ps1 @@ -33,11 +33,11 @@ Name StartIPAddress EndIPAddress rule 0.0.0.2 0.0.0.3 .Example PS C:\> $ID = "/subscriptions//resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test/firewallRules/rule" -PS C:\> Update-AzMySqlFirewallRule -InputObject $ID -StartIPAddress 0.0.0.2 +PS C:\> Update-AzMySqlFirewallRule -InputObject $ID --ClientIPAddress 0.0.0.2 Name StartIPAddress EndIPAddress ---- -------------- ------------ -rule 0.0.0.2 0.0.0.3 +rule 0.0.0.2 0.0.0.2 .Inputs Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IFirewallRule diff --git a/src/MySql/test/Az.MySql-TestResults.xml b/src/MySql/test/Az.MySql-TestResults.xml index f3860791547e..5e76d1522486 100644 --- a/src/MySql/test/Az.MySql-TestResults.xml +++ b/src/MySql/test/Az.MySql-TestResults.xml @@ -1,196 +1,197 @@  - - + + - + - + - + - - - + + + - + - + - - + + - + - + - - - + + + - + - + - + - + - + - - - - + + + + - + - + - - - + + + - + - + - - + + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + diff --git a/src/MySql/test/New-AzMySqlFirewallRule.Recording.json b/src/MySql/test/New-AzMySqlFirewallRule.Recording.json index 9cb9d370bfd9..21c62f6a1a74 100644 --- a/src/MySql/test/New-AzMySqlFirewallRule.Recording.json +++ b/src/MySql/test/New-AzMySqlFirewallRule.Recording.json @@ -235,7 +235,7 @@ "Content": null } }, - "New-AzMySqlFirewallRule+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+7": { + "New-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+1": { "Request": { "Method": "PUT", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01", @@ -272,7 +272,7 @@ "Content": "{\"operation\":\"UpsertElasticServerFirewallRules\",\"startTime\":\"2020-08-11T13:27:42.36Z\"}" } }, - "New-AzMySqlFirewallRule+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/7829f89e-24fe-4760-af09-60a52c725ace?api-version=2017-12-01+8": { + "New-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/7829f89e-24fe-4760-af09-60a52c725ace?api-version=2017-12-01+2": { "Request": { "Method": "GET", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/7829f89e-24fe-4760-af09-60a52c725ace?api-version=2017-12-01", @@ -281,7 +281,7 @@ "x-ms-unique-id": [ "100", "101" ], "x-ms-client-request-id": [ "f43706a0-0099-41dd-9c3d-9544c000fc4a", "f43706a0-0099-41dd-9c3d-9544c000fc4a" ], "CommandName": [ "Az.MySql.internal\\New-AzMySqlFirewallRule", "Az.MySql.internal\\New-AzMySqlFirewallRule" ], - "FullCommandName": [ "New-AzMySqlFirewallRule_CreateExpanded", "New-AzMySqlFirewallRule_CreateExpanded" ], + "FullCommandName": [ "New-AzMySqlFirewallRule_ClientIPAddress", "New-AzMySqlFirewallRule_ClientIPAddress" ], "ParameterSetName": [ "__AllParameterSets", "__AllParameterSets" ], "User-Agent": [ "AzurePowershell/Az4.0.0-preview", "AzurePowershell/Az4.0.0-preview" ], "Authorization": [ "[Filtered]" ] @@ -312,7 +312,7 @@ "Content": "{\"name\":\"7829f89e-24fe-4760-af09-60a52c725ace\",\"status\":\"Succeeded\",\"startTime\":\"2020-08-11T13:27:42.36Z\"}" } }, - "New-AzMySqlFirewallRule+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+9": { + "New-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+3": { "Request": { "Method": "GET", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01", @@ -321,7 +321,7 @@ "x-ms-unique-id": [ "100", "101", "102" ], "x-ms-client-request-id": [ "f43706a0-0099-41dd-9c3d-9544c000fc4a", "f43706a0-0099-41dd-9c3d-9544c000fc4a", "f43706a0-0099-41dd-9c3d-9544c000fc4a" ], "CommandName": [ "Az.MySql.internal\\New-AzMySqlFirewallRule", "Az.MySql.internal\\New-AzMySqlFirewallRule", "Az.MySql.internal\\New-AzMySqlFirewallRule" ], - "FullCommandName": [ "New-AzMySqlFirewallRule_CreateExpanded", "New-AzMySqlFirewallRule_CreateExpanded", "New-AzMySqlFirewallRule_CreateExpanded" ], + "FullCommandName": [ "New-AzMySqlFirewallRule_ClientIPAddress", "New-AzMySqlFirewallRule_ClientIPAddress", "New-AzMySqlFirewallRule_ClientIPAddress" ], "ParameterSetName": [ "__AllParameterSets", "__AllParameterSets", "__AllParameterSets" ], "User-Agent": [ "AzurePowershell/Az4.0.0-preview", "AzurePowershell/Az4.0.0-preview", "AzurePowershell/Az4.0.0-preview" ], "Authorization": [ "[Filtered]" ] @@ -351,7 +351,7 @@ "Content": "{\"properties\":{\"startIpAddress\":\"0.0.0.1\",\"endIpAddress\":\"0.0.0.1\"},\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01\",\"name\":\"mysqlrule01\",\"type\":\"Microsoft.DBforMySQL/servers/firewallRules\"}" } }, - "New-AzMySqlFirewallRule+[NoContext]+CreateExpanded+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+10": { + "New-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+4": { "Request": { "Method": "DELETE", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01", @@ -393,7 +393,7 @@ "Content": "{\"operation\":\"DropElasticServerFirewallRule\",\"startTime\":\"2020-08-11T13:28:00.173Z\"}" } }, - "New-AzMySqlFirewallRule+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/0bfce3da-97d8-4215-a951-d983b2ce4fd6?api-version=2017-12-01+11": { + "New-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/0bfce3da-97d8-4215-a951-d983b2ce4fd6?api-version=2017-12-01+5": { "Request": { "Method": "GET", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/0bfce3da-97d8-4215-a951-d983b2ce4fd6?api-version=2017-12-01", @@ -433,7 +433,7 @@ "Content": "{\"name\":\"0bfce3da-97d8-4215-a951-d983b2ce4fd6\",\"status\":\"Succeeded\",\"startTime\":\"2020-08-11T13:28:00.173Z\"}" } }, - "New-AzMySqlFirewallRule+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/operationResults/0bfce3da-97d8-4215-a951-d983b2ce4fd6?api-version=2017-12-01+12": { + "New-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/operationResults/0bfce3da-97d8-4215-a951-d983b2ce4fd6?api-version=2017-12-01+6": { "Request": { "Method": "GET", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/operationResults/0bfce3da-97d8-4215-a951-d983b2ce4fd6?api-version=2017-12-01", @@ -517,7 +517,7 @@ "x-ms-unique-id": [ "106", "107" ], "x-ms-client-request-id": [ "fbc93aef-f54b-4c79-be23-f2d6573dff22", "fbc93aef-f54b-4c79-be23-f2d6573dff22" ], "CommandName": [ "Az.MySql.internal\\New-AzMySqlFirewallRule", "Az.MySql.internal\\New-AzMySqlFirewallRule" ], - "FullCommandName": [ "New-AzMySqlFirewallRule_CreateExpanded", "New-AzMySqlFirewallRule_CreateExpanded" ], + "FullCommandName": [ "New-AzMySqlFirewallRule_AllowAll", "New-AzMySqlFirewallRule_AllowAll" ], "ParameterSetName": [ "__AllParameterSets", "__AllParameterSets" ], "User-Agent": [ "AzurePowershell/Az4.0.0-preview", "AzurePowershell/Az4.0.0-preview" ], "Authorization": [ "[Filtered]" ] @@ -557,7 +557,7 @@ "x-ms-unique-id": [ "106", "107", "108" ], "x-ms-client-request-id": [ "fbc93aef-f54b-4c79-be23-f2d6573dff22", "fbc93aef-f54b-4c79-be23-f2d6573dff22", "fbc93aef-f54b-4c79-be23-f2d6573dff22" ], "CommandName": [ "Az.MySql.internal\\New-AzMySqlFirewallRule", "Az.MySql.internal\\New-AzMySqlFirewallRule", "Az.MySql.internal\\New-AzMySqlFirewallRule" ], - "FullCommandName": [ "New-AzMySqlFirewallRule_CreateExpanded", "New-AzMySqlFirewallRule_CreateExpanded", "New-AzMySqlFirewallRule_CreateExpanded" ], + "FullCommandName": [ "New-AzMySqlFirewallRule_AllowAll", "New-AzMySqlFirewallRule_AllowAll", "New-AzMySqlFirewallRule_AllowAll" ], "ParameterSetName": [ "__AllParameterSets", "__AllParameterSets", "__AllParameterSets" ], "User-Agent": [ "AzurePowershell/Az4.0.0-preview", "AzurePowershell/Az4.0.0-preview", "AzurePowershell/Az4.0.0-preview" ], "Authorization": [ "[Filtered]" ] diff --git a/src/MySql/test/New-AzMySqlFirewallRule.Tests.ps1 b/src/MySql/test/New-AzMySqlFirewallRule.Tests.ps1 index 18dc2d481189..03341302b61d 100644 --- a/src/MySql/test/New-AzMySqlFirewallRule.Tests.ps1 +++ b/src/MySql/test/New-AzMySqlFirewallRule.Tests.ps1 @@ -18,9 +18,11 @@ Describe 'New-AzMySqlFirewallRule' { $rule.StartIPAddress | Should -Be 0.0.0.0 $rule.EndIPAddress | Should -Be 0.0.0.1 Remove-AzMySqlFirewallRule -Name $env.firewallRuleName -ResourceGroupName $env.resourceGroup -ServerName $env.serverName + } + It 'ClientIPAddress' { #Use only one parameter when only one IP - $rule = New-AzMySqlFirewallRule -Name $env.firewallRuleName -ResourceGroupName $env.resourceGroup -ServerName $env.serverName -StartIPAddress 0.0.0.1 + $rule = New-AzMySqlFirewallRule -Name $env.firewallRuleName -ResourceGroupName $env.resourceGroup -ServerName $env.serverName -ClientIPAddress 0.0.0.1 $rule.Name | Should -Be $env.firewallRuleName $rule.StartIPAddress | Should -Be 0.0.0.1 $rule.EndIPAddress | Should -Be 0.0.0.1 diff --git a/src/MySql/test/Update-AzMySqlFirewallRule.Recording.json b/src/MySql/test/Update-AzMySqlFirewallRule.Recording.json index 61487ee1f6fd..e9b71b9541ce 100644 --- a/src/MySql/test/Update-AzMySqlFirewallRule.Recording.json +++ b/src/MySql/test/Update-AzMySqlFirewallRule.Recording.json @@ -1,5 +1,5 @@ { - "Update-AzMySqlFirewallRule+[NoContext]+UpdateExpanded+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+1": { + "Update-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+1": { "Request": { "Method": "PUT", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01", @@ -36,7 +36,7 @@ "Content": "{\"operation\":\"UpsertElasticServerFirewallRules\",\"startTime\":\"2020-07-24T07:10:12.05Z\"}" } }, - "Update-AzMySqlFirewallRule+[NoContext]+UpdateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/8e22193e-3d9c-4e45-bf1d-61bd3b5e29d8?api-version=2017-12-01+2": { + "Update-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/8e22193e-3d9c-4e45-bf1d-61bd3b5e29d8?api-version=2017-12-01+2": { "Request": { "Method": "GET", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/8e22193e-3d9c-4e45-bf1d-61bd3b5e29d8?api-version=2017-12-01", @@ -76,7 +76,7 @@ "Content": "{\"name\":\"8e22193e-3d9c-4e45-bf1d-61bd3b5e29d8\",\"status\":\"Succeeded\",\"startTime\":\"2020-07-24T07:10:12.05Z\"}" } }, - "Update-AzMySqlFirewallRule+[NoContext]+UpdateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+3": { + "Update-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+3": { "Request": { "Method": "GET", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01", @@ -115,7 +115,7 @@ "Content": "{\"properties\":{\"startIpAddress\":\"0.0.0.0\",\"endIpAddress\":\"0.0.0.1\"},\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01\",\"name\":\"mysqlrule01\",\"type\":\"Microsoft.DBforMySQL/servers/firewallRules\"}" } }, - "Update-AzMySqlFirewallRule+[NoContext]+UpdateExpanded+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+4": { + "Update-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+4": { "Request": { "Method": "PUT", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01", @@ -152,7 +152,7 @@ "Content": "{\"operation\":\"UpsertElasticServerFirewallRules\",\"startTime\":\"2020-07-24T07:10:29.63Z\"}" } }, - "Update-AzMySqlFirewallRule+[NoContext]+UpdateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/e5917bef-26e5-48bd-a3d4-ccfd236ebb4b?api-version=2017-12-01+5": { + "Update-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/e5917bef-26e5-48bd-a3d4-ccfd236ebb4b?api-version=2017-12-01+5": { "Request": { "Method": "GET", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/e5917bef-26e5-48bd-a3d4-ccfd236ebb4b?api-version=2017-12-01", @@ -161,7 +161,7 @@ "x-ms-unique-id": [ "4", "5" ], "x-ms-client-request-id": [ "f648dd60-5779-47ac-9af9-cd4d906c7f3d", "f648dd60-5779-47ac-9af9-cd4d906c7f3d" ], "CommandName": [ "Az.MySql.internal\\Update-AzMySqlFirewallRule", "Az.MySql.internal\\Update-AzMySqlFirewallRule" ], - "FullCommandName": [ "Update-AzMySqlFirewallRule_UpdateExpanded", "Update-AzMySqlFirewallRule_UpdateExpanded" ], + "FullCommandName": [ "Update-AzMySqlFirewallRule_ClientIPAddress", "Update-AzMySqlFirewallRule_ClientIPAddress" ], "ParameterSetName": [ "__AllParameterSets", "__AllParameterSets" ], "User-Agent": [ "AzurePowershell/Az4.0.0-preview", "AzurePowershell/Az4.0.0-preview" ], "Authorization": [ "[Filtered]" ] @@ -192,7 +192,7 @@ "Content": "{\"name\":\"e5917bef-26e5-48bd-a3d4-ccfd236ebb4b\",\"status\":\"Succeeded\",\"startTime\":\"2020-07-24T07:10:29.63Z\"}" } }, - "Update-AzMySqlFirewallRule+[NoContext]+UpdateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+6": { + "Update-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+6": { "Request": { "Method": "GET", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01", @@ -201,7 +201,7 @@ "x-ms-unique-id": [ "4", "5", "6" ], "x-ms-client-request-id": [ "f648dd60-5779-47ac-9af9-cd4d906c7f3d", "f648dd60-5779-47ac-9af9-cd4d906c7f3d", "f648dd60-5779-47ac-9af9-cd4d906c7f3d" ], "CommandName": [ "Az.MySql.internal\\Update-AzMySqlFirewallRule", "Az.MySql.internal\\Update-AzMySqlFirewallRule", "Az.MySql.internal\\Update-AzMySqlFirewallRule" ], - "FullCommandName": [ "Update-AzMySqlFirewallRule_UpdateExpanded", "Update-AzMySqlFirewallRule_UpdateExpanded", "Update-AzMySqlFirewallRule_UpdateExpanded" ], + "FullCommandName": [ "Update-AzMySqlFirewallRule_ClientIPAddress", "Update-AzMySqlFirewallRule_ClientIPAddress", "Update-AzMySqlFirewallRule_ClientIPAddress" ], "ParameterSetName": [ "__AllParameterSets", "__AllParameterSets", "__AllParameterSets" ], "User-Agent": [ "AzurePowershell/Az4.0.0-preview", "AzurePowershell/Az4.0.0-preview", "AzurePowershell/Az4.0.0-preview" ], "Authorization": [ "[Filtered]" ] @@ -231,7 +231,7 @@ "Content": "{\"properties\":{\"startIpAddress\":\"0.0.0.2\",\"endIpAddress\":\"0.0.0.2\"},\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01\",\"name\":\"mysqlrule01\",\"type\":\"Microsoft.DBforMySQL/servers/firewallRules\"}" } }, - "Update-AzMySqlFirewallRule+[NoContext]+UpdateExpanded+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+7": { + "Update-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01+7": { "Request": { "Method": "DELETE", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/MySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test-100/firewallRules/mysqlrule01?api-version=2017-12-01", @@ -273,7 +273,7 @@ "Content": "{\"operation\":\"DropElasticServerFirewallRule\",\"startTime\":\"2020-07-24T07:10:47.143Z\"}" } }, - "Update-AzMySqlFirewallRule+[NoContext]+UpdateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/ef9d3f5d-7528-4905-b20d-f765ede790a2?api-version=2017-12-01+8": { + "Update-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/ef9d3f5d-7528-4905-b20d-f765ede790a2?api-version=2017-12-01+8": { "Request": { "Method": "GET", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/ef9d3f5d-7528-4905-b20d-f765ede790a2?api-version=2017-12-01", @@ -313,7 +313,7 @@ "Content": "{\"name\":\"ef9d3f5d-7528-4905-b20d-f765ede790a2\",\"status\":\"Succeeded\",\"startTime\":\"2020-07-24T07:10:47.143Z\"}" } }, - "Update-AzMySqlFirewallRule+[NoContext]+UpdateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/operationResults/ef9d3f5d-7528-4905-b20d-f765ede790a2?api-version=2017-12-01+9": { + "Update-AzMySqlFirewallRule+[NoContext]+ClientIPAddress+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/operationResults/ef9d3f5d-7528-4905-b20d-f765ede790a2?api-version=2017-12-01+9": { "Request": { "Method": "GET", "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.DBforMySQL/locations/eastus/operationResults/ef9d3f5d-7528-4905-b20d-f765ede790a2?api-version=2017-12-01", diff --git a/src/MySql/test/Update-AzMySqlFirewallRule.Tests.ps1 b/src/MySql/test/Update-AzMySqlFirewallRule.Tests.ps1 index ea642647c8cb..fbc482625166 100644 --- a/src/MySql/test/Update-AzMySqlFirewallRule.Tests.ps1 +++ b/src/MySql/test/Update-AzMySqlFirewallRule.Tests.ps1 @@ -12,10 +12,11 @@ while(-not $mockingPath) { . ($mockingPath | Select-Object -First 1).FullName Describe 'Update-AzMySqlFirewallRule' { - It 'UpdateExpanded' { + It 'ClientIPAddress' { New-AzMySqlFirewallRule -Name $env.firewallRuleName -ResourceGroupName $env.resourceGroup -ServerName $env.serverName -EndIPAddress 0.0.0.1 -StartIPAddress 0.0.0.0 - $rule = Update-AzMySqlFirewallRule -Name $env.firewallRuleName -ResourceGroupName $env.resourceGroup -ServerName $env.serverName -StartIPAddress 0.0.0.2 + $rule = Update-AzMySqlFirewallRule -Name $env.firewallRuleName -ResourceGroupName $env.resourceGroup -ServerName $env.serverName -ClientIPAddress 0.0.0.2 $rule.StartIPAddress | Should -Be 0.0.0.2 + $rule.EndIPAddress | Should -Be 0.0.0.2 Remove-AzMySqlFirewallRule -Name $env.firewallRuleName -ResourceGroupName $env.resourceGroup -ServerName $env.serverName } @@ -27,4 +28,4 @@ Describe 'Update-AzMySqlFirewallRule' { $rule.EndIPAddress | Should -Be 0.0.0.3 Remove-AzMySqlFirewallRule -Name $env.firewallRuleName -ResourceGroupName $env.resourceGroup -ServerName $env.serverName } -} +} \ No newline at end of file