Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Az.FrontDoor Examples #17130

Merged
merged 2 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ The **Disable-AzFrontDoorCustomDomainHttps** disables HTTPS for a custom domain.

### Example 1: Disable HTTPS for a custom domain with FrontDoorName and ResourceGroupName.
```powershell
PS C:\> Disable-AzFrontDoorCustomDomainHttps -ResourceGroupName "resourcegroup1" -FrontDoorName "frontdoor1" -FrontendEndpointName "frontendpointname1-custom-xyz"
Disable-AzFrontDoorCustomDomainHttps -ResourceGroupName "resourcegroup1" -FrontDoorName "frontdoor1" -FrontendEndpointName "frontendpointname1-custom-xyz"
```

```output
HostName : frontendpointname1.custom.xyz
SessionAffinityEnabledState : Disabled
SessionAffinityTtlSeconds : 0
Expand All @@ -64,8 +66,10 @@ Disable HTTPS for a custom domain "frontendpointname1-custom-xyz" with FrontDoor

### Example 2: Disable HTTPS for a custom domain with PSFrontendEndpoint object.
```powershell
PS C:\> Get-AzFrontDoorFrontendEndpoint -ResourceGroupName "resourcegroup1" -FrontDoorName "frontdoor1" -FrontendEndpointName "frontendpointname1-custom-xyz" | Disable-AzFrontDoorCustomDomainHttps -InputObject $frontendEndpointObj
Get-AzFrontDoorFrontendEndpoint -ResourceGroupName "resourcegroup1" -FrontDoorName "frontdoor1" -FrontendEndpointName "frontendpointname1-custom-xyz" | Disable-AzFrontDoorCustomDomainHttps -InputObject $frontendEndpointObj
```

```output
HostName : frontendpointname1.custom.xyz
SessionAffinityEnabledState : Disabled
SessionAffinityTtlSeconds : 0
Expand All @@ -90,8 +94,10 @@ Disable HTTPS for a custom domain with PSFrontendEndpoint object.

### Example 3: Disable HTTPS for a custom domain with ResourceId.
```powershell
PS C:\> Disable-AzFrontDoorCustomDomainHttps -ResourceId $resourceId
Disable-AzFrontDoorCustomDomainHttps -ResourceId $resourceId
```

```output
HostName : frontendpointname1.custom.xyz
SessionAffinityEnabledState : Disabled
SessionAffinityTtlSeconds : 0
Expand Down
29 changes: 17 additions & 12 deletions src/FrontDoor/FrontDoor/help/Enable-AzFrontDoorCustomDomainHttps.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ The **Enable-AzFrontDoorCustomDomainHttps** enables HTTPS for a custom domain.

### Example 1: Enable HTTPS for a custom domain with FrontDoorName and ResourceGroupName using Front Door managed certificate.
```powershell
PS C:\> Enable-AzFrontDoorCustomDomainHttps -ResourceGroupName "resourcegroup1" -FrontDoorName "frontdoor1" -FrontendEndpointName "frontendpointname1-custom-xyz" -MinimumTlsVersion "1.2"

Enable-AzFrontDoorCustomDomainHttps -ResourceGroupName "resourcegroup1" -FrontDoorName "frontdoor1" -FrontendEndpointName "frontendpointname1-custom-xyz" -MinimumTlsVersion "1.2"
```

```output
HostName : frontendpointname1.custom.xyz
SessionAffinityEnabledState : Disabled
SessionAffinityTtlSeconds : 0
Expand All @@ -88,10 +89,11 @@ Enable HTTPS for a custom domain "frontendpointname1-custom-xyz" that is part of

### Example 2: Enable HTTPS for a custom domain with FrontDoorName and ResourceGroupName using customer's own certificate in Key Vault with the specific version.
```powershell
PS C:\> $vaultId = (Get-AzKeyVault -VaultName $vaultName).ResourceId
PS C:\> Enable-AzFrontDoorCustomDomainHttps -ResourceGroupName "resourcegroup1" -FrontDoorName "frontdoor1" -FrontendEndpointName "frontendpointname1-custom-xyz" -Vault $vaultId -secretName $secretName -SecretVersion $secretVersion -MinimumTlsVersion "1.0"

$vaultId = (Get-AzKeyVault -VaultName $vaultName).ResourceId
Enable-AzFrontDoorCustomDomainHttps -ResourceGroupName "resourcegroup1" -FrontDoorName "frontdoor1" -FrontendEndpointName "frontendpointname1-custom-xyz" -Vault $vaultId -secretName $secretName -SecretVersion $secretVersion -MinimumTlsVersion "1.0"
```

