Skip to content

Conversation

@jessicl-ms
Copy link
Contributor

@jessicl-ms jessicl-ms commented Apr 17, 2020

Description

See https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/554 for detailed description and example usage of the new/modified cmdlets.

Changed Cmdlets

For Private Link
https://github.com/jessicl-ms/azure-powershell/blob/jessicl/update-afd-ps-module/src/FrontDoor/FrontDoor/help/New-AzFrontDoorBackendObject.md

For Rules Engine
https://github.com/jessicl-ms/azure-powershell/blob/jessicl/update-afd-ps-module/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRoutingRuleObject.md

New Cmdlets

For Rules Engine
https://github.com/jessicl-ms/azure-powershell/blob/jessicl/update-afd-ps-module/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngine.md

https://github.com/jessicl-ms/azure-powershell/blob/jessicl/update-afd-ps-module/src/FrontDoor/FrontDoor/help/Get-AzFrontDoorRulesEngine.md

https://github.com/jessicl-ms/azure-powershell/blob/jessicl/update-afd-ps-module/src/FrontDoor/FrontDoor/help/Set-AzFrontDoorRulesEngine.md

https://github.com/jessicl-ms/azure-powershell/blob/jessicl/update-afd-ps-module/src/FrontDoor/FrontDoor/help/Remove-AzFrontDoorRulesEngine.md

These cmdlets are for constructing PS objects that are eventually passed in as inputs to Rules Engine cmdlets. These cmdlets do not make web requests.

https://github.com/jessicl-ms/azure-powershell/blob/jessicl/update-afd-ps-module/src/FrontDoor/FrontDoor/help/New-AzFrontDoorHeaderActionObject.md

https://github.com/jessicl-ms/azure-powershell/blob/jessicl/update-afd-ps-module/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngineActionObject.md

https://github.com/jessicl-ms/azure-powershell/blob/jessicl/update-afd-ps-module/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngineMatchConditionObject.md

https://github.com/jessicl-ms/azure-powershell/blob/jessicl/update-afd-ps-module/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngineRuleObject.md

Sample of end-to-end usage

CRUD operations on Rules Engine

PS C:\> $headerAction1 = New-AzFrontDoorHeaderActionObject -HeaderName "headeraction1" -HeaderActionType Overwrite
PS C:\> $headerAction2 = New-AzFrontDoorHeaderActionObject -HeaderName headeraction2 -HeaderActionType Append
PS C:\> $headerActions = $headerAction1, $headerAction2
PS C:\> $rulesEngineAction = New-AzFrontDoorRulesEngineActionObject -RequestHeaderAction $headerActions -ForwardingProtocol HttpsOnly -BackendPoolName mybackendpool -ResourceGroupName myResourceGroup -FrontDoorName myFrontDoor -QueryParameterStripDirective StripNone -DynamicCompression Disabled -EnableCaching $true
PS C:\> $rulesEngineAction

RequestHeaderActions           ResponseHeaderActions RouteConfigurationOverride
--------------------           --------------------- --------------------------
{headeraction1, headeraction2} {}                    Microsoft.Azure.Commands.FrontDoor.Models.PSForwardingConfigurati…

PS C:\> $rulesEngineAction.RequestHeaderAction

HeaderName    HeaderActionType Value
----------    ---------------- -----
headeraction1        Overwrite
headeraction2           Append

PS C:\> $rulesEngineAction.ResponseHeaderAction
PS C:\> $rulesEngineAction.RouteConfigurationOverride

CustomForwardingPath         :
ForwardingProtocol           : HttpsOnly
BackendPoolId                : /subscriptions/<subscriptionId>/resourceGroups/myResourceGroup/provi
                               ders/Microsoft.Network/frontDoors/myFrontDoor/BackendPools/mybackendpool
QueryParameterStripDirective : StripNone
DynamicCompression           : Disabled
EnableCaching                : True

PS C:\> $rulesEngineMatchCondition = New-AzFrontDoorRulesEngineMatchConditionObject -MatchVariable RequestHeader -Operator Equal -MatchValue allowoverride -Transform "LowerCase", "UpperCase"-Selector Rules-Engine-Route-Forward -NegateCondition $false
PS C:\> $rulesEngineMatchCondition

RulesEngineMatchVariable : RequestHeader
RulesEngineMatchValue    : {allowoverride}
Selector                 : Rules-Engine-Route-Forward
RulesEngineOperator      : Equal
NegateCondition          : False
Transform                : {Lowercase, Uppercase}

PS C:\> $rulesEngineRule1 = New-AzFrontDoorRulesEngineRuleObject -Name rules1 -Priority 0 -Action $rulesEngineAction -MatchProcessingBehavior Stop -MatchCondition $rulesEngineMatchCondition
PS C:\> $rulesEngineRule1

Name                    : rules1
Priority                : 0
MatchProcessingBehavior : Stop
MatchConditions         : {Microsoft.Azure.Commands.FrontDoor.Models.PSRulesEngineMatchCondition}
Action                  : Microsoft.Azure.Commands.FrontDoor.Models.PSRulesEngineAction


PS C:\> $rulesEngineRule1.Action

RequestHeaderActions           ResponseHeaderActions RouteConfigurationOverride
--------------------           --------------------- --------------------------
{headeraction1, headeraction2} {}                    Microsoft.Azure.Commands.FrontDoor.Models.PSForwardingConfigurati…

