Get-AzureSqlDatabaseServerFirewallRule

Gets firewall rules for Azure SQL Database Server.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Service Management APIs. See the Az PowerShell module for cmdlets to manage Azure Resource Manager resources.

Syntax

Get-AzureSqlDatabaseServerFirewallRule
   -ServerName <String>
   [-RuleName <String>]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

The Get-AzureSqlDatabaseServerFirewallRule cmdlet gets firewall rules for an instance of Azure SQL Database Server. If you specify a firewall rule by name, this cmdlet returns information about that firewall rule. Otherwise, the cmdlet returns information about all the firewall rules on the specified Azure SQL Database server.

Examples

Example 1: Get all firewall rules on a server

PS C:\> Get-AzureSqlDatabaseServerFirewallRule -ServerName "lpqd0zbr8y"

This command gets all the firewall rules on the Azure SQL Database server named lpqd0zbr8y.

Example 2: Get a firewall rule by using its name

PS C:\> Get-AzureSqlDatabaseServerFirewallRule -ServerName "lpqd0zbr8y" -RuleName "FirewallRule24"

This command gets the firewall rule named FirewallRule24 on the server named lpqd0zbr8y.

Parameters

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

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

-RuleName

Specifies the name of the firewall rule that this cmdlet gets.

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

-ServerName

Specifies the name of a server. This cmdlet gets firewall rules from the server that this parameter specifies. Specify the server name, not the fully qualified DNS name.

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

Inputs

Microsoft.WindowsAzure.Commands.SqlDatabase.Model.SqlDatabaseServerFirewallRuleContext

Outputs

IEnumerable\<Microsoft.WindowsAzure.Commands.SqlDatabase.Model.SqlDatabaseServerFirewallRuleContext\>