# Application Gateway Integration

An application gateway with a firewall would be a very good addition to this setup. This will boost the security and provide additional configuration on the network side. It would also help you to monitor the traffic and block unwanted traffic.

Please follow the steps below to integrate Application Gateway.

1. Search for 'Application Gateway' in Azure Marketplace and click on **Create.**

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2Fu7KWeH6mLI4ElwwM5FjH%2F1.png?alt=media&#x26;token=09e0a1fd-2e7a-4664-b52b-7cfb4a8e219f" alt=""><figcaption><p>Click 'Create'</p></figcaption></figure>

2. Select the Resource Group, Region and VNet same as the Inforiver app service, and select all other options as per your need and recommendations.&#x20;

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2Fz0KyA5wlcTXYl6h0UGD8%2F2.png?alt=media&#x26;token=c3862d6f-e141-4ed7-b1ca-9e773ab7819b" alt=""><figcaption><p>Create new application gateway</p></figcaption></figure>

3. We need to create a new subnet for this gateway—click on **Manage subnet configuration**.

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2FsVzbQUOQo0S6mEcwPeEe%2F3.png?alt=media&#x26;token=4c7a8449-9530-486e-9400-3e95082fdf48" alt=""><figcaption><p>Create new subnet</p></figcaption></figure>

4. Proceed to create a new subnet called 'appgateway', leaving the address range as prefilled, and then click **Add**.

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2F6yXLX0A2CUs1gTD2z7es%2F4.png?alt=media&#x26;token=39b785f0-105f-4a0c-936d-d194de150718" alt=""><figcaption><p>Add a subnet</p></figcaption></figure>

5. Carefully go back to the ‘Create application gateway’ step without losing any progress and select the newly created subnet and proceed to the next step.

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2Fc8JDbffwoAKMlprNgURw%2F5.png?alt=media&#x26;token=4cd8298a-ee02-4515-bdaa-606367c05a9e" alt=""><figcaption><p>Select the added subnet</p></figcaption></figure>

6. Create a new public IP address and proceed to the next step.

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2FBGGFWbvtVW6fsyqovnDq%2F6.png?alt=media&#x26;token=9334ce92-3b59-4f69-83c9-636fbfb811b6" alt=""><figcaption><p>Create a new public IP address</p></figcaption></figure>

7. Click on **Add a backend pool** and select the Inforiver app service as a backend target.&#x20;

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2FHIKDwUWnyjrHMFTDMfIw%2F7.png?alt=media&#x26;token=6833e4f7-7a8a-4497-8f3c-7468f8d88a33" alt=""><figcaption><p>Add a backend pool</p></figcaption></figure>

8. In this step, we need to add the routing information for the gateway. Fill in the listener information as shown in the screenshot, and then either get the SSL certificate from Key Vault or upload a PFX certificate directly here. In this example, we are adding a certificate from Key Vault.

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2FTYo7RFcyGGIwNA5vBuU2%2F8.png?alt=media&#x26;token=2151f1fb-008a-478f-8233-354420b9ab3e" alt=""><figcaption><p>Listener information</p></figcaption></figure>

9. Go to the 'Backend targets' and select the already created target, then add a new backend setting.

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2FV8G6mLBwJoXgDRJPtGEK%2F9.png?alt=media&#x26;token=0cc140be-2a39-48e6-965f-2cd4ad2dd6de" alt=""><figcaption><p>Add Backend target setting</p></figcaption></figure>

10. Fill the backend setting as shown in the screenshot, and add the setting.

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2FEOZmYubI4jhY8Ga7kV5F%2F10.png?alt=media&#x26;token=fe6a4512-74d6-4027-86ba-51edf713f3a3" alt=""><figcaption><p>Add Backend setting</p></figcaption></figure>

11. Click on **Add** to add the routing information.

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2FZDcWf2B5EdZy122HHGu0%2F11.png?alt=media&#x26;token=e2a90ea8-e190-4e78-afb7-caa16d7c8715" alt=""><figcaption><p>Add routing rule</p></figcaption></figure>

12. Now the configuration part is complete. You may proceed to review and create the resource.

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2FBb3bPpsnmukHrl2AqmpN%2F12.png?alt=media&#x26;token=f50613d9-efff-4ae8-942e-1df44beb4e81" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2F6NiKnLfdaOCIJMWCrWcH%2F13.png?alt=media&#x26;token=79b5aeb3-0e5c-4d9e-8c63-b5d598cb98e6" alt=""><figcaption><p>Create application gateway</p></figcaption></figure>

13. You may use the public IP address from the Overview page and configure an A record at your DNS server or hosting provider. In this example, we have shown GoDaddy DNS.
14. Finally, we need to whitelist the application gateway at our app service for unrestricted communication. For this, go to the 'Networking' page of the app service and click on ‘Access restriction.’

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2FoosmirKzgvOBOk0gwAOM%2Fappgateway2.png?alt=media&#x26;token=cc9a1b2b-5ba1-4922-9c91-fd09fff54700" alt=""><figcaption></figcaption></figure>

15. Add a new rule in the app service tab and select the gateway subnet to be whitelisted.
16. Verify that the endpoint status is 'Enabled'.
17. Go to the ‘Backend health’ page in the gateway and make sure you are getting ‘Healthy’ status.
18. The gateway integration part is now complete, and your app service is now fully private, and the inbound traffic can only be allowed through this gateway. You may now choose to have this gateway converted into a Web Application Firewall with a few toggles as shown below.

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2FF8PxNdYn6r9FoL1Z82BM%2Fappgateway3.png?alt=media&#x26;token=8581cb8b-0d69-48a2-b4df-b722567df469" alt=""><figcaption><p>Web application firewall</p></figcaption></figure>

#### Note: While setting up Web Application Firewall (WAF) support, you must consider the following things:

#### 1. Browser Compatibility

Below are the compatible versions for the following browsers:

| Browser | Minimum Version Required |
| ------- | ------------------------ |
| Chrome  | 80                       |
| Edge    | 80                       |
| Firefox | 113                      |
| Opera   | 67                       |
| Safari  | 16.4                     |

#### 2. APIs to be added to the exclusion list

The following APIs should be added to the exception list in an on-premises environment for WAF:

1. /redirect
2. /external-storage/redirect
3. /rls/redirect

The rest can be removed.

#### 3. Configuring WAF to Allow Large Payloads

To ensure that WAF does not block payloads larger than 2 MB, uncheck the **Enforce maximum request body limit** checkbox in the Azure portal gateway configuration.

<figure><img src="https://4102771481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftn9fmavAcyzaE7MAMP2U%2Fuploads%2FG1UkzvLOxBaMTll7Oq2g%2Fimage.png?alt=media&#x26;token=79fa4f1d-d6b5-4793-b22d-e57b80be4cce" alt="" width="563"><figcaption></figcaption></figure>
