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.
Register the app
- Claude Code or Codex
- Azure CLI
- Azure portal
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-subscriptionsin the prompt. In Codex, runaz login --allow-no-subscriptionsin your own terminal, then approve eachazcommand 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.
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)
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.
Troubleshooting
No subscriptions found, or Insufficient privileges when creating the app
No subscriptions found, or Insufficient privileges when creating the app
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.AADSTS50011: reply URL mismatch
AADSTS50011: reply URL mismatch
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.AADSTS50194: not configured as a multi-tenant application
AADSTS50194: not configured as a multi-tenant application
The app is single-tenant and the connection used
common. Connect again with your Directory (tenant) ID in Azure Tenant.AADSTS700016: application not found in the directory
AADSTS700016: application not found in the directory
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.
AADSTS65001 or 'Need admin approval'
AADSTS65001 or 'Need admin approval'
Your organization does not let people approve apps themselves. A Microsoft 365 admin approves once for everyone (see Approve the permissions).
Client secret expired
Client secret expired
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