# Connect Akto with Azure App Services

<figure><img src="/files/AL60oWdlRpLcrBxFR3rx" alt=""><figcaption></figcaption></figure>

## Introduction

Learn about how to send API traffic data from Azure App Services Web App to Akto.

<figure><img src="/files/uTIe8pzHMgSy2yDSC2Cb" alt=""><figcaption></figcaption></figure>

## Prerequisites

1. Your Web App should have sidecar support enabled at the time of creation.

   <figure><img src="/files/PHesr5E5ntPV96Yi9tOE" alt="Sidecar Enabled"><figcaption></figcaption></figure>

## Adding Akto traffic collector to Azure App Services Web App

1. Open Azure Portal and click on App Services in the left navbar.

   <figure><img src="/files/RPzhbZVFKX7rPvdF0q4e" alt="App Services"><figcaption></figcaption></figure>
2. Click on the web app for which you want to setup traffic mirroring.
3. Click on Environment Variables under the Settings tab in left navbar.

   <figure><img src="/files/4h6IWCQAkmW3VZSsoqXB" alt="Environment Variables"><figcaption></figcaption></figure>
4. Add the following env variables.

```bash
AKTO_INFRA_MIRRORING_MODE=gcp
AKTO_KAFKA_BROKER_MAL=<Akto_Runtime_Load_Balancer_DNS> // modify this value with Akto Runtime Load Balancer DNS
AKTO_MONGO_CONN=mongodb://0.0.0.0:27017
AKTO_TRAFFIC_BATCH_SIZE=100
AKTO_TRAFFIC_BATCH_TIME_SECS=10
```

Click on Apply for the changes to be reflected.

5. Go to your web app, and click on Deployment Center under the Deployment tab in left navbar.

   <figure><img src="/files/b8Pr1p73yAjnfDxh4bWk" alt="Deployment Center"><figcaption></figcaption></figure>
6. Click on Add button, and add the akto traffic mirroring sidecar.

   <figure><img src="/files/fEyL6CX9UGLyDtUhySuY" alt="Add Container"><figcaption></figcaption></figure>
7. Enter the following values to spawn a new Akto mirroring container

```bash
Name -> mirroring
Image source -> Docker Hub or other registeries
Image Type -> Public
Registry server URL -> index.docker.io
Image and tag -> aktosecurity/mirror-api-logging:k8s_agent
Port -> 90
```

<figure><img src="/files/bCTn1nY8JqbTEza0WCCK" alt="Mirroring Container"><figcaption></figcaption></figure>

8. Click on Apply, and traffic should start population in a couple of minutes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akto.io/traffic-connector/azure-services/azure-app-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