PS C:\> $rulesEngineRule1.MatchConditions[0]

RulesEngineMatchVariable : RequestHeader
RulesEngineMatchValue    : {allowoverride}
Selector                 : Rules-Engine-Route-Forward
RulesEngineOperator      : Equal
NegateCondition          : False
Transform                : {Lowercase, Uppercase}

PS C:\> New-AzFrontDoorRulesEngine -ResourceGroupName myResourceGroup -FrontDoorName myFrontDoor -Name rulesEngine3 -Rule $rulesEngineRule1

Name         RulesEngineRules
----         ----------------
rulesEngine3 {rules1}

PS C:\> $rulesEngine3 = Get-AzFrontDoorRulesEngine -ResourceGroupName myResourceGroup -FrontDoorName myFrontDoor -Name rulesengine3
PS C:\> $rulesEngine3

Name         RulesEngineRules
----         ----------------
rulesEngine3 {rules1}

PS C:\> Get-AzFrontDoorRulesEngine -ResourceGroupName myResourceGroup -FrontDoorName myFrontDoor

Name         RulesEngineRules
----         ----------------
rulesEngine1 {Rule1}
rulesEngine2 {Rule1}
rulesEngine3 {rules1}

PS C:\> $rulesEngineRule2 = New-AzFrontDoorRulesEngineRuleObject -Name rules2 -Priority 3 -Action $rulesEngineAction
PS C:\> Set-AzFrontDoorRulesEngine -ResourceGroupName myResourceGroup -FrontDoor myFrontDoor -Name rulesEngine3 -Rule $rulesEngineRule1, $rulesEngineRule2

Name         RulesEngineRules
----         ----------------
rulesEngine3 {rules1, rules2}

PS C:\> $rulesEngine3 = Get-AzFrontDoorRulesEngine -ResourceGroupName myResourceGroup -FrontDoorName myFrontDoor -Name rulesengine3
PS C:\> Remove-AzFrontDoorRulesEngine -ResourceGroupName myResourceGroup -FrontDoorName myFrontDoor -Name $rulesEngine3.Name -PassThru
True

Adding rules engine configuration to routing rule. There is no change to how to update a front door's routing rules.

New-AzFrontDoorRoutingRuleObject -ResourceGroupName myResourceGroup -FrontDoorName myfrontdoor -Name routingrule2 -FrontendEndpointName myfrontendendpoint -ForwardingProtocol HttpsOnly -BackendPoolName mybackendpool -AcceptedProtocol Https -RulesEngineName rulesEngine2

FrontendEndpointIds : {/subscriptions/<subscriptionId>/resourceGroups/myResourceGroup/providers/Microsoft.Network/frontD
                      oors/myfrontdoor/FrontendEndpoints/myfrontendendpoint}
AcceptedProtocols   : {Https}
PatternsToMatch     : {/*}
HealthProbeSettings :
RouteConfiguration  : Microsoft.Azure.Commands.FrontDoor.Models.PSForwardingConfiguration
EnabledState        : Enabled
ResourceState       :
RulesEngineId       : /subscriptions/<subscriptionId>/resourceGroups/myResourceGroup/providers/Microsoft.Network/frontDo
                      ors/myfrontdoor/BackendPools/rulesEngine2
Id                  :
Name                : routingrule2
Type                :

Adding private link configuration to backend object. There is no change to how to update a front door's backends.

PS C:\> New-AzFrontDoorBackendObject -Address <address> -PrivateLinkAlias privatelinkalias -PrivateLinkApprovalMessage "Please approve me to use this private link"

Address                    : <address>
HttpPort                   : 80
HttpsPort                  : 443
Priority                   : 1
Weight                     : 50
BackendHostHeader          : <hostheader>
EnabledState               : Enabled
PrivateLinkAlias           : privatelinkalias
PrivateEndpointStatus      :
PrivateLinkApprovalMessage : Please approve me to use this private link

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
    • the markdown help files have been regenerated using the commands listed here

@adxsdkps
Copy link
Collaborator

Can one of the admins verify this patch?

@wyunchi-ms
Copy link
Contributor

Hi @jessicl-ms , the CI failed. Please rerecord the test cases.

@jessicl-ms
Copy link
Contributor Author

The https://github.com/Azure/azure-powershell/blob/master/documentation/Debugging-StaticAnalysis-Errors.md doc describes how to deal BreakingChangeIssues.csv, SignatureIssues.csv, and/or HelpIssues.csv but the issues I seem to be having are ExtraAssemblies.csv, SharedAssemblyConflict.csv, and DependencyMap.csv. Is there a doc that explains how to resolve these kind of issues?

@jessicl-ms
Copy link
Contributor Author

The https://github.com/Azure/azure-powershell/blob/master/documentation/Debugging-StaticAnalysis-Errors.md doc describes how to deal BreakingChangeIssues.csv, SignatureIssues.csv, and/or HelpIssues.csv but the issues I seem to be having are ExtraAssemblies.csv, SharedAssemblyConflict.csv, and DependencyMap.csv. Is there a doc that explains how to resolve these kind of issues?

Figured it out the issue.

@wyunchi-ms
Copy link
Contributor

Hi @jessicl-ms , we add some StatisAnalysis rules and the CI failed. Could you please take a look at the exceptions. And make some modification for your PR? Sorry for this.

@wyunchi-ms wyunchi-ms merged commit ff3def7 into Azure:master May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants