Skip to content

Commit 0b07fc8

Browse files
authored
Merge pull request #77694 from vhorne/ag-cr-sample
Add the custom rules sample
2 parents edea33d + 81317d1 commit 0b07fc8

File tree

4 files changed

+76
-15
lines changed

4 files changed

+76
-15
lines changed
Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
---
2-
title: Azure Application Gateway PowerShell Samples | Microsoft Docs
2+
title: Azure Application Gateway PowerShell Samples
33
description: Azure Application Gateway PowerShell Samples
44
services: application-gateway
5-
documentationcenter: networking
65
author: vhorne
7-
manager: jpconnock
8-
editor: tysonn
9-
tags: azure-resource-manager
10-
116
ms.service: application-gateway
127
ms.topic: article
13-
ms.tgt_pltfrm: vm-windows
14-
ms.workload: infrastructure
15-
ms.date: 01/29/2018
8+
ms.date: 6/7/2019
169
ms.author: victorh
17-
ms.custom: mvc
1810
---
1911
# Azure Application Gateway PowerShell samples
2012

2113
The following table includes links to Azure PowerShell script samples that create application gateways.
2214

2315
| | |
2416
|---|---|
25-
| [Manage web traffic](./scripts/create-vmss-powershell.md) | Creates an application gateway and all related resources.|
26-
| [Restrict web traffic](./scripts/create-vmss-waf-powershell.md) | Creates an application gateway that restricts traffic using OWASP rules.|
27-
| | |
28-
17+
| [Manage web traffic](./scripts/create-vmss-powershell.md) | Creates an Application Gateway and all related resources.|
18+
| [Restrict web traffic](./scripts/create-vmss-waf-powershell.md) | Creates an Application Gateway that restricts traffic using OWASP rules.|
19+
|[WAF custom rules](scripts/waf-custom-rules-powershell.md)|Creates an Application Gateway Web Application Firewall with custom rules.
20+
| | |
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
title: Azure PowerShell Script Sample - Create WAF custom rules
3+
description: Azure PowerShell Script Sample - Create Web Application Firewall custom rules
4+
author: vhorne
5+
ms.service: application-gateway
6+
ms.topic: sample
7+
ms.date: 6/7/2019
8+
ms.author: victorh
9+
---
10+
11+
# Create WAF custom rules with Azure PowerShell
12+
13+
This script creates an Application Gateway Web Application Firewall that uses custom rules. The custom rule blocks traffic if the request header contains User-Agent *evilbot*.
14+
15+
## Prerequisites
16+
17+
### Azure PowerShell module
18+
19+
If you choose to install and use Azure PowerShell locally, this script requires the Azure PowerShell module version 2.1.0 or later.
20+
21+
1. To find the version, run `Get-Module -ListAvailable Az`. If you need to upgrade, see [Install Azure PowerShell module](/powershell/azure/install-az-ps).
22+
2. To create a connection with Azure, run `Connect-AzAccount`.
23+
24+
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
25+
26+
## Sample script
27+
28+
[!code-powershell[main](../../../powershell_scripts/application-gateway/waf-rules/waf-custom-rules.ps1 "Custom WAF rules")]
29+
30+
## Clean up deployment
31+
32+
Run the following command to remove the resource group, application gateway, and all related resources.
33+
34+
```powershell
35+
Remove-AzResourceGroup -Name CustomRulesTest
36+
```
37+
38+
## Script explanation
39+
40+
This script uses the following commands to create the deployment. Each item in the table links to command specific documentation.
41+
42+
| Command | Notes |
43+
|---|---|
44+
| [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup) | Creates a resource group in which all resources are stored. |
45+
| [New-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/new-azvirtualnetworksubnetconfig) | Creates the subnet configuration. |
46+
| [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork) | Creates the virtual network using with the subnet configurations. |
47+
| [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress) | Creates the public IP address for the application gateway. |
48+
| [New-AzApplicationGatewayIPConfiguration](/powershell/module/az.network/new-azapplicationgatewayipconfiguration) | Creates the configuration that associates a subnet with the application gateway. |
49+
| [New-AzApplicationGatewayFrontendIPConfig](/powershell/module/az.network/new-azapplicationgatewayfrontendipconfig) | Creates the configuration that assigns a public IP address to the application gateway. |
50+
| [New-AzApplicationGatewayFrontendPort](/powershell/module/az.network/new-azapplicationgatewayfrontendport) | Assigns a port to be used to access the application gateway. |
51+
| [New-AzApplicationGatewayBackendAddressPool](/powershell/module/az.network/new-azapplicationgatewaybackendaddresspool) | Creates a backend pool for an application gateway. |
52+
| [New-AzApplicationGatewayBackendHttpSettings](/powershell/module/az.network/new-azapplicationgatewaybackendhttpsetting) | Configures settings for a backend pool. |
53+
| [New-AzApplicationGatewayHttpListener](/powershell/module/az.network/new-azapplicationgatewayhttplistener) | Creates a listener. |
54+
| [New-AzApplicationGatewayRequestRoutingRule](/powershell/module/az.network/new-azapplicationgatewayrequestroutingrule) | Creates a routing rule. |
55+
| [New-AzApplicationGatewaySku](/powershell/module/az.network/new-azapplicationgatewaysku) | Specify the tier and capacity for an application gateway. |
56+
| [New-AzApplicationGateway](/powershell/module/az.network/new-azapplicationgateway) | Create an application gateway. |
57+
|[Remove-AzResourceGroup](/powershell/module/az.resources/remove-azresourcegroup) | Removes a resource group and all resources contained within. |
58+
|[New-AzApplicationGatewayAutoscaleConfiguration](/powershell/module/az.network/New-AzApplicationGatewayAutoscaleConfiguration)|Creates an autoscale configuration for the Application Gateway.|
59+
|[New-AzApplicationGatewayFirewallMatchVariable](/powershell/module/az.network/New-AzApplicationGatewayFirewallMatchVariable)|Creates a match variable for firewall condition.|
60+
|[New-AzApplicationGatewayFirewallCondition](/powershell/module/az.network/New-AzApplicationGatewayFirewallCondition)|Creates a match condition for custom rule.|
61+
|[New-AzApplicationGatewayFirewallCustomRule](/powershell/module/az.network/New-AzApplicationGatewayFirewallCustomRule)|Creates a new custom rule for the application gateway firewall policy.|
62+
|[New-AzApplicationGatewayFirewallPolicy](/powershell/module/az.network/New-AzApplicationGatewayFirewallPolicy)|Creates a application gateway firewall policy.|
63+
|[New-AzApplicationGatewayWebApplicationFirewallConfiguration](/powershell/module/az.network/New-AzApplicationGatewayWebApplicationFirewallConfiguration)|Creates a WAF configuration for an application gateway.|
64+
65+
## Next steps
66+
67+
- For more information about WAF custom rules, see [Custom rules for Web Application Firewall](../custom-waf-rules-overview.md)
68+
- For more information on the Azure PowerShell module, see [Azure PowerShell documentation](/powershell/azure/overview).
69+
- Additional application gateway PowerShell script samples can be found in the [Azure Application Gateway documentation](../powershell-samples.md).

articles/iot-hub/iot-hub-how-to-order-connection-state-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ In this section, you configure your IoT Hub to publish events as they occur.
267267

268268
6. For **Endpoint Details**, select Endpoint Type as **Web Hook** and click on select endpoint and paste the URL that you copied from your logic app and confirm selection.
269269

270-
![Select endpoint url](./media/iot-hub-how-to-order-connection-state-events/endpoint-url.png)
270+
![Select endpoint url](./media/iot-hub-how-to-order-connection-state-events/endpoint-select.png)
271271

272272
7. The form should now look similar to the following example:
273273

0 commit comments

Comments
 (0)