```output
HostName : frontendpointname1.custom.xyz
SessionAffinityEnabledState : Disabled
SessionAffinityTtlSeconds : 0
Expand All @@ -117,9 +119,10 @@ Enable HTTPS for a custom domain "frontendpointname1-custom-xyz" that is part of

### Example 3: Enable HTTPS for a custom domain with PSFrontendEndpoint object using Front Door managed certificate.
```powershell
PS C:\> Get-AzFrontDoorFrontendEndpoint -ResourceGroupName "resourcegroup1" -FrontDoorName "frontdoor1" -Name "frontendpointname1-custom-xyz" | Enable-AzFrontDoorCustomDomainHttps

Get-AzFrontDoorFrontendEndpoint -ResourceGroupName "resourcegroup1" -FrontDoorName "frontdoor1" -Name "frontendpointname1-custom-xyz" | Enable-AzFrontDoorCustomDomainHttps
```

```output
HostName : frontendpointname1.custom.xyz
SessionAffinityEnabledState : Disabled
SessionAffinityTtlSeconds : 0
Expand All @@ -145,9 +148,10 @@ Enable HTTPS for a custom domain with PSFrontendEndpoint object using Front Door

### Example 4: Enable HTTPS for a custom domain with resource id using Front Door managed certificate.
```powershell
PS C:\> Enable-AzFrontDoorCustomDomainHttps -ResourceId $resourceId

Enable-AzFrontDoorCustomDomainHttps -ResourceId $resourceId
```

```output
HostName : frontendpointname1.custom.xyz
SessionAffinityEnabledState : Disabled
SessionAffinityTtlSeconds : 0
Expand All @@ -173,10 +177,11 @@ Enable HTTPS for a custom domain "frontendpointname1-custom-xyz" with resource i

### Example 5: Enable HTTPS for a custom domain with FrontDoorName and ResourceGroupName using customer's own certificate in Key Vault with the latest version to enable certificate auto-rotation.
```powershell
PS C:\> $vaultId = (Get-AzKeyVault -VaultName $vaultName).ResourceId
PS C:\> Enable-AzFrontDoorCustomDomainHttps -ResourceGroupName "resourcegroup1" -FrontDoorName "frontdoor1" -FrontendEndpointName "frontendpointname1-custom-xyz" -Vault $vaultId -secretName $secretName -MinimumTlsVersion "1.0"

$vaultId = (Get-AzKeyVault -VaultName $vaultName).ResourceId
Enable-AzFrontDoorCustomDomainHttps -ResourceGroupName "resourcegroup1" -FrontDoorName "frontdoor1" -FrontendEndpointName "frontendpointname1-custom-xyz" -Vault $vaultId -secretName $secretName -MinimumTlsVersion "1.0"
```

```output
HostName : frontendpointname1.custom.xyz
SessionAffinityEnabledState : Disabled
SessionAffinityTtlSeconds : 0
Expand Down
12 changes: 9 additions & 3 deletions src/FrontDoor/FrontDoor/help/Get-AzFrontDoor.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ The **Get-AzFrontDoor** cmdletGet gets all existing Front Doors in the current s

### Example 1: Get all FrontDoors in the current subscription.
```powershell
PS C:\> Get-AzFrontDoor
Get-AzFrontDoor
```

```output
FriendlyName : frontdoor1
FrontDoorId : {guid}
RoutingRules : {routingrule1}
Expand Down Expand Up @@ -65,8 +67,10 @@ Get all FrontDoors in the current subscription.

### Example 2: Get all FrontDoors in resource group "rg1" in the current subscription.
```powershell
PS C:\> Get-AzFrontDoor -ResourceGroupName "rg1"
Get-AzFrontDoor -ResourceGroupName "rg1"
```

```output
FriendlyName : frontdoor1
FrontDoorId : {guid}
RoutingRules : {routingrule1}
Expand Down Expand Up @@ -106,8 +110,10 @@ Get all FrontDoors in resource group "rg1" in the current subscription.

### Example 3: Get the FrontDoors in resource group "rg1" with name "frontDoor1" in the current subscription.
```powershell
PS C:\> Get-AzFrontDoor -ResourceGroupName "rg1" -Name "frontDoor1"
Get-AzFrontDoor -ResourceGroupName "rg1" -Name "frontDoor1"
```

