# Create App Registration

This document describes how to create an app registration for use in a machine workflow for reading messages in a mailbox.

## Create App Registration

* Navigate to <https://portal.azure.com/>
* Search for App Registrations

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-Mk1qY27wFwDOyb2_Sz_%2F-Mk2AoiMM3RdB1H51zgy%2Fapp-reg-search.png?alt=media&#x26;token=dfa4f476-e56d-45fe-990e-e202f76d7d5e" alt=""></div>

* Click on "New registration"

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-Mk1qY27wFwDOyb2_Sz_%2F-Mk2B6lO3QhDYq69C3gj%2Fapp-reg-new.png?alt=media&#x26;token=32fd081f-53d0-4b6d-8867-17ee63c9a652" alt=""></div>

* Enter an application name and select an account type and click on "Register". No Redirect URI is needed in this case.

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-Mk1qY27wFwDOyb2_Sz_%2F-Mk2Ba6K4tvX4CErx6jk%2Fapp-reg-register.png?alt=media&#x26;token=e97223fe-0a9c-48ea-b30f-a76d174e46d1" alt=""></div>

* After the new registration has been saved, navigate to "Certificates & secrets" and click on "New client secret"

![](https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-Mk1qY27wFwDOyb2_Sz_%2F-Mk2F0F4DgMjzuGA5gVq%2Fapp-reg-new-client-secret.png?alt=media\&token=232b3699-7461-4925-b92a-53c76df75301)

* Enter a name of the client secret and set an expiration, click "Add"

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-Mk2F8Mv_erMSpEwV4q_%2F-Mk2FoXfViRj0wudu0E9%2Fapp-reg-add-client-secret.png?alt=media&#x26;token=68af695f-20d0-4c91-90ea-6b299b7b40a6" alt=""></div>

* Copy the client secret value for later use in Flow Studio

{% hint style="warning" %}
Make sure to copy the value of the new secret, it can't be read after the leaving the page
{% endhint %}

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-Mk2F8Mv_erMSpEwV4q_%2F-Mk2GZbBbZOEEyqpjLAX%2Fapp-reg-client-secret-value.png?alt=media&#x26;token=5912c186-447a-45a0-a0ee-cc31368be397" alt=""></div>

* Get the Client ID from the overview

![](https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-MkkFkPNjF5wNAuDVPDf%2F-MkkHRBWEdLy-1xvEnIF%2Fapp-reg-overview-client-id.png?alt=media\&token=4614aa98-3330-4dc9-a419-637086b272cd)

* Both Client ID and Client Secret are needed for the REST configuration in Flow

###

### Set Permissions

This document describes how to set up read and write permissions for mailboxes.

{% hint style="info" %}
Depending on the needs for the app registration you will add different permissions. Read more about all available permissions for Microsoft Graph at <https://docs.microsoft.com/en-us/graph/permissions-reference>
{% endhint %}

* Create permissions by navigating to "API permissions" and select "Add a permission"

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-Mk2F8Mv_erMSpEwV4q_%2F-Mk2INx7zXAvBE_1o81I%2Fapp-reg-api-permissions.png?alt=media&#x26;token=073c5479-90a5-4634-9697-fa11ea1421d4" alt=""></div>

* Select Microsoft Graph

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-Mk2F8Mv_erMSpEwV4q_%2F-Mk2Ife6C95vT-cMsK2i%2Fapp-reg-api-permissions-add-1.png?alt=media&#x26;token=52b07bb8-1cc7-4226-89ce-5bd318ce372a" alt=""></div>

* Select Application permissions

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-Mk2F8Mv_erMSpEwV4q_%2F-Mk2IsTHgvAICu0UPfOq%2Fapp-reg-api-permissions-add-2.png?alt=media&#x26;token=9c2d7c6b-852e-4430-85d6-fdbbacb5ef82" alt=""></div>

* Search for "mail" and select "Mail.ReadWrite"

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-Mk2F8Mv_erMSpEwV4q_%2F-Mk2JCyfhosoSzfDId7C%2Fapp-reg-api-permissions-add-3.png?alt=media&#x26;token=1c3a034d-e977-4b0f-9e06-58746fa2d069" alt=""></div>

* Select "Grant admin consent" to approve permissions

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-Mk2F8Mv_erMSpEwV4q_%2F-Mk2KU7KXVZSO3Hl2mxF%2Fapp-reg-api-permissions-add-4.png?alt=media&#x26;token=d25f1f52-86ac-4724-8db0-e5d7184a8264" alt=""></div>

{% hint style="warning" %}
After the app registration is done and the permissions are set it is possible to read all mailboxes in the directory. Read more on how to [Limit Permissions to a Specific Mailbox](https://docs.novacura.com/extensibility-and-integration/products/active-directory/microsoft-graph/how-to-guides/limit-permissions-to-a-specific-mailbox)
{% endhint %}

## Flow configuration

* Navigate to the Graph REST connector in Flow Studio.&#x20;
* Open Global parameters and select the dots (...) in Edit parameters
* Enter the values for Client ID and Client Secret from your new app registration
* Click Save in the Global parameters dialog box&#x20;
* Save the new REST configuration

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MjcNODv1kQRDGTj76t9%2F-Mk2LKWBllbg7az62vLG%2F-Mk2OWQ7_FQiBNgBBwVi%2Fgraph-rest-connctor-edited.png?alt=media&#x26;token=7c5b615d-e5e0-4ebe-9f96-07e32d756b5e" alt=""></div>


---

# 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.novacura.com/extensibility-and-integration/products/active-directory/microsoft-graph/how-to-guides/create-app-registration.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.
