> For the complete documentation index, see [llms.txt](https://docs.pixiebrix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pixiebrix.com/integrations/microsoft/connect-to-custom-azure-applications-apis.md).

# Connect to Custom Azure Applications/APIs

{% hint style="info" %}
This guide covers authenticating with custom Azure Applications/APIs. You will need your Azure and PixieBrix Administrator to assist with the instructions in this guide.
{% endhint %}

## Create/Register an Azure Application

{% hint style="info" %}
📚 Azure documentation to [Register an Application](https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app) and [Register an application with the Microsoft identity platform](https://learn.microsoft.com/en-us/graph/auth-register-app-v2)
{% endhint %}

1. Visit the Enterprise Applications page
2. Click New application<br>

   <figure><img src="/files/VjYPgTjV9BBuUCfSCr6T" alt="" width="464"><figcaption></figcaption></figure>
3. Click Create your own application<br>

   <figure><img src="/files/TFyk3MOnIBf8SnbDJkD2" alt="" width="548"><figcaption></figcaption></figure>
4. Provide a name for your application and click “Create”<br>

   <figure><img src="/files/RFVvqrki8z1Og1KB1EDu" alt="" width="428"><figcaption></figcaption></figure>

### Assign Users and Groups

1. Assign one or more users/groups to the application for them to access the application<br>

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

### Configure the Application Registration

1. Open the Application Registration for your application. To locate it from the Omnibar, search for the name and select the “Application” entry<br>

   <figure><img src="/files/sxbGOqDu9uo6JyLCWsTl" alt=""><figcaption></figcaption></figure>
2. Open the Authentication settings<br>

   <figure><img src="/files/GZbL938U1kalpr6maJMT" alt=""><figcaption></figcaption></figure>
3. Click “Add a platform”<br>

   <figure><img src="/files/CekTDbq0g4e10Q82TWAW" alt=""><figcaption></figcaption></figure>
4. Choose Single-page Application<br>

   <figure><img src="/files/w2WoGfUqNhVy3ehs6swh" alt=""><figcaption></figcaption></figure>
5. Provide the following Custom Redirect URL. (The `[chromiumapp.org](<http://chromiumapp.org>)` origin is a special origin that the Chrome Web Browser uses client OAuth2 flow redirects.)

   ```
   <https://mpjjildhmpddojocokjkgmlkkkfjnepo.chromiumapp.org/oauth2>
   ```

### Configure API Permissions

1. Select Manage > API Permissions<br>

   <figure><img src="/files/rrHOeAccaTMDBn8E5Lfb" alt=""><figcaption></figcaption></figure>
2. Add some base permissions. To allow sign in, select “Microsoft Graph” and choose the Open ID permissions:<br>

   <figure><img src="/files/7xtNZn5NjUFmItBqrx6s" alt=""><figcaption></figcaption></figure>

### Record the Application and Directory ID

* Return to the Overview page for the application you created<br>

  <figure><img src="/files/VHy8YzTFFmJd4XFCVNye" alt=""><figcaption></figcaption></figure>
* Record the Application (client id) and Directory (tenant) ID for use with PixieBrix<br>

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

## Configure the PixieBrix Microsoft Azure Integration

{% hint style="info" %}
To complete these steps for your team, you must be an Admin on your PixieBrix team. Alternatively, for development & testing, you may configure the integration in the Extension Console
{% endhint %}

1. From the Integrations section in the Admin or Extension Console, click the + Add Integration button in the top right corner.<br>

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>To set up a cloud integration that your team can access, head to the <a href="https://app.pixiebrix.com/">Admin Console</a>. <em>(If you'd rather set up something locally, use the Extension Console. Learn more about</em> <a data-mention href="/pages/Q14JsHCHLsA7B2x85iTZ">/pages/Q14JsHCHLsA7B2x85iTZ</a>.<em>)</em></p></div>

2. Search for and select the Microsoft Azure integration.

3. Provide the following information for the Application
   * Pushdown (read-only): the integration configuration will be pushed to your team members. They will each authenticate individually with the application
   * Application (client) ID: from the Application Registration Overview
   * Directory (tenant) ID: from the Application Registration Overview
   * Scope:
     * See the individual brick documentation (e.g. xxx and [Lookup Microsoft Workbook Sheets](https://www.pixiebrix.com/marketplace/93ca83df-fb4f-4b0b-9183-47c6d8ffcf26/))
     * You likely also want to set the [offline\_access](https://learn.microsoft.com/en-us/graph/permissions-reference#offline_access) scope, which will fetch a refresh token and reduce the number of times you need to re-authenticate
     * See the [Microsoft Graph permissions reference](https://learn.microsoft.com/en-us/graph/permissions-reference) for all available scope names<br>

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

## Testing the Integration Configuration in a Mod

1. Create a new Mod in the Page Editor, e.g., a Trigger
2. Add an HTTP Request Brick
3. Configure the brick:
   1. URL: [`https://graph.microsoft.com/v1.0/me`](https://graph.microsoft.com/v1.0/me)
   2. Integration Configuration: select the Integration Configuration you configured in the previous section
   3. Method: get<br>

      <figure><img src="/files/aprdQ1HgpT3Y4WnP4t1i" alt=""><figcaption></figcaption></figure>
4. Run the Mod
5. Your browser will open the OAuth2 authentication flow
6. After you authenticate, the Output Panel will show your user’s profile information:<br>

   <figure><img src="/files/4G69Ln2l8cI9LwTNlTqN" alt=""><figcaption></figcaption></figure>


---

# 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://docs.pixiebrix.com/integrations/microsoft/connect-to-custom-azure-applications-apis.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.