```output
FriendlyName : frontdoor1
FrontDoorId : {guid}
RoutingRules : {routingrule1}
Expand Down
10 changes: 6 additions & 4 deletions src/FrontDoor/FrontDoor/help/Get-AzFrontDoorFrontendEndpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ The **Get-AzFrontDoorFrontendEndpoint** cmdlet gets all existing frontend endpoi

### Example 1: Get all frontend endpoints in Front Door "frontdoor1" which is part of resource group "rg1".
```powershell
PS C:\> Get-AzFrontDoorFrontendEndpoint -ResourceGroupName "rg1" -FrontDoorName "frontdoor1"

Get-AzFrontDoorFrontendEndpoint -ResourceGroupName "rg1" -FrontDoorName "frontdoor1"
```

```output
HostName : frontdoor1.azurefd.net
SessionAffinityEnabledState : Disabled
SessionAffinityTtlSeconds : 0
Expand Down Expand Up @@ -83,9 +84,10 @@ Get all frontend endpoints in Front Door "frontdoor1" which is part of resource

### Example 2: Get frontend endpoint with name "frontdoor1-azurefd-net" in Front Door "frontdoor1" which is part of resource group "rg1"
```powershell
PS C:\> Get-AzFrontDoorFrontendEndpoint -ResourceGroupName "rg1" -FrontDoorName "frontdoor1" -Name "frontdoor1-azurefd-net"

Get-AzFrontDoorFrontendEndpoint -ResourceGroupName "rg1" -FrontDoorName "frontdoor1" -Name "frontdoor1-azurefd-net"
```

```output
HostName : frontdoor1.azurefd.net
SessionAffinityEnabledState : Disabled
SessionAffinityTtlSeconds : 0
Expand Down
13 changes: 10 additions & 3 deletions src/FrontDoor/FrontDoor/help/Get-AzFrontDoorRulesEngine.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ The **Get-AzFrontDoorRulesEngine** cmdlet gets a specific rules engine configura

### Example 1
```powershell
PS C:\> Get-AzFrontDoorRulesEngine -ResourceGroupName $resourceGroupName -FrontDoorName $frontDoorName -Name rulesengine3
Get-AzFrontDoorRulesEngine -ResourceGroupName $resourceGroupName -FrontDoorName $frontDoorName -Name rulesengine3
```

```output
Name RulesEngineRules
---- ----------------
rulesEngine3 {rules1}
Expand All @@ -36,8 +38,10 @@ Get specific rules engine configuration.
### Example 2

```powershell
PS C:\> Get-AzFrontDoorRulesEngine -ResourceGroupName $resourceGroupName -FrontDoorName $frontDoorName
Get-AzFrontDoorRulesEngine -ResourceGroupName $resourceGroupName -FrontDoorName $frontDoorName
```

```output
Name RulesEngineRules
---- ----------------
rulesEngine1 {Rule1}
Expand All @@ -50,7 +54,10 @@ Get all rules engine configurations in a front door.
### Example 3

```powershell
PS C:\> Get-AzFrontDoorRulesEngine -ResourceGroupName $resourceGroupName -FrontDoorName $frontDoorName -Name nonexistent
Get-AzFrontDoorRulesEngine -ResourceGroupName $resourceGroupName -FrontDoorName $frontDoorName -Name nonexistent
```

```output
Get-AzFrontDoorRulesEngine : Rules Engine with name 'nonexistent' in Front Door 'frontDoorName' is not found.
At line:1 char:1
+ Get-AzFrontDoorRulesEngine -ResourceGroupName $resourceGroupName -FrontD ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ Gets the list of WAF managed rule set definitions to use as reference

### Example 1
```powershell
PS C:> Get-AzFrontDoorWafManagedRuleSetDefinition
Get-AzFrontDoorWafManagedRuleSetDefinition
```

```output
ProvisioningState RuleSetType RuleSetVersion RuleGroups
----------------- ----------- -------------- ----------
Succeeded DefaultRuleSet 1.0 {PROTOCOL-ATTACK, LFI, RFI, RCE...}
Expand Down
8 changes: 6 additions & 2 deletions src/FrontDoor/FrontDoor/help/Get-AzFrontDoorWafPolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ The **Get-AzFrontDoorWafPolicy** cmdletGet gets WAF policy in a resource group u

### Example 1
```powershell
PS C:\> Get-AzFrontDoorWafPolicy -Name $policyName -ResourceGroupName $resourceGroupName
Get-AzFrontDoorWafPolicy -Name $policyName -ResourceGroupName $resourceGroupName
```

```output
Name PolicyMode PolicyEnabledState CustomBlockResponseStatusCode RedirectUrl
---- ---------- ------------------ ----------------------------- -----------
{policyName} Prevention Enabled 403 https://www.bing.com/
Expand All @@ -35,8 +37,10 @@ Get a WAF policy called $policyName in $resourceGroupName

