@@ -13,6 +13,7 @@ Creates an application gateway.
13
13
14
14
## SYNTAX
15
15
16
+ ### IdentityByUserAssignedIdentityId (Default)
16
17
```
17
18
New-AzApplicationGateway -Name <String> -ResourceGroupName <String> -Location <String>
18
19
-Sku <PSApplicationGatewaySku> [-SslPolicy <PSApplicationGatewaySslPolicy>]
@@ -30,8 +31,30 @@ New-AzApplicationGateway -Name <String> -ResourceGroupName <String> -Location <S
30
31
[-RedirectConfigurations <PSApplicationGatewayRedirectConfiguration[]>]
31
32
[-WebApplicationFirewallConfiguration <PSApplicationGatewayWebApplicationFirewallConfiguration>]
32
33
[-AutoscaleConfiguration <PSApplicationGatewayAutoscaleConfiguration>] [-EnableHttp2] [-EnableFIPS]
33
- [-Zone <String[]>] [-Tag <Hashtable>] [-UserAssignedIdentityId <String>]
34
- [-Identity <PSManagedServiceIdentity>] [-Force] [-AsJob]
34
+ [-Zone <String[]>] [-Tag <Hashtable>] [-UserAssignedIdentityId <String>] [-Force] [-AsJob]
35
+ [-CustomErrorConfiguration <PSApplicationGatewayCustomError[]>] [-DefaultProfile <IAzureContextContainer>]
36
+ [-WhatIf] [-Confirm] [<CommonParameters>]
37
+ ```
38
+
39
+ ### IdentityByIdentityObject
40
+ ```
41
+ New-AzApplicationGateway -Name <String> -ResourceGroupName <String> -Location <String>
42
+ -Sku <PSApplicationGatewaySku> [-SslPolicy <PSApplicationGatewaySslPolicy>]
43
+ -GatewayIPConfigurations <PSApplicationGatewayIPConfiguration[]>
44
+ [-SslCertificates <PSApplicationGatewaySslCertificate[]>]
45
+ [-AuthenticationCertificates <PSApplicationGatewayAuthenticationCertificate[]>]
46
+ [-TrustedRootCertificate <PSApplicationGatewayTrustedRootCertificate[]>]
47
+ [-FrontendIPConfigurations <PSApplicationGatewayFrontendIPConfiguration[]>]
48
+ -FrontendPorts <PSApplicationGatewayFrontendPort[]> [-Probes <PSApplicationGatewayProbe[]>]
49
+ -BackendAddressPools <PSApplicationGatewayBackendAddressPool[]>
50
+ -BackendHttpSettingsCollection <PSApplicationGatewayBackendHttpSettings[]>
51
+ -HttpListeners <PSApplicationGatewayHttpListener[]> [-UrlPathMaps <PSApplicationGatewayUrlPathMap[]>]
52
+ -RequestRoutingRules <PSApplicationGatewayRequestRoutingRule[]>
53
+ [-RewriteRuleSet <PSApplicationGatewayRewriteRuleSet[]>]
54
+ [-RedirectConfigurations <PSApplicationGatewayRedirectConfiguration[]>]
55
+ [-WebApplicationFirewallConfiguration <PSApplicationGatewayWebApplicationFirewallConfiguration>]
56
+ [-AutoscaleConfiguration <PSApplicationGatewayAutoscaleConfiguration>] [-EnableHttp2] [-EnableFIPS]
57
+ [-Zone <String[]>] [-Tag <Hashtable>] -Identity <PSManagedServiceIdentity> [-Force] [-AsJob]
35
58
[-CustomErrorConfiguration <PSApplicationGatewayCustomError[]>] [-DefaultProfile <IAzureContextContainer>]
36
59
[-WhatIf] [-Confirm] [<CommonParameters>]
37
60
```
@@ -94,6 +117,28 @@ The eighth command creates a rule for the listener.
94
117
The ninth command sets the SKU.
95
118
The tenth command creates the gateway using the objects set by the previous commands.
96
119
120
+ ### Example 2: Create an application gateway with UserAssigned Identity
121
+ ```
122
+ PS C:\> $ResourceGroup = New-AzResourceGroup -Name "ResourceGroup01" -Location "West US" -Tag @{Name = "Department"; Value = "Marketing"}
123
+ PS C:\> $Subnet = New-AzVirtualNetworkSubnetConfig -Name "Subnet01" -AddressPrefix 10.0.0.0/24
124
+ PS C:\> $VNet = New-AzvirtualNetwork -Name "VNet01" -ResourceGroupName "ResourceGroup01" -Location "West US" -AddressPrefix 10.0.0.0/16 -Subnet $Subnet
125
+ PS C:\> $VNet = Get-AzvirtualNetwork -Name "VNet01" -ResourceGroupName "ResourceGroup01"
126
+ PS C:\> $Subnet = Get-AzVirtualNetworkSubnetConfig -Name $Subnet01 -VirtualNetwork $VNet
127
+ PS C:\> $GatewayIPconfig = New-AzApplicationGatewayIPConfiguration -Name "GatewayIp01" -Subnet $Subnet
128
+ PS C:\> $Pool = New-AzApplicationGatewayBackendAddressPool -Name "Pool01" -BackendIPAddresses 10.10.10.1, 10.10.10.2, 10.10.10.3
129
+ PS C:\> $PoolSetting = New-AzApplicationGatewayBackendHttpSettings -Name "PoolSetting01" -Port 80 -Protocol "Http" -CookieBasedAffinity "Disabled"
130
+ PS C:\> $FrontEndPort = New-AzApplicationGatewayFrontendPort -Name "FrontEndPort01" -Port 80
131
+ # Create a public IP address
132
+ PS C:\> $PublicIp = New-AzPublicIpAddress -ResourceGroupName "ResourceGroup01" -Name "PublicIpName01" -Location "West US" -AllocationMethod "Dynamic"
133
+ PS C:\> $FrontEndIpConfig = New-AzApplicationGatewayFrontendIPConfig -Name "FrontEndConfig01" -PublicIPAddress $PublicIp
134
+ PS C:\> $Listener = New-AzApplicationGatewayHttpListener -Name "ListenerName01" -Protocol "Http" -FrontendIpConfiguration $FrontEndIpConfig -FrontendPort $FrontEndPort
135
+ PS C:\> $Rule = New-AzApplicationGatewayRequestRoutingRule -Name "Rule01" -RuleType basic -BackendHttpSettings $PoolSetting -HttpListener $Listener -BackendAddressPool $Pool
136
+ PS C:\> $Sku = New-AzApplicationGatewaySku -Name "Standard_Small" -Tier Standard -Capacity 2
137
+ PS C:\> $Identity = New-AzUserAssignedIdentity -Name "Identity01" -ResourceGroupName "ResourceGroup01" -Location "West US"
138
+ PS C:\> $AppgwIdentity = New-AzApplicationGatewayIdentity -UserAssignedIdentity $Identity.Id
139
+ PS C:\> $Gateway = New-AzApplicationGateway -Name "AppGateway01" -ResourceGroupName "ResourceGroup01" -Location "West US" -Identity $AppgwIdentity -BackendAddressPools $Pool -BackendHttpSettingsCollection $PoolSetting -FrontendIpConfigurations $FrontEndIpConfig -GatewayIpConfigurations $GatewayIpConfig -FrontendPorts $FrontEndPort -HttpListeners $Listener -RequestRoutingRules $Rule -Sku $Sku
140
+ ```
141
+
97
142
## PARAMETERS
98
143
99
144
### -AsJob
@@ -311,10 +356,10 @@ Application Gateway Identity to be assigned to Application Gateway.
311
356
312
357
` ` ` yaml
313
358
Type : Microsoft.Azure.Commands.Network.Models.PSManagedServiceIdentity
314
- Parameter Sets : (All)
359
+ Parameter Sets : IdentityByIdentityObject
315
360
Aliases :
316
361
317
- Required : False
362
+ Required : True
318
363
Position : Named
319
364
Default value : None
320
365
Accept pipeline input : True (ByPropertyName)
@@ -522,7 +567,7 @@ ResourceId of the user assigned identity to be assigned to Application Gateway.
522
567
523
568
` ` ` yaml
524
569
Type : System.String
525
- Parameter Sets : (All)
570
+ Parameter Sets : IdentityByUserAssignedIdentityId
526
571
Aliases : UserAssignedIdentity
527
572
528
573
Required : False
0 commit comments