你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzPostgreSqlFlexibleServerFirewallRule
创建新的防火墙规则或更新现有防火墙规则。
语法
New-AzPostgreSqlFlexibleServerFirewallRule
-ResourceGroupName <String>
-ServerName <String>
[-Name <String>]
[-SubscriptionId <String>]
-EndIPAddress <String>
-StartIPAddress <String>
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzPostgreSqlFlexibleServerFirewallRule
-ResourceGroupName <String>
-ServerName <String>
[-Name <String>]
[-SubscriptionId <String>]
-ClientIPAddress <String>
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzPostgreSqlFlexibleServerFirewallRule
-ResourceGroupName <String>
-ServerName <String>
[-Name <String>]
[-SubscriptionId <String>]
[-AllowAll]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
创建新的防火墙规则或更新现有防火墙规则。
示例
示例 1:创建新的 PostgreSql 服务器防火墙规则
New-AzPostgreSqlFlexibleServerFirewallRule -Name firewallrule-test -ResourceGroupName PowershellPostgreSqlTest -ServerName postgresql-test -EndIPAddress 0.0.0.1 -StartIPAddress 0.0.0.0
Name StartIPAddress EndIPAddress
----------------- -------------- ------------
firewallrule-test 0.0.0.0 0.0.0.1
此 cmdlet 创建 PostgreSql 服务器防火墙规则。
示例 2:使用 -ClientIPAddress 创建新的 PostgreSql 防火墙规则。
New-AzPostgreSqlFlexibleServerFirewallRule -ResourceGroupName PowershellPostgreSqlTest -ServerName postgresql-test -ClientIPAddress 0.0.0.1
Name StartIPAddress EndIPAddress
---- -------------- ------------
ClientIPAddress_2020-08-11_18-19-27 0.0.0.1 0.0.0.1
此 cmdlet 使用 -ClientIPAddress 创建 PostgreSql 防火墙规则。
示例 3:创建新的 PostgreSql 防火墙规则以允许所有 IP
New-AzPostgreSqlFlexibleServerFirewallRule -ResourceGroupName PowershellPostgreSqlTest -ServerName postgresql-test -AllowAll
Name StartIPAddress EndIPAddress
---- -------------- ------------
AllowAll_2020-08-11_18-19-27 0.0.0.0 255.255.255.255
此 cmdlet 创建新的 PostgreSql 防火墙规则以允许所有 IP。
参数
-AllowAll
存在以允许所有范围 IP,从 0.0.0.0 到 255.255.255.255。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-AsJob
以作业身份运行命令
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ClientIPAddress
客户端指定的服务器防火墙规则的单个 IP。 必须是 IPv4 格式。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | PSObject |
别名: | AzureRMContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EndIPAddress
服务器防火墙规则的结束 IP 地址。 必须是 IPv4 格式。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Name
服务器防火墙规则的名称。 如果未指定,则默认值为未定义。 如果 AllowAll 存在,则默认名称为 AllowAll_yyyy-MM-dd_HH-mm-ss。
类型: | String |
别名: | FirewallRuleName |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-NoWait
异步运行命令
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
资源组的名称。 名称不区分大小写。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ServerName
服务器的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-StartIPAddress
服务器防火墙规则的起始 IP 地址。 必须是 IPv4 格式。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-SubscriptionId
目标订阅的 ID。
类型: | String |
Position: | Named |
默认值: | (Get-AzContext).Subscription.Id |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |