# Setup service account for O365 Excel

Here are the steps to create a Microsoft service account for use with Office 365 in Smaply.

### Step 1: Register an App in Azure

1. Go to the [Azure Portal](https://portal.azure.com/) and navigate to **App Registrations**.
2. Click **New registration**.<br>

   <figure><img src="/files/MSc8dSMyyqb6Egk4hDjm" alt=""><figcaption></figcaption></figure>
3. Set **Supported Account Types** to:
   * **Accounts in this organizational directory only** (Single tenant).

### Step 2: Find Your Registered App

1. Search for the app you created in Step 1.

### Step 3: Create a Client Secret

1. Navigate to **Certificates & Secrets**.
2. Under **Client Secrets**, click **+ New client secret**.<br>

   <figure><img src="/files/cBKWNxZW57sB7dhshijo" alt=""><figcaption></figcaption></figure>
3. Copy and save the generated **Client Secret** securely. You will need it later.<br>

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

### Step 4: Set API Permissions

1. Go to **API Permissions** > **Add a permission**.
2. Choose **Microsoft Graph**.
3. Under **Application permissions**, add `Files.Read.All`.<br>

   <figure><img src="/files/OmXnpyqYbNDbtuVX6Nn2" alt=""><figcaption></figcaption></figure>
4. Click **Grant admin consent for Default Directory**.\
   \
   ![](/files/R8jGsOom8O03nszmDMjH)

### Required Information for Smaply Integration

You will need the following details to configure the integration:

* (A) Client ID
* (B) Tenant ID
* (C) Client Secret \ <br>

  <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcb3LtCdHvsMurC6VYkgBJUzDJyyPwm_rrMCkInvCzi3dy1nLZmXuMELVULI7HorHbMLcWthKK4wDgoxX_18TqIC46r8GjDYhWJLfiVMcy--cPR7QIMkPAsdDDLp7PRf2J7_Z5__Q?key=QblDC7Y9WvcIuF07GXei4lyL" alt=""><figcaption></figcaption></figure>

**🚀 Congratulations! You have successfully set up a service account for Office 365.**

**Now! Go to Smaply Integration Configuration**

### **Troubleshooting**

* **Ensure you have set up the Client Secret and API Permissions correctly in Azure.**
* **Verify that you have granted admin consent for Microsoft Graph permissions.**


---

# 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://helpdesk.smaply.app/integrations/metrics-tools/office-365-excel/configuring-the-office-365-excel-integration/setup-service-account-for-o365-excel.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.
