> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/pentests/configure-a-pentest/domain-verification/azure-apim.md).

# Azure API Management domain verification

To verify a domain hosted on Azure API Management (APIM), typically on `azure-api.net`, for a pentest, complete the steps below.

APIM does not let you upload static files directly, so instead of hosting an `aikido.txt` file you configure an inbound policy that returns the verification token when Aikido requests `/aikido.txt`.

{% stepper %}
{% step %}
**Start the verification process**

Go to the final step of the pentest onboarding flow, where you can configure domain verification.
{% endstep %}

{% step %}
**Click verify**

Find your Azure APIM domain and click Verify. This starts the file upload verification flow.
{% endstep %}

{% step %}
**Copy the verification code**

Copy the verification code shown in Aikido. You will paste this code into the APIM policy in the next step.
{% endstep %}

{% step %}
**Add an inbound policy to your API**

In the Azure portal, open your API Management instance, go to **APIs**, select the API that serves the domain you want to verify, and open the **Design** tab. In the **Inbound processing** section, click the code editor (`</>`) and replace the policy with the snippet below.

Replace `AIKIDO_DOMAIN_VALIDATION_TOKEN_HERE` with the verification code you copied from Aikido.

```xml
<policies>
  <inbound>
    <base />
    <choose>
      <when condition="@(context.Request.OriginalUrl.Path == "/aikido.txt")">
        <return-response>
          <set-status code="200" reason="OK" />
          <set-header name="Content-Type" exists-action="override">
            <value>text/plain</value>
          </set-header>
          <set-body>AIKIDO_DOMAIN_VALIDATION_TOKEN_HERE</set-body>
        </return-response>
      </when>
    </choose>
  </inbound>
  <backend>
    <base />
  </backend>
  <outbound>
    <base />
  </outbound>
</policies>
```

Save the policy so it takes effect.
{% endstep %}

{% step %}
**Successful validation**

If the validation succeeds, you will see a confirmation toast in Aikido. You can then remove the `<when>` block from the policy if you no longer need it.
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/pentests/configure-a-pentest/domain-verification/azure-apim.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
