# Microsoft Excel

## Supported Targets

With the Microsoft app, you copy the contents of a Snowflake table/view into an Excel Sheet hosted on a Sharepoint online site.

{% hint style="info" %}
Your Excel Sheet **must** reside in a Sharepoint (Office365) site. The Microsoft Graph API has limitations when modifying a sheet directly in OneDrive.
{% endhint %}

## Authentication methods

### Enterprise Application

This Connection uses your own Azure client credentials to authorize access, and is the most secure method since your own OAuth credentials are used. You will need the following details from the Azure AD (Entra ID) app registration to authenticate in Omnata:

1. **Application (client) ID**
2. **Directory (tenant) ID**
3. **Client Secret**

#### Steps to create an application

To create a new **App Registration** in Microsoft 365:

1. Go to the **Azure Portal**: <https://portal.azure.com>
2. Search for **"App registrations"** in the top search bar (or find **"Azure Active Directory"** / **"Microsoft Entra ID"** in the left sidebar, then click **"App registrations"**)
3. Click **"+ New registration"** at the top
4. Fill in the registration form:
   * **Name**: Give your app a descriptive name (e.g., "Omnata Sync")
   * **Supported account types**: Usually choose "Accounts in this organizational directory only" (single tenant)
   * **Redirect URI** (optional): Can leave blank for now or add if required by your connector
     * You can build the redirect URI for your account by running this query: \
       `select 'https://'||get(parse_json(SYSTEM$allowlist()),0):"host"::varchar||'/oauth/complete-secret' as REDIRECT_URL;`
5. Click **"Register"**
6. You'll be taken to the app's overview page where you'll immediately see:
   * **Application (client) ID** - copy this, you'll need it for your connector configuration
   * **Directory (tenant) ID** - also copy this
7. Go to **"Certificates & secrets"** in the left menu
   * Click **"+ New client secret"**
   * Add a description and set expiration
   * Copy the **Value** immediately (it won't be shown again)

#### Configure permissions

In Azure Portal → Entra ID → App Registrations → select your app → **API permissions**:

1. Click **+ Add a permission**
2. Select **Microsoft Graph** (not "SharePoint" — these permissions are accessed via the Graph API)
3. Select **Application permissions** (not Delegated)
4. Search for and add the permissions relevant to your sync direction:
   * **Inbound syncs only:** `Sites.Read.All`, `Files.Read.All`
   * **Outbound syncs (or both):** `Sites.ReadWrite.All`, `Files.ReadWrite.All`
5. Click **Add permissions**
6. Click **Grant admin consent for \[your tenant]** — a Global Admin or Privileged Role Admin must do this. The Status column should show a green checkmark.

> **Note on tenant-wide scope:**  Microsoft Graph application permissions apply across your entire tenant by design. Without this, the connector cannot traverse the full SharePoint site and folder hierarchy required for syncs. Omnata does not handle or access any data without explicit configuration in Snowflake.

Ref docs:

* [Resolve Microsoft Graph authorization errors - Microsoft Graph](https://learn.microsoft.com/en-us/graph/resolve-auth-errors)
* [Microsoft Graph permissions reference - Microsoft Graph](https://learn.microsoft.com/en-us/graph/permissions-reference)
* [Grant tenant-wide admin consent to an application - Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/grant-admin-consent)

## Inbound Syncs

Inbound syncs can be run in two modes:

#### Single file mode

For a single inbound sync, one spreadsheet file is selected and multiple sheets can be included in the sync as streams. You can optionally choose to automatically add newly created sheets as new streams.&#x20;

Sheets need to be structured like a database table. The top row are the headers with data below, with no merged cells or blank space.

#### Multi-file mode

For a single inbound sync, you nominate a parent folder and a naming pattern; each file matching the pattern will be included in the sync as a stream. You can choose to automatically add new files matching the naming pattern as new streams.&#x20;

### Supported Sync Strategies

* Full Refresh with merged changes or keep history.

## Outbound Syncs

### Supported Targets

You can copy the contents of a Snowflake table/view into an Excel sheet.

### Supported Sync Strategies

* Replace (a full replacement of sheet contents)

<br>
