你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzFrontDoorCdnRule
获取规则集中的现有传递规则。
语法
Get-AzFrontDoorCdnRule
-ProfileName <String>
-ResourceGroupName <String>
-SetName <String>
[-SubscriptionId <String[]>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Get-AzFrontDoorCdnRule
-Name <String>
-ProfileName <String>
-ResourceGroupName <String>
-SetName <String>
[-SubscriptionId <String[]>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Get-AzFrontDoorCdnRule
-InputObject <ICdnIdentity>
[-DefaultProfile <PSObject>]
[<CommonParameters>]
说明
获取规则集中的现有传递规则。
示例
示例 1:列出指定规则集中的 AzureFrontDoor 传递规则
Get-AzFrontDoorCdnRule -ResourceGroupName testps-rg-da16jm -ProfileName fdp-v542q6 -RuleSetName ruleset001
Name ResourceGroupName
---- -----------------
testrule1 testps-rg-da16jm
testrule2 testps-rg-da16jm
rule1 testps-rg-da16jm
列出指定规则集中的 AzureFrontDoor 传递规则
示例 2:获取指定规则集中的 AzureFrontDoor 传递规则
Get-AzFrontDoorCdnRule -ResourceGroupName testps-rg-da16jm -ProfileName fdp-v542q6 -RuleSetName ruleset001 -Name rule1
Name ResourceGroupName
---- -----------------
rule1 testps-rg-da16jm
获取指定规则集中的 AzureFrontDoor 传递规则
示例 3:通过标识获取指定规则集中的 AzureFrontDoor 传递规则
$conditions = @(
New-AzFrontDoorCdnRuleClientPortConditionObject -Name ClientPort -ParameterOperator Equal -ParameterMatchValue 80,81
New-AzFrontDoorCdnRuleIsDeviceConditionObject -Name IsDevice -ParameterMatchValue Mobile
New-AzFrontDoorCdnRuleSslProtocolConditionObject -Name SslProtocol -ParameterMatchValue TLSv1.2
);
$actions = @(
New-AzFrontDoorCdnRuleRequestHeaderActionObject -Name ModifyRequestHeader -ParameterHeaderAction Append -ParameterHeaderName a1 -ParameterValue a1
New-AzFrontDoorCdnRuleResponseHeaderActionObject -Name ModifyResponseHeader -ParameterHeaderAction Append -ParameterHeaderName a1 -ParameterValue a1
New-AzFrontDoorCdnRuleUrlRedirectActionObject -Name UrlRedirect -ParameterRedirectType Moved -ParameterDestinationProtocol MatchRequest
);
New-AzFrontDoorCdnRule -ResourceGroupName testps-rg-da16jm -ProfileName fdp-v542q6 -RuleSetName ruleset001 -Name rule1 -Action $actions -Condition $conditions | Get-AzFrontDoorCdnRule
Name ResourceGroupName
---- -----------------
rule1 testps-rg-da16jm
通过标识获取指定规则集中的 AzureFrontDoor 传递规则
参数
-DefaultProfile
DefaultProfile 参数不起作用。 如果对其他订阅执行 cmdlet,请使用 SubscriptionId 参数。
类型: | PSObject |
别名: | AzureRMContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InputObject
要构造的标识参数,请参阅 INPUTOBJECT 属性的 NOTES 部分并创建哈希表。
类型: | ICdnIdentity |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Name
终结点中唯一的传递规则的名称。
类型: | String |
别名: | RuleName |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ProfileName
Azure Front Door Standard 或 Azure Front Door Premium 配置文件的名称,该配置文件在资源组中是唯一的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
Azure 订阅中的资源组的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-SetName
配置文件下的规则集的名称。
类型: | String |
别名: | RuleSetName |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-SubscriptionId
Azure 订阅 ID。
类型: | String[] |
Position: | Named |
默认值: | (Get-AzContext).Subscription.Id |
必需: | False |
接受管道输入: | False |
接受通配符: | False |