### Example 2
```powershell
PS C:\> Get-AzFrontDoorWafPolicy -ResourceGroupName $resourceGroupName
Get-AzFrontDoorWafPolicy -ResourceGroupName $resourceGroupName
```

```output
Name PolicyMode PolicyEnabledState CustomBlockResponseStatusCode RedirectUrl
---- ---------- ------------------ ----------------------------- -----------
{policyName} Prevention Disabled
Expand Down
4 changes: 3 additions & 1 deletion src/FrontDoor/FrontDoor/help/New-AzFrontDoor.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ The **New-AzFrontDoor** cmdlet creates a new Azure Front Door load balancer in t

### Example 1: Create a Front Door based on given parameters.
```powershell
PS C:\> New-AzFrontDoor -Name "frontDoor1" -ResourceGroupName "rg1" -RoutingRule $routingrule1 -BackendPool $backendpool1 -FrontendEndpoint $frontendEndpoint1 -LoadBalancingSetting $loadBalancingSetting1 -HealthProbeSetting $healthProbeSetting1 -BackendPoolsSetting $backendPoolsSetting1
New-AzFrontDoor -Name "frontDoor1" -ResourceGroupName "rg1" -RoutingRule $routingrule1 -BackendPool $backendpool1 -FrontendEndpoint $frontendEndpoint1 -LoadBalancingSetting $loadBalancingSetting1 -HealthProbeSetting $healthProbeSetting1 -BackendPoolsSetting $backendPoolsSetting1
```

```output
FriendlyName : frontdoor1
RoutingRules : {routingrule1}
BackendPools : {backendpool1}
Expand Down
5 changes: 3 additions & 2 deletions src/FrontDoor/FrontDoor/help/New-AzFrontDoorBackendObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ Create a PSBackend object for Front Door creation

### Example 1
```powershell
PS C:\>New-AzFrontDoorBackendObject -Address "contoso1.azurewebsites.net"

New-AzFrontDoorBackendObject -Address "contoso1.azurewebsites.net"
```

```output
Address : contoso1.azurewebsites.net
HttpPort : 80
HttpsPort : 443
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ Create a PSBackendPool object for Front Door creation

### Example 1
```powershell
PS C:\> New-AzFrontDoorBackendPoolObject -Name "backendpool1" -FrontDoorName $Name -ResourceGroupName $resourceGroupName -Backend $backend1 -He
New-AzFrontDoorBackendPoolObject -Name "backendpool1" -FrontDoorName $Name -ResourceGroupName $resourceGroupName -Backend $backend1 -He
althProbeSettingsName "healthProbeSetting1" -LoadBalancingSettingsName "loadBalancingSetting1"
```


```output
Backends : {Microsoft.Azure.Commands.FrontDoor.Models.PSBackend}
LoadBalancingSettingRef : /subscriptions/{subid}/resourceGroups/{resourceGroupName}/providers
/Microsoft.Network/frontDoors/frontdoor5/LoadBalancingSettings/loadBalancingSetting1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ The **New-AzFrontDoorBackendpoolsSettingObject** cmdlet creates a new PSBackendP

### Example 1: Create BackendPoolsSettings object using defaults
```powershell
PS C:\> New-AzFrontDoorBackendpoolsSettingObject

New-AzFrontDoorBackendpoolsSettingObject
```

```output
EnforceCertificateNameCheck : Enabled
SendRecvTimeoutInSeconds : 30
Id :
Expand All @@ -36,9 +37,10 @@ Type :

### Example 2: Create BackendPoolsSettings object with user specified values
```powershell
PS C:\> New-AzFrontDoorBackendpoolsSettingObject -SendRecvTimeoutInSeconds 60 -EnforceCertificateNameCheck Enabled

New-AzFrontDoorBackendpoolsSettingObject -SendRecvTimeoutInSeconds 60 -EnforceCertificateNameCheck Enabled
```

```output
EnforceCertificateNameCheck : Enabled
SendRecvTimeoutInSeconds : 60
Id :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ Create a PSFrontendEndpoint Object for Front Door creation

### Example 1
```powershell
PS C:\> New-AzFrontDoorFrontendEndpointObject -Name "frontendendpoint1" -HostName "frontendendpoint1"

New-AzFrontDoorFrontendEndpointObject -Name "frontendendpoint1" -HostName "frontendendpoint1"
```

