# Office365

### Configuring Azure AD

#### Step 1: Sign in to the Azure portal

* Navigate to the [Azure portal](https://portal.azure.com/).
* Sign in with your Azure account credentials.

#### Step 2: Register an Application

* In the left-hand navigation pane, click on "App registrations."

<div align="center" data-full-width="false"><figure><img src="/files/PtJLrC1hfMOA0vxWgGda" alt=""><figcaption></figcaption></figure></div>

* Click on "New registration" to create a new application.

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

Fill in the required information:

* **Name**: Give your application a meaningful name.
* **Supported account types**: Choose the appropriate option (e.g., "Accounts in this organizational directory only").
* Click on "Register" to create the application.

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

#### Step 3: Get the Application (Client) ID and Tenant ID

1. After registering the application, go to the "Overview" page.
2. Note down the "Application (client) ID" and "Directory (tenant) ID." The client ID is used for authentication, and the tenant ID is needed to identify the Azure AD directory.

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

#### Step 4: Generate a Client Secret

1. In the left-hand navigation pane, click on "Certificates & Secrets."
2. Under the "Client secrets" section, click on "New client secret."
3. Enter a description, choose the expiry period, and click "Add."
4. After creation, note down the secret value. This is your Client Secret. Copy it immediately, as it won't be visible again.

<figure><img src="/files/Exb1w2SIk9whBqkiGxBP" alt=""><figcaption><p>Value is the Client Secret</p></figcaption></figure>

#### Step 5: Configure Application Permissions for Microsoft Graph

* In the Azure portal, go to "App Registrations."
* Select the app you are configuring.
* Under "Manage," select "API permissions."
* Under "Configured permissions," select "Add a permission."
* Choose "Microsoft APIs" tab, then select "Microsoft Graph."
* Select "Application permissions."
* Expand the appropriate permission groups and select the checkboxes for the following permissions:
  * `Directory.AccessAsUser.All`
  * `Directory.ReadWrite.All`
  * `User.ReadWrite.All`
  * `UserAuthenticationMethod.ReadWrite.All`
* Select "Add permissions" and wait a few minutes before proceeding to the next step.

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

#### Granting Admin Consent

* Select "Grant admin consent for (your tenant name)."
* If not signed in with a Global Administrator account, sign in with an account in your Azure AD B2C tenant assigned at least the Cloud application administrator role.
* Select "Grant admin consent for (your tenant name)."
* Select "Refresh," and verify that "Granted for..." appears under Status. It may take a few minutes for the permissions to propagate.


---

# 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://authdocs.skill-mine.com/licentio-documentation/connectors/office365.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.
