Microsoft TeamsMicrosoft Dynamics AX 2012 Agent view

How to connect Microsoft Teams to Dynamics AX 2012

Short answer

Put a gateway between Teams and AX. The gateway watches AX workflow items and alerts, posts adaptive cards into a channel or chat, and calls AX back through AIF or a custom service when someone approves. Identity maps from Entra ID to AX users so the right person approves.

A lot of AX 2012 sites now live in Microsoft 365 for mail, files and chat, while approvals still wait in the AX Workflow inbox or Enterprise Portal that nobody opens. The result is purchase orders and journals sitting unapproved because the approver is on the road or in a meeting.

Teams is a natural front door because the approver is already there. The challenge is that AX 2012 is on-prem and old: no OData endpoint, no webhooks, no Power Platform connector in the box. Everything has to go through a gateway you control.

This page lays out how to build that gateway, which AX hooks to use, and what to avoid so a Teams message cannot become an uncontrolled way to post to the ledger.

What teams use it for

Purchase order approvals in a chat

An adaptive card shows vendor, total, requester and top lines from PurchTable and PurchLine, with Approve, Reject and Ask Question actions bound to the workflow work item.

Production exceptions channel

Late or short production orders are posted to a plant channel with item, order ID and the missing component, so planners and the floor see the same list.

Credit hold release requests

When a sales order lands on credit hold, the credit controller gets a card with the customer's open balance from CustTrans and can approve a one-time release.

Inventory discrepancy alerts

Counting journal variances above a threshold are posted to a warehouse channel for a supervisor to review before posting.

Month-end close reminders

Finance posts a status card listing unposted journals and open vendor invoices from the pending queue, refreshed daily until close.

Microsoft Dynamics AX 2012 integration surface

  • AX workflow framework: work items for purchase orders, expense reports, journals and custom approvals, stored in workflow tables and surfaced in the Enterprise Portal or the client inbox. A gateway reads pending items and completes them through the workflow API called from X++ or a custom service.
  • Event-based alerts and the batch framework can emit change events as emails or rows in a queue table.
  • AIF inbound ports, secured with Windows authentication via the AOS WCF endpoint, handle write-back for supported documents; custom service classes cover the rest.
  • SQL Server tables such as PurchTable, VendTable, SalesTable and the workflow tables are suitable for read-only polling, with names verified against your release and customizations.
  • Teams side: a bot built with the Bot Framework or Teams SDK, posting adaptive cards, and Power Automate workflows for simple channel posts, with Entra ID used for sign-in.

How it works

  1. 1

    Decide bot versus workflow

    For one-way channel posts, a Power Automate workflow with an HTTP trigger is enough. For approvals that must return a decision to AX, build a bot so you can verify who clicked.

  2. 2

    Map identities

    Keep a table linking Entra ID user principal names to AX user IDs. Reject any action where the Teams user is not the assigned approver of the work item.

  3. 3

    Expose a gateway API on-prem

    A small service reads AX pending items, exposes only a handful of endpoints, and is reachable from the bot through an outbound connection or a reverse proxy, not by opening the AOS.

  4. 4

    Render adaptive cards

    Cards should carry a work item ID and a short, signed token so the callback cannot be forged. Show enough detail to decide, with a deep link to the AX client or portal for more.

  5. 5

    Complete the workflow item

    The gateway calls the workflow completion routine under a dedicated service identity with the approver recorded in the comment, or impersonates through a controlled service pattern agreed with your AX security owner.

  6. 6

    Update the card after action

    Replace the card with the outcome and timestamp, and log the decision to an audit table.

Example flows

PO approval from Teams

Trigger: A purchase order enters a workflow approval step assigned to a manager.

  1. Gateway polls pending work items and finds the new one.
  2. Bot sends a card to the manager's personal chat.
  3. Manager taps Approve; the bot verifies the Entra ID user matches the assignee.
  4. Gateway completes the work item with a comment noting approval via Teams.
  5. Card updates to show approved and by whom.

Result: Approvals move in minutes while the AX audit trail still records the step.

Shop floor shortage broadcast

Trigger: A batch job detects a production order with a component shortage.

  1. The job writes a row to a queue table with order ID and item.
  2. Gateway reads the row and posts a card to the plant channel.
  3. A planner replies in thread; no AX write occurs until they act in AX.

Result: Planners and supervisors work from one shared view instead of separate emails.

Keeping data on-prem

Teams is a cloud service, but your AX data does not have to be. Keep the gateway inside your network and have it make outbound HTTPS calls to the bot service so no inbound port to the AOS is needed. Limit card content to identifiers and the minimum fields needed to decide, with a deep link for detail. If you want a natural-language assistant in Teams that answers questions about AX data, serve an open-weight model on your own hardware behind the gateway so prompts that include order and vendor data never reach an external model provider.

Security checklist

  • Use Entra ID authentication for the bot and validate the Teams token on every callback.
  • Run the gateway under a service account with only the AX roles needed; avoid system administrator rights.
  • Sign card action payloads and expire them so a forwarded card cannot be replayed.
  • Write every action to an audit table with Teams user, AX user and work item ID.
  • Segregate duties: do not let the bot approve items for the same user who created them.

Ways to get it done

Power Automate workflows with a gateway endpoint

Effort: Days to two weeks.

One-way alerts and simple status posts with little custom code.

Custom Teams bot with adaptive cards

Effort: Roughly 4 to 8 weeks.

Approvals and interactive flows with strong identity checks.

Partner build with Netray

Effort: Scoped after reviewing your workflow configuration.

Sites that also want a grounded Q&A assistant over AX in Teams, run on-prem.

Pitfalls

  • !Approvers delegated in AX but not in the identity map, causing legitimate approvals to be refused.
  • !Cards posted to large channels exposing vendor or pricing data to people without AX access.
  • !Relying on Office 365 connector webhooks, which Microsoft has been retiring in favor of workflows; check current status before you start.
  • !Customized workflow types whose completion requires fields the generic gateway does not know about.
  • !No timeout on pending cards, so stale approvals can be actioned after the document has changed.

Frequently asked questions

Is there an official Teams connector for AX 2012?

Not in the product. Microsoft's modern connectors target Dynamics 365 Finance and Operations, not the on-premises AX 2012 database and AOS. You use a gateway you build or buy that talks to AX through AIF, services or SQL.

Can approvals in Teams satisfy audit requirements?

They can if the decision is completed through the normal AX workflow step so the work item history records it, and your gateway logs the Teams identity. Check with your auditors, because some controls require the approval to occur in the system of record.

Does the AOS need to be reachable from the internet?

No. Keep the AOS internal. The gateway initiates outbound connections or sits behind a reverse proxy that exposes only the bot callback path.

Can we ask AX questions in a Teams chat?

Yes, with a bot that maps questions to read-only queries or a private model over replicated data. Keep it read-only at first, show the query it ran, and respect the asker's AX roles.

What happens if Teams is down?

Nothing breaks in AX. Approvals stay in the normal AX inbox, and the gateway resumes posting once the service returns. Design cards as a convenience channel, not the only path.

Want Microsoft Teams working on your Microsoft Dynamics AX 2012?

A free 30 minute assessment: we map the integration path for your version and setup, and where it should run.

Get a free assessment