```output
HostName : frontendendpoint1
SessionAffinityEnabledState : Disabled
SessionAffinityTtlSeconds : 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ Creates PSHeaderAction object for the creation of PSRulesEngineAction object.

### Example 1
```powershell
PS C:\> New-AzFrontDoorHeaderActionObject -HeaderName headername -HeaderActionType Append
New-AzFrontDoorHeaderActionObject -HeaderName headername -HeaderActionType Append
```

```output
HeaderName HeaderActionType Value
---------- ---------------- -----
headername Append
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ Create a PSHealthProbeSetting object for Front Door creation

### Example 1
```powershell
PS C:\> New-AzFrontDoorHealthProbeSettingObject -Name "healthProbeSetting1"

New-AzFrontDoorHealthProbeSettingObject -Name "healthProbeSetting1"
```

```output
Path : /
Protocol : Http
IntervalInSeconds : 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ Create a PSLoadBalancingSetting object for Front Door creation

### Example 1
```powershell
PS C:\> New-AzFrontDoorLoadBalancingSettingObject -Name "loadbalancingsetting1"

New-AzFrontDoorLoadBalancingSettingObject -Name "loadbalancingsetting1"
```

```output
SampleSize : 4
AdditionalLatencyMilliseconds : 0
SuccessfulSamplesRequired : 2
Expand Down
16 changes: 10 additions & 6 deletions src/FrontDoor/FrontDoor/help/New-AzFrontDoorRoutingRuleObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ Create a PSRoutingRuleObject for Front Door creation

### Example 1: Create a PSRoutingRuleObject for Front Door creation with a forwarding rule
```powershell
PS C:\> New-AzFrontDoorRoutingRuleObject -Name $routingRuleName -FrontDoorName $frontDoorName -ResourceGroupName $rgname -FrontendEndpointName "frontendEndpoint1" -BackendPoolName "backendPool1"
New-AzFrontDoorRoutingRuleObject -Name $routingRuleName -FrontDoorName $frontDoorName -ResourceGroupName $rgname -FrontendEndpointName "frontendEndpoint1" -BackendPoolName "backendPool1"
```

```output
FrontendEndpointIds : {/subscriptions/{subid}/resourceGroups/{rgname}/pro
viders/Microsoft.Network/frontDoors/{frontdoorname}/FrontendEndpoints/frontendEndpoint1}
AcceptedProtocols : {Http, Https}
Expand All @@ -55,12 +57,14 @@ Type :

### Example 2: Create a PSRoutingRuleObject for Front Door creation with a redirect rule
```powershell
PS C:\> $customHost = "www.contoso.com"
PS C:\> $customPath = "/images/contoso.png"
PS C:\> $queryString = "field1=value1&field2=value2"
PS C:\> $destinationFragment = "section-header-2"
PS C:\> New-AzFrontDoorRoutingRuleObject -Name $routingRuleName -FrontDoorName $frontDoorName -ResourceGroupName $rgname -FrontendEndpointName "frontendEndpoint1" -CustomHost $customHost -CustomPath $customPath -CustomQueryString $queryString -CustomFragment $destinationFragment
$customHost = "www.contoso.com"
$customPath = "/images/contoso.png"
$queryString = "field1=value1&field2=value2"
$destinationFragment = "section-header-2"
New-AzFrontDoorRoutingRuleObject -Name $routingRuleName -FrontDoorName $frontDoorName -ResourceGroupName $rgname -FrontendEndpointName "frontendEndpoint1" -CustomHost $customHost -CustomPath $customPath -CustomQueryString $queryString -CustomFragment $destinationFragment
```

```output
FrontendEndpointIds : {/subscriptions/{subid}/resourceGroups/{rgname}/pro
viders/Microsoft.Network/frontDoors/{frontdoorname}/FrontendEndpoints/frontendEndpoint1}
AcceptedProtocols : {Http, Https}
Expand Down
4 changes: 3 additions & 1 deletion src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngine.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ Use cmdlet "New-AzFrontDoorRulesEngineRule" to construct rules engine rules to p

### Example 1
```powershell
PS C:\> New-AzFrontDoorRulesEngine -ResourceGroupName $resourceGroupName -FrontDoorName $frontDoorName -Name myRulesEngine -Rule $rulesEngineRule1
New-AzFrontDoorRulesEngine -ResourceGroupName $resourceGroupName -FrontDoorName $frontDoorName -Name myRulesEngine -Rule $rulesEngineRule1
```

```output
Name RulesEngineRules
---- ----------------
myRulesEngine {rules1}
Expand Down
Loading