Skip to main content
Outlook and Microsoft 365 mailboxes connect through an app registration in your own Microsoft 365 tenant. You register it once and every Outlook inbox in your organization connects through it, for the CRM and for the help desk.

Before you start

  • You sign in to Azure as someone in the mailbox’s own Microsoft 365 tenant who may register apps. In most tenants everyone may; if Microsoft says you lack permission, ask your Microsoft 365 admin.
  • You are an admin in Hiveku, so you can add the app in Settings > OAuth Apps.
It takes about 5 minutes, and every step can run from the command line.

Register the app

With the Hiveku plugin installed, ask in plain words: “Connect our support Outlook” or “Set up Outlook for the help desk”. It walks you through one step at a time and runs Microsoft’s command line, az, for you.
  • Signing in. When it asks you to sign in to Azure: in Claude Code, type ! az login --allow-no-subscriptions in the prompt. In Codex, run az login --allow-no-subscriptions in your own terminal, then approve each az command Codex asks to run outside its sandbox.
  • The client secret you create yourself, in a terminal window of your own, and type straight into Hiveku. It asks you to, so the secret never passes through the chat.
Keep the client secret out of chats, tickets and email. Anyone who has it can sign in as your app.

Approve the permissions

When someone connects a mailbox, Microsoft asks them to approve the mail permissions. If your organization does not let people approve apps themselves, a Microsoft 365 admin approves once for everyone: in the Azure portal, API permissions > Grant admin consent, or from the command line:

Register the app in Hiveku

In Hiveku, open Settings > OAuth Apps and click New OAuth app.
  • Provider: Microsoft
  • Name: a label for you, such as Acme Outlook
  • Client ID: the Application (client) ID
  • Client Secret: the secret’s Value
  • Allowed Products: CRM email (Gmail / Outlook)
Click Save app. Then connect the mailbox: for the help desk, see Help desk email; for the CRM, see Connect Outlook. In the connect window, enter your Directory (tenant) ID in Azure Tenant: a single-tenant app does not accept common.

Instant replies

An Outlook inbox gets instant replies on its own: when it connects, Hiveku asks Microsoft to announce each new email, and it shows up within about a minute instead of at the 10-minute check. Nothing to set up in Microsoft.

Rotating the client secret

Secrets expire, and an expired secret stops every Outlook connection made through the app. Before it expires:
1

Create a new secret

az ad app credential reset --id <APP_ID> --append --display-name hiveku --years 2 --query password -o tsv, or Certificates & secrets > New client secret in the portal. --append keeps the old secret working until you remove it.
2

Update it in Hiveku

In Settings > OAuth Apps, edit the Microsoft app, paste the new secret, and save.
3

Remove the old secret

Delete the expiring secret in Azure.
Put a reminder two weeks before the secret expires.

Troubleshooting

The tenant has no Azure subscription (common with Microsoft 365 alone), and a plain az login leaves the Azure CLI without the tenant. Sign in again with az login --allow-no-subscriptions --tenant yourdomain.com. If Microsoft still refuses, your tenant lets only admins register apps: a Microsoft 365 admin runs the steps.
The app’s Web redirect URI must be exactly https://app.hiveku.com/api/oauth/microsoft/callback. Check it under App registrations > your app > Authentication, or run az ad app show --id <APP_ID> --query web.redirectUris.
The app is single-tenant and the connection used common. Connect again with your Directory (tenant) ID in Azure Tenant.
The tenant used to connect is not the app’s own. Connect with the tenant id of the tenant where you registered the app, signed in as a mailbox in that tenant.
Your organization does not let people approve apps themselves. A Microsoft 365 admin approves once for everyone (see Approve the permissions).
Existing connections stop refreshing. Create a new secret, update it in Settings > OAuth Apps, and reconnect affected mailboxes once if they still fail.

What’s next?

Help desk email

Turn your support inbox into help desk conversations

Connect Outlook

Connect an Outlook inbox for the CRM and sales