Fixing “Tenant Isolation Policy” Errors When Connecting Business Central MCP to Copilot Studio

If you’ve tried connecting a Copilot Studio agent to the Dynamics 365 Business Central MCP server and hit an OAuth failure mentioning a tenant isolation policy, you’re not alone. The error looks alarming, but the cause is simple: two different Microsoft tenants are involved, and one of them is blocking the connection.

The error

OAuth2Certificate authorization flow failed for service
‘First Party Azure Active Directory’. Sign-in with Azure Active Directory
account @ failed, due to a tenant isolation policy for
tenant . If your use case requires a cross-tenant connection,
contact your tenant administrator.
Details: Connection owner tenant: ,
Connection sign-in tenant: ,
Connector: Dynamics 365 Business Central

What the error is telling you

Two tenant IDs appear in the message, and they play different roles:

TermMeaning
Connection owner tenant (Tenant A)Where your Copilot Studio environment and the connection live
Connection sign-in tenant (Tenant B)The tenant of the account you signed in with, which is where Business Central runs

If A and B differ, the connection is cross-tenant. Power Platform’s tenant isolation feature blocks cross-tenant connections when it’s enabled, and the error names the tenant whose policy blocked the sign-in.

Where to find the setting

Tenant isolation isn’t under Tenant settings in the Power Platform admin center, which is where most people look first. It lives under Security:

  1. Open the Power Platform admin center.
  2. Go to Security → Identity and access.
  3. Select Tenant isolation.

You’ll see a single toggle: Restrict cross-tenant connections. You need the Power Platform administrator or Global administrator role to view and change it.

The gotcha: check the right tenant

Here’s the detail that’s easy to miss. The toggle may be off in the tenant you’re looking at, and you’ll still get the error. The policy is enforced in the tenant named in the message, which isn’t always the one you’re signed in to as admin.

So:

  • Read the error and identify the tenant it names as enforcing the policy.
  • Have an admin of that tenant open Security → Identity and access → Tenant isolation.
  • Check each tenant involved. Isolation can be enabled on either side.

Three ways to fix it

1. Keep it in one tenant (simplest). Build the Copilot Studio agent in the same tenant as Business Central, using an account from that tenant. No cross-tenant connection means nothing to allow. For most organizations, this is the right answer.

2. Turn off isolation or add an exception. If the agent must live in a different tenant, an admin can switch Restrict cross-tenant connections off. If isolation must stay on, add the other tenant as an exception with the appropriate inbound and outbound rules. Do this in both tenants.

3. Use an account that belongs to the connection owner tenant. A guest account invited into the owning tenant, or a native account there with a Business Central license and permissions, avoids the cross-tenant sign-in.

After the change

  • Delete the failed connection in Copilot Studio (Connections page) and create it again so it picks up the updated policy. Policy changes can take a little time to propagate.
  • Confirm the signing-in user has a Business Central license and permissions in the target environment.
  • Confirm the MCP server is enabled in Business Central under MCP Server Configuration.
  • If isolation is off everywhere and the error persists, look at Microsoft Entra Cross-tenant access settings and any Conditional Access policies, which can block cross-tenant sign-ins independently.

Key takeaways

  • A “tenant isolation policy” error means the connection crosses tenants and one tenant is blocking it.
  • Tenant isolation is under Security → Identity and access, not Tenant settings.
  • The error names the tenant enforcing the policy. Check that tenant, not just the one you administer.
  • The cleanest fix is to avoid the cross-tenant connection altogether.

Microsoft now has its own model family

The single most strategically important news is MAI — a family of seven in-house models from Microsoft’s AI Superintelligence Team. The anchor, MAI-Thinking-1, is Microsoft’s first dedicated reasoning model: a mid-sized 35B active-parameter model with a 256K context window, trained from scratch on clean, commercially licensed data. Microsoft claims independent raters prefer it to Sonnet 4.6 in blind tests and that it matches Opus 4.6 on SWE Bench Pro coding. It’s in private preview on Foundry.

The rest of the family fills out the stack: MAI-Code-1 (a coding model tuned for GitHub, already live in Copilot and VS Code), MAI-Image-2.5 (text-to-image and image-to-image, now in PowerPoint and rolling out to OneDrive), MAI-Transcribe-1.5 (speech-to-text across 43 languages), and MAI-Voice-2 (15+ additional languages).

Why it matters: Owning the model layer changes Microsoft’s margin structure and reduces single-vendor dependency. For enterprises, the “clean, commercially licensed training data” claim is the real selling point — it directly addresses the IP-contamination risk that has made legal teams nervous about generative AI in production.

The dependency to watch: These are still early. MAI-Thinking-1 is private preview only, and vendor-published benchmarks always deserve independent verification before you architect around them. Treat MAI as a promising second source, not a drop-in replacement, until third-party evals land.

Agents move to the desktop — including Microsoft Scout

Microsoft framed agents as a new form factor, and the clearest example is Microsoft Scout, a personal work agent now rolling out to Frontier customers. Built on “OpenClaw” and Work IQ, Scout runs on your desktop, uses tools you already live in (Teams, Outlook), and proactively handles meeting prep, scheduling conflicts, and routine tasks. It reads and writes files, runs shell commands, automates browsers, and works autonomously in the background — all under a granular permission system that requires approval before sensitive actions.

Alongside it, the GitHub Copilot desktop app (preview) brings agentic development to a native experience, letting you orchestrate multiple agent sessions in parallel with git worktrees keeping work isolated.

Why it matters: This is the shift from “AI in a chat box” to “AI with hands.” The automation potential is real — an agent that preps your meetings and clears scheduling conflicts recovers genuine hours.

The risk to call out plainly: An autonomous agent with filesystem, shell, and M365 access is a meaningful attack surface and a governance challenge. The permission model is the entire safety story here. Don’t roll these out broadly without mapping which directories, commands, and data scopes are auto approved. Scout is preview/Frontier-gated for a reason.

How to solve – Wiki delete operation is not supported on wikis of type ‘ProjectWiki’

Scenario:

  • When trying to delete Wiki on Azure DevOps using REST APIs
  • You get an error Wiki delete operation is not supported on wikis of type ‘ProjectWiki’

Resolution:

  • Each Wiki on Azure DevOps has a repository. You can get list under Wikis endpoint.
  • Unfortunately, this is not listed in Repositories’s list.
  • Now, you have got the repositoryId, you can delete this using Repositories – Delete endpoint.
  • Follow below inline code for example,

DELETE https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}?api-version=7.1-preview.1

What’s New in “ErrorInfo datatype” for Microsoft Dynamics Business Central for Developers

Usage:

  • This blog shows to use error messages in different ways possible.
  • If you’re developing App for AppSource and want to give more detailed error message plus advanced capabilities to solve the error by end-users on their own.

Use Cases with examples:

1. ErrorInfo.Create (not a data type but as a direct function)-

  • When used with Error() do not make any difference and will show below error.
pageextension 50100 CustomerListExt extends "Customer List"
{
    trigger OnOpenPage();
    begin
        Error('App published: Hello world');
        //OR
        Error(ErrorInfo.Create('App published: Hello world'));
    end;
}
  • Output:

2. ErrorInfo (as a data type with MessageType as Client)-

  • Purpose: To show the specific error message same as above use case and sends to telemetry.
  • Code:
pageextension 50100 CustomerListExt extends "Customer List"
{
    trigger OnOpenPage();
    begin
        // Error(InitialMsg);
        // Error(ErrorInfo.Create(InitialMsg));
        InitializeClientError();
    end;

    local procedure InitializeClientError()
    var
        InitializeErrorInfo: ErrorInfo;
    begin
        InitializeErrorInfo.DataClassification(DataClassification::SystemMetadata);
        InitializeErrorInfo.ErrorType(ErrorType::Client);
        InitializeErrorInfo.Verbosity(Verbosity::Error);
        InitializeErrorInfo.Message(InitialMsg);
        Error(InitializeErrorInfo);
    end;

    var
        InitialMsg: Label 'App published: Hello world';
}
  • Output: Same as case # 1.

3. ErrorInfo (as a data type with MessageType as Internal)-

  • Purpose: To show some generic error message same as above use case and sends to telemetry. Mainly for developers track this error message.
  • Code:
pageextension 50100 CustomerListExt extends "Customer List"
{
    trigger OnOpenPage();
    begin
        InitializeInternalError();
    end;

    local procedure InitializeInternalError()
    var
        InitializeErrorInfo: ErrorInfo;
    begin
        InitializeErrorInfo.DataClassification(DataClassification::SystemMetadata);
        InitializeErrorInfo.ErrorType(ErrorType::Internal);
        InitializeErrorInfo.Verbosity(Verbosity::Error);
        InitializeErrorInfo.Message(InitialMsg);
        Error(InitializeErrorInfo);
    end;

    var
        InitialMsg: Label 'App published: Hello world';
}
  • Output:

4. ErrorInfo (with Title)-

  • Purpose: To show some error message with a title.
  • Code:
pageextension 50100 CustomerListExt extends "Customer List"
{
    trigger OnOpenPage();
    begin
        InitializeClientError();
    end;

    local procedure InitializeClientError()
    var
        InitializeErrorInfo: ErrorInfo;
        ErrorTitleLbl: Label 'Initializing error.';
    begin
        InitializeErrorInfo.DataClassification(DataClassification::SystemMetadata);
        InitializeErrorInfo.ErrorType(ErrorType::Client);
        InitializeErrorInfo.Verbosity(Verbosity::Error);
        InitializeErrorInfo.Message(InitialMsg);
        InitializeErrorInfo.Title(ErrorTitleLbl);
        Error(InitializeErrorInfo);
    end;

    var
        InitialMsg: Label 'App published: Hello world';
}
  • Output:

5. ErrorInfo (with Action)-

  • Purpose: To show some error message with a action and title.
  • Code:
    • Add InitializeErrorInfo.AddAction(UpdateLbl, Codeunit::”Update MNK”, ‘UpdateOnCustomer’);
local procedure InitializeClientError()
    var
        InitializeErrorInfo: ErrorInfo;
        ErrorTitleLbl: Label 'Initializing error.';
        UpdateLbl: Label 'Make Update';
    begin
        InitializeErrorInfo.DataClassification(DataClassification::SystemMetadata);
        InitializeErrorInfo.ErrorType(ErrorType::Client);
        InitializeErrorInfo.Verbosity(Verbosity::Error);
        InitializeErrorInfo.Message(InitialMsg);
        InitializeErrorInfo.Title(ErrorTitleLbl);
        InitializeErrorInfo.AddAction(UpdateLbl, Codeunit::"Update MNK", 'UpdateOnCustomer');
        Error(InitializeErrorInfo);
    end;
codeunit 50100 "Update MNK"
{
    trigger OnRun()
    begin
    end;

    procedure UpdateOnCustomer(ErrorInfo: ErrorInfo)
    var
        SomeProcessesLbl: Label 'Some process or data updates here.';
    begin
        Message(SomeProcessesLbl);
    end;
}
  • Output:

6. ErrorInfo (with Navigation)-

  • Purpose: To show some error message with a navigation, action and title.
  • Code:
    • Add InitializeErrorInfo.AddAction(UpdateLbl, Codeunit::”Update MNK”, ‘UpdateOnCustomer’);
local procedure InitializeClientError()
    var
        InitializeErrorInfo: ErrorInfo;
        ErrorTitleLbl: Label 'Initializing error.';
        UpdateLbl: Label 'Make Update';
        ActualUpdateLbl: Label 'Make Actual Update';
        NavigateToCardLbl: Label 'Open Card';
    begin
        InitializeErrorInfo.DataClassification(DataClassification::SystemMetadata);
        InitializeErrorInfo.ErrorType(ErrorType::Client);
        InitializeErrorInfo.Verbosity(Verbosity::Error);
        InitializeErrorInfo.Message(InitialMsg);
        InitializeErrorInfo.Title(ErrorTitleLbl);

        //Add actions using another codeunit
        InitializeErrorInfo.AddAction(ActualUpdateLbl, Codeunit::"Update MNK", 'ActualUpdateCustomer');

        //Add navigation action using another codeunit
        Rec.FindFirst();
        InitializeErrorInfo.PageNo(Page::"Customer Card");
        InitializeErrorInfo.FieldNo(Rec.FieldNo(Blocked));
        InitializeErrorInfo.RecordId(Rec.RecordId);
        InitializeErrorInfo.AddNavigationAction(NavigateToCardLbl);
        Error(InitializeErrorInfo);
    end;
codeunit 50100 "Update MNK"
{
    trigger OnRun()
    begin

    end;

    procedure ActualUpdateCustomer(ErrorInfo: ErrorInfo)
    var
        Customer: Record Customer;
    begin
        Customer.FindFirst();
        if Customer.Blocked = Customer.Blocked::" " then
            Customer.validate(Blocked, Customer.Blocked::All)
        else
            Customer.validate(Blocked, Customer.Blocked::" ");
        Customer.Modify();
    end;
}
  • Output:

Important Notes:

  • You cannot have two actions at the same time.
  • Any actions you put should have reference to global function of that Codeunit.
  • Try other functions like DetailedMessage for Telemetry.
References:

New Feature to “Add Item tracking lines from Item Journal lines” on Microsoft Dynamics Business Central (aka from v22.0)

Scenario:

  • It was hard to insert item tracking lines for item journals as they are saved in different table. Plus going to each journal lines and then inserting a lot/serial is a huge manual task.

Before Enabling:

  • The user needs to click on Item Tracking Lines and then enter Lot/Serial for that item (which needs to be done for all items if list is huge):

Solution:

  • On journal batches, enable the setup as shown in below snapshot.

After Enabling:

  • Four fields (highlighted below) would be shown on Item Journals Line (you must have seen them in Item Reclassification Journals).
  • Entering the data or uploading the data here allows to create a Item Tracking Lines in background.
  • This helps in uploading opening inventories in easier manner for items with lots / serials.
  • Same feature is available on Warehouse physical journal. Give it a try!!

Reference:

How-To “Hide the Page Inspection or Zoom for users” in Microsoft Dynamics Business Central

Scenario:

  • Users by default are allowed to access the data of Microsoft Dynamics Business Central (BC) which they can view the table or check the values which we some installations may not need.

Before Changes:

  • Users can access the said details either by pressing the [Ctrl] + [Alt] + [F1] on their keyboard or by going to ‘Help and Support’ -> ‘Inspect Pages and Data’
  • The screen looks something like shown below:

Solution:

  • Create a new Permission Set in BC as shown below:1
TypeObject TypeObject IDObject Name
ExcludeSystem1350Run Table
ExcludeSystem5330Tools, Zoom
Permissions under new Permission Set create.
  • Assign the permissions to the users and ask them to re-login in BC.

After Changes:

  • Now ask users to re-login to BC and they will not see the data under Page Inspection. The screen would look like below:

References:

  1. Define Granular Permissions – Business Central | Microsoft Learn ↩︎

Solution- Microsoft Dynamics Business Central Container’s certificate expired.

Scenarios:

  • You are accessing old BC Container and you suddenly get technical issue error. You check event logs of Container, and you get below errors / no error.
    • The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A required certificate is
      not within its validity period when verifying against the current system clock or the timestamp in the signed file.
    • A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
Read More »

Power BI – How to create and show customized ToolTips.?

Scenarios:

  • Default PowerBI report and dashboard shows values of default or select fields when you hover your mouse over.
  • You need to show a different ToolTips page.

Solutions:

  • Create a page and change its Canvas settings. Here change Type to ToolTips
If you see above, I have created a KPI page which picks data from Measure. 
  • Tick ‘Allow use as tooltip’ on Page Information of that page.
  • Select a visualization where you need customized tooltip to show. Go to General tab and select ToolTips to enable it. Under Type choose ‘Report page’ and select page of tooltip created with above listed steps 1 and 2:
  • Now you see Tooltips properties has been changed:
  • Output you’ll see is:

instead of

Reference Links:

Microsoft Dynamics Business Central (On-Premises or On-SaaS) – PowerApps Gateway Agents – Use Case (Part 1)

Scenario:

This part 1 blog is to give small idea, hint or knowledge on how you can use PowerApp Gateway Agents with Microsoft Dynamics Business Central and what are the purposes / use case of using it. Part 2 is already available to publish, but it was personal idea of providing the introduction first on what you’re doing before its practical working.

Pre-requisites:

  • Microsoft Dynamics Business Central (knowledge and access)
  • On-Premises Data Gateway (configured and installed)
  • Microsoft PowerApps (access)
Read more: Microsoft Dynamics Business Central (On-Premises or On-SaaS) – PowerApps Gateway Agents – Use Case (Part 1)

Flow:

All right sections are Microsoft Solutions used for interface.

References (English-Singapore):

Microsoft Dynamics 365 Business Central – AL Codes impact on DB Performance – New datatype learning

Scenarios:

New BC developers or learners usually find it difficult to understand how their code development or customization are performing. Any logic in AL Code can be achieved but these new application logics (or codes) can be performance impacting. How to test or trace them?

Applicable to: Business Central (application version 4.0 or above)

Solutions:

  • There is a performance toolkit provided by BC on its setup. Such toolkit uses a new datatype introduced from application version 4.0. Datatype is SessionInformation.

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/sessioninformation/sessioninformation-data-type

Details about sessioninformation on Microsoft’s portal
  • Now, coming to datatype’s details. There are two methods provided (I reckon there should be more methods in future and then dev team don’t need to check more details on SQL Profilers or monitor on SQL on SaaS.
  • Methods:
    • SqlStatementsExecuted – This is number of SQL statements that were executed during the sessions. Good! Now we now why certain users are in trouble or getting locks when they are testing new functionality in BC. You can track it by putting these details in Telemetry on your apps or use Microsoft BC’s Performance Toolkit.
    • SqlRowsRead – Similar to above method, this method returns SQL rows read from starting of session.
  • If you are experienced person, you would / should have one question:

I see the same details during debugging, why use this datatype?

Although, while writing this blog, I also understand that you would avoid debugging on customer’s environment where there are real time data and process occurring.
  • Above SQL statistics can be also seen while debugging. This is during development phase of project, although you may not have guarantee when real business data comes on your Apps.

Examples:

  • There are good, self-explanatory on Microsoft’s portal and its usage is already in BC Performance Toolkit. Although, still the developers who need to use this below are some examples:
var
    SqlRowsRead := BigText;

begin

    SqlRowsRead := SessionInformation.SqlRowsRead();
    Message(Format(SqlRowsRead));
end;
var
    SqlStatementsExecuted : BigText;

begin

    SqlStatementsExecuted := SessionInformation.SqlStatementsExecuted();
    Message(Format(SqlStatementsExecuted));
end;
Real time usage in BC, is Microsoft Business Central Performance Toolkit. You can check on codeunit 'BCPT Line' which has major codes based on this datatype.

References:

Simple Business Central Developer tricks – Substitute reports objects from standard report to customized reports

Scenario:

Based on report selections some reports can be replaced with new customized reports. Although, they’re not applicable to all reports.

Tips:

  • Subscribe a function ‘OnAfterSubstituteReport()’ from Codeunit ReportManagement.
  • There are pre-defined parameters available to assist replacing the reports and records used:

Parameters:

ReportId: Existing report to be replaced.

RecordRef: To get record reference.

RequestPageXML: To get the filters from request page.

RunMode: Normal,ParametersOnly,Execute,Print,SaveAs,RunModal

NewReportId: Replaced report object ID of Business Central

Try this if you read it!!! 🙂

Short Review – Microsoft Dynamics Business Central – Release Wave 1, 2021 – Assisted Automatic Cost Posting on Job queue

What’s New:

Also called as ‘Cost Adj. Scheduling Wizard’.

Microsoft Dynamics Business Central 2021 Wave 1 (Inventory Setup)
Assisted Setup (New)

Assisted Setup:

  1. Post Inventory Cost to G/L​​: On enabling this field, ERP creates a job queue entry that will post costs for all items at a specified time. The default will be 2 AM, but you can change that. Suggested to schedule it during non-working hours.
  2. Adjust Cost – Item Entries​: On enabling this field, ERP creates a job queue entry that will adjust costs for all items at a specified time. The default will be 1 AM, but you can change that.
After enabling any or all feature from previous screen
Job-queue entries after the feature is run

Pros:

  1. Ease the enabling of job-queue for those who are not expert on tool, who doesn’t know which object to schedule.
  2. If job-queue is already enabled/available, system does not keep on popping the assisted setup.

Cons or suggestions:

  1. Many job-queues scheduled at same time may cause problems. Hence, avoid scheduling the strong processes job-queues at same time. Adjustment of costs and posting inventory cost to G/L are the strong processes.

Reference: https://docs.microsoft.com/en-us/dynamics365-release-plan/2021wave1/smb/dynamics365-business-central/assisted-setup-helps-move-task-adjusting-item-costs-background

Feel free to add up your suggestions, feedbacks, comments!!! 🙂

/*Stay Safe*/

Short Review – Microsoft Dynamics Business Central – Release Wave 1, 2021 – Item Availability by Lot

Story:

Microsoft Dynamics Business Central Wave 1, 2021 included item availability by lot after approximately 90 votes on this idea. We will go through the functionality introduced, how it was done, pros and cons of module.

What’s New:

Microsoft Business Central Wave 1 2021
Microsoft Business Central Wave 2 2020

How:

  1. New buffer table ‘Availability Info. Buffer’, a matrix page and couple of queries to retrieve Lot from item ledgers and reservation entries.

Pros:

  1. Easily lists serial/lot number of items to determine the expiration, inventory, availability, requirements on single page.

Cons or Suggestions:

  1. Includes items with no item tracking codes on Item No filter (that can be considered).

Reference: https://docs.microsoft.com/en-us/dynamics365-release-plan/2021wave1/smb/dynamics365-business-central/monitor-inventory-transaction-availability-lot-window

Comment your feedbacks, suggestions or greetings!! 🙂

/*Stay safe*/

Bulk Import of huge/formatted texts in Dynamics NAV and BC

User Story:

In Dynamics NAV/Business Central (here after called as ERP), there are chances where customer needs to store huge texts in formatted text. The direction (I think) to do this is by saving such formatted texts in BLOB fields.

Now the challenge comes is when ERP users have provided the data to you in Excel or XML file format. And later it needs to be migrated to ERP. I was not able to achieve this using Configuration packages, Excel import or simple XMLPort import with logic to write in BLOB field.Read More »

How I Use Muse in Singapore: Trips, Cricket and Smaller Bills.

Muse is Meta’s personal AI agent. It launched in Singapore on 28 October 2026. It links to Gmail and Calendar and to local apps such as Grab, Shopee, Lazada, ShopBack, Agoda, Klook and Trip.com. It checks with you before sensitive actions like sending an email or buying something. Here are the three ways I use it.

1. Planning personal trips

Trip planning used to mean a dozen tabs and a messy notes file. Now I give Muse the constraints once:

“Weekend in Johor, Malaysia in Oct and Nov, two adults and one baby, under S$1,200 total. Morning bus, a hotel near the JCA Oval Cricket Ground, and a day plan that isn’t rushed.”

Muse pulls options from travel apps like Agoda, Klook and Trip.com. It checks my Calendar for clashes and drafts an itinerary. It also reminds me about passport validity and visa rules. I make the final booking decisions. Muse does the comparing, and I confirm the purchase.

2. A day of cricket

Singapore has a busy cricket scene, and match days involve a lot of logistics (specially when it’s a different country’s game. For a Saturday at the ground, I ask:

“Match starts 9am at the JCA Oval, Johor, Malaysia. Plan my morning: Cricket team van pickup time, remind me to pack kit and sunscreen, and message the team that I’m 15 minutes early.”

Muse works back from the start time to a pickup time. It adds the reminders to my Calendar and drafts the WhatsApp or email note for me to approve. When I’m watching a big international match instead, it blocks the time and reminds me to book the late-night ride home.

3. Cutting bills and unused subscriptions

This is where it earns its keep. I ask:

“Go through my Gmail receipts from the last six months. List every subscription and bill, flag anything I haven’t used in 60 days, and tell me what I’d save by cancelling.”

A typical result:

Item Monthly cost Verdict
Streaming service I forgot about S$15 Cancel
Cloud storage upgrade S$3 Downgrade
Gym app S$30 Cancel; I go twice a month
Telco plan S$55 Compare plans, since I use under half the data

That’s about S$48 a month, or roughly S$575 a year. Muse also drafts the cancellation emails, and I only hit send once I’ve read them. For everyday shopping, it compares prices across Shopee and Lazada and reminds me to check ShopBack for cashback.

Things to keep in mind

  • Check before you confirm. Read each draft email and each purchase total, since Muse asks for your approval on exactly those.
  • Mind the permissions. Muse needs access to Gmail and Calendar, so connect only what you’re comfortable sharing.
  • Know the limits. The app is free with a weekly usage limit, plus optional paid plans. Some app connectors are arriving gradually after launch.

Muse hasn’t changed what I do. It has taken over the admin around it: the planning, the reminders and the bill audit. I’d start with the subscription audit, because it pays for itself fastest.

Sources: Meta · Technobezz · Let’s Data Science

Power Platform CLI in Action — Part 2

From install to real projects: a Canvas Expense app + a job-queue failure notifier — built with pac and Claude Code.

Part 1 was about getting PAC CLI. Part 2 is about using it — with an AI pair-programmer in the terminal. Two practical, end-to-end examples you can adapt to your own work.


👋 Why I’m Sharing This (Note to My Network)

In Part 1 I showed my network how to install the Power Platform CLI (pac) in a few minutes. The most common reply I got was:

“Okay, it’s installed… now what can I actually do with it?”

Fair question. pac really shines when it turns clicks into code — repeatable, source-controlled, CI/CD-friendly automation. So in this part I’m walking through two realistic scenarios that mirror day-to-day Power Platform work — and I’m pairing each one with Claude Code, an agentic coding assistant that lives in your terminal, to generate the JSON, Power Fx, and scripts that pac then ships:

  1. 🧾 A Canvas Power App for Expense Management — generated from a custom connector and treated as source code.
  2. 🔔 A Power Automate flow that notifies Teams + email when a job queue item fails — built in the designer, shipped with ALM, then monitored from the CLI.

Who this is for: the same crowd as Part 1 — Power Platform devs, ALM/DevOps engineers, admins, and makers ready to move past the portal.

My intent? To show that pac isn’t just an installer — it’s the command line for the whole Power Platform lifecycle — and that an AI coding assistant makes driving it dramatically faster. Let’s get into it.


The Mental Model: pac + Claude Code Across the Lifecycle

Almost every pac workflow follows this loop:

auth → env → build (connector / canvas / solution) → pack & export → deploy → monitor

Now imagine a teammate who can write the artifacts at every stage and run the pac commands for you. That’s Claude Code. I like to think of it this way:

  • 🧠 You own the intent and the decisions (“expenses get approved by managers”).
  • 🤖 Claude Code authors the files (OpenAPI, Power Fx, JSON, scripts) and executes the CLI.
  • ⚙️ PAC CLI is the engine that actually talks to Power Platform.

Keep that trio in mind — both examples below are just two different paths through it.

💡 First move in any repo: create a CLAUDE.md file so Claude Code has project context. Mine looks like this:

# ExpenseHub — Power Platform project
- Uses Power Platform CLI (`pac`) for all ALM.
- Solutions live in ./src, build output in ./out.
- Publisher prefix: con. Preferred language: Power Fx.
- Never commit secrets; use environment variables / settings files.

From then on, every prompt is grounded in your conventions.


Example 1 🧾 — A Canvas Power App for Expense Management

Scenario: Field employees submit expenses through a Canvas app; the app talks to an expense backend through a custom connector; approvers review submissions. We’ll scaffold the app from the connector and make it source-controlled — with Claude Code writing the connector and the Power Fx.

Step 1 — Authenticate and confirm your environment

# Sign in and target your dev environment
pac auth create --environment https://contoso-dev.crm.dynamics.com
# See the profiles you've created
pac auth list
# Confirm which org you're pointed at
pac env who

🤖 Claude Code prompt: “Run pac auth create, then pac env who, and summarize which environment we’re connected to and the org URL.”

It runs the commands and reports back — you stay in the loop.

Step 2 — Create the custom connector for the expense API

pac connector scaffolds the files and registers the connector in Dataverse. But a custom connector needs a real OpenAPI definition — this is where Claude Code earns its keep:

# Let Claude Code scaffold the connector files

🤖 Claude Code prompt: “Create a custom connector for an Expense API. Scaffold ./ExpenseApi/apiDefinition.swagger.json (OpenAPI 2.0) with three operations — GetExpenses, SubmitExpense, ApproveExpense — plus apiProperties.json using an API-key connection template, and a README describing the endpoints. Use contoso as the host placeholder.”

Claude Code writes the files, then runs:

# Register the connector into Dataverse and a solution
pac connector create `
--environment https://contoso-dev.crm.dynamics.com `
--api-definition-file ./ExpenseApi/apiDefinition.swagger.json `
--api-properties-file ./ExpenseApi/apiProperties.json `
--icon-file ./ExpenseApi/icon.png `
--solution-unique-name ExpenseHub

⚠️ Claude Code will draft the OpenAPI spec, but you must verify it matches your real API contract (auth, paths, schemas). Treat the AI output as a strong first pass, not gospel.

Step 3 — Generate the Canvas app from the connector

This is the magic bit — pac canvas create generates an .msapp wired to your connector:

pac canvas create `
--msapp ./ExpenseApp.msapp `
--connector-display-name "Expense Management API" `
--environment https://contoso-dev.crm.dynamics.com

Step 4 — Unpack the app into source code (source control time)

An .msapp is an opaque binary — hard to diff. Unpack it into clean Power Fx / YAML sources and commit it to git:

pac canvas unpack `
--msapp ./ExpenseApp.msapp `
--sources ./ExpenseApp-src `
--layout SourceCode `
--overwrite

Now the fun part — author the screens as code, with Claude Code doing the heavy lifting.

🤖 Claude Code prompt: “In ./ExpenseApp-src, add three screens as Power Fx / .pa.yaml: (1) a MyExpenses screen with a gallery bound to GetExpenses, (2) a NewExpense screen with a form validating amount > 0 and a submit button calling SubmitExpense, and (3) an Approvals screen for managers that calls ApproveExpense. Follow the existing source layout and naming conventions.”

Because the app is unpacked, Claude Code can reason over the real files, match your existing controls, and produce reviewable diffs you can approve line by line. 🎉

Step 5 — Repack the sources back into an app

pac canvas pack `
--sources ./ExpenseApp-src `
--msapp ./ExpenseApp.msapp `
--layout SourceCode `
--overwrite

🤖 Claude Code prompt: “Pack the sources and, if the pack fails, read the error and fix the offending Power Fx file, then repack.” — a tight build-fix loop without you hand-editing YAML.

Step 6 — Ship it with a solution (ALM)

Wrap the connector + app in a Dataverse solution, then export/import it between environments. Let Claude Code generate the whole bootstrap script:

🤖 Claude Code prompt: “Write scripts/deploy-expense-app.ps1 that: inits the ExpenseHub solution (publisher Contoso, prefix con), adds the connector (component type 371) and the canvas app (component type 300), exports it managed to ./out, and imports it with --publish-changes.”

# The script Claude Code generates will run these commands:
pac solution init --publisher-name "Contoso" --publisher-prefix "con" --outputDirectory ./ExpenseHub
# Add the custom connector (component type 371)
pac solution add-solution-component --solutionUniqueName ExpenseHub `
--component "Expense Management API" --componentType 371
# Add the Canvas app (component type 300)
pac solution add-solution-component --solutionUniqueName ExpenseHub `
--component "ExpenseApp" --componentType 300
# Export (managed) and import into the next environment
pac solution export --name ExpenseHub --path ./out --managed --overwrite
pac solution import --path ./out/ExpenseHub.zip --publish-changes

💡 Bonus: need to pull an app that already exists? Use pac canvas list to find it and pac canvas download --name "ExpenseApp" to save the .msapp locally — Claude Code can chain both and unpack in one go.

Why this matters: your Expense app is now generated, source-controlled, and deployable by a pipeline — not trapped in a portal. Claude Code wrote the connector, the Power Fx, and the deploy script; you reviewed and shipped it. ✅


Example 2 🔔 — Notify Teams + Email When a Job Queue Item Fails

Scenario: When a background job (a Dataverse System Job / async operation, or a row in a custom Job Queue table) fails, we want an instant heads-up in Microsoft Teams and an email to the support inbox — so failures don’t sit silently.

⚠️ An important honesty note

The pac CLI does not author Power Automate flows for you — flows are still built in the Power Automate designer. Claude Code can’t click the designer either. But together they cover almost everything around the flow: generating the FetchXML, the connection-reference settings, the notifications copy, the deploy scripts, and the monitoring queries. (The pac power-automate commands are admin inspection commands, currently in Preview.)

So the realistic pattern is: design once → ALM with pac → monitor with pac / Claude Code.

Step 1 — Build the flow in the designer

Create a cloud flow with:

  • Trigger: Dataverse → When a row is added, modified or deleted, on the System Jobs (Async Operation) table — or on a custom Job Queue table — filtered to failures (statuscode eq 31 / Status = Failed).
  • Action 1 (Teams): Post message in a chat or channel to your #alerts channel with the job name, error, and a link to the run.
  • Action 2 (Email): Send an email (V2) (Outlook) to the support mailbox with the same details.

🤖 Claude Code prompt (before you build): “Draft the trigger filter and the Teams + email message templates for a flow that fires when a job queue item fails. Include the job name, error message, queued-on time, and a deep link to the run. Give me the exact FetchXML / OData filter expression to paste into the trigger.”

You still assemble the flow in the designer — but you walk in with the filter and the copy already written.

Step 2 — Put the flow in a solution and add it via pac

# Add the cloud flow to the solution (component type 29 = Workflow/cloud flow)
pac solution add-solution-component --solutionUniqueName ExpenseHub `
--component "Notify-JobQueue-Failure" --componentType 29

Step 3 — Export and unpack for source control

# Export the unmanaged solution for development
pac solution export --name ExpenseHub --path ./out --overwrite
# Unpack into git-friendly files
pac solution unpack `
--zipfile ./out/ExpenseHub.zip `
--folder ./src/ExpenseHub `
--packagetype Unmanaged

🤖 Claude Code prompt: “Unpack the solution, then create a .gitignore and a short README.md that explains the folder structure and lists the connection references the flow needs.”

Step 4 — Deploy the flow to another environment

Connection references and environment variables usually need to be filled per environment. Let Claude Code generate that settings file for you:

🤖 Claude Code prompt: “Read the unpacked solution and produce a deployment settings JSON with the connection references (Dataverse, Teams, Outlook) and environment variables the flow uses.”

pac solution import `
--path ./out/ExpenseHub.zip `
--activate-plugins `
--publish-changes `
--settings-file ./out/deployment-settings.json

--activate-plugins turns the flow on after import, --publish-changes publishes customizations immediately, and --settings-file wires up the connection references Claude Code just generated.

Step 5 — Monitor failures from the CLI 🕵️

Once it’s live, inspect the flow and its run history without opening the portal:

# Find the flow and note its workflow-id
pac power-automate list-cloud-flows --environment https://contoso-prod.crm.dynamics.com
# See the run history for that flow
pac power-automate list-flow-runs `
--environment https://contoso-prod.crm.dynamics.com `
--workflow-id <flow-guid>
# Drill into the actions of a flow
pac power-automate list-flow-actions `
--environment https://contoso-prod.crm.dynamics.com `
--workflow-id <flow-guid>

You can even query the underlying failed jobs directly with FetchXML:

pac env fetch --xml "<fetch><entity name='asyncoperation'>
<filter><condition attribute='statuscode' operator='eq' value='31'/></filter>
</entity></fetch>"

🤖 Claude Code prompt: “Write scripts/failed-jobs.ps1 that runs pac env fetch for failed system jobs, parses the JSON, and prints a summary table of job name, error, and age.”

Now instead of scrolling the portal, you get a tidy table in your terminal — generated, reusable, and diffable. 📊

Why this matters: the notification flow is now versioned, promotable, and observable — and the same CLI that deployed it is the one you use to watch it. That’s a full lifecycle story. ✅


🧠 Claude Code Tips for Power Platform Work

A few habits that made the biggest difference for me:

  • 📄 Keep a CLAUDE.md with your publisher prefix, solution names, folder layout, and “never commit secrets” rule. It grounds every prompt.
  • 🔁 Let it run pac and read the errors. Clipboard-pasting build failures is where humans slow down; Claude Code closes that loop itself.
  • 🧪 Always review Power Fx and OpenAPI output. It’s a fast first draft, not a substitute for knowing your domain.
  • 🧩 Small, scoped prompts win. “Add a gallery bound to GetExpenses that filters by the current user” beats “build my app.”
  • 🔐 Never give it secrets. Use settings files and environment variables, and add .env / *.json with credentials to .gitignore.

🎯 What Both Examples Prove

Both walkthroughs are the same loop, just different stations — and Claude Code is present at nearly all of them:

Lifecycle stageExpense Canvas appJob-queue notifier
Buildpac connector + pac canvas create (+ Claude Code writes OpenAPI & Power Fx)Flow designer (+ Claude Code drafts filter & message copy)
Source controlpac canvas unpack/pack (Claude Code authors screens)pac solution unpack (Claude Code writes README/.gitignore)
Packagepac solution add-solution-componentpac solution add-solution-component
Deploypac solution export/importpac solution export/import (+ Claude Code generates settings JSON)
Operatepac canvas list/downloadpac power-automate …, pac env fetch (+ Claude Code builds a report script)

Learn that loop once and you can apply it to any Power Platform asset — apps, flows, connectors, plug-ins, Power Pages, and more.


🧰 Your Part 2 Cheat Sheet

# Auth & environments
pac auth create --environment <url>
pac env who
pac env list
# Canvas apps
pac canvas create --msapp <file> --connector-display-name "<connector>"
pac canvas unpack --msapp <file> --sources <dir> --layout SourceCode
pac canvas pack --sources <dir> --msapp <file> --layout SourceCode
pac canvas list
pac canvas download --name "<app>"
# Custom connectors
pac connector init --connection-template ApiKey --outputDirectory <dir>
pac connector create --api-definition-file <file> --api-properties-file <file>
# Solutions (ALM)
pac solution init
pac solution add-solution-component --solutionUniqueName <sol> --component <name> --componentType <type>
pac solution export --name <sol> --path <dir> --managed --overwrite
pac solution unpack --zipfile <zip> --folder <dir> --packagetype Unmanaged
pac solution import --path <zip> --activate-plugins --publish-changes --settings-file <json>
# Monitoring
pac power-automate list-cloud-flows
pac power-automate list-flow-runs --workflow-id <guid>
pac env fetch --xml "<fetch>…</fetch>"

🤖 Claude Code is the glue: it writes the OpenAPI spec, the Power Fx screens, the deployment settings, and the monitoring scripts — then runs every pac command above for you.

📝 Component types worth remembering: 29 = Workflow / cloud flow, 300 = Canvas app, 371 = Custom connector.


A Small Ask 🙏

If this was useful:

  • 💬 Comment with the first asset you’d automate with pac + Claude Code (apps? flows? plug-ins?)
  • 🔁 Share this with someone building their Power Platform ALM practice

Learning in public, one command at a time. 🚀


Useful Links

Getting Started with the Power Platform CLI (PAC CLI) on Windows (Part 1)

A beginner-friendly, from install to first commands.


👋 Why I’m Writing This (Note to My Network)

Power Platform work is moving fast from clicks to code and automation – and the one tool that keeps showing up in every serious ALM, DevOps, and pro-dev conversation is the Power Platform CLI (pac).

My intent with this post is simple: I want to give my LinkedIn community – Power Platform developers, ALM/DevOps engineers, admins, and anyone curious about moving beyond the maker portal – a clear, no-guesswork starting point. When I was getting started, the docs were great but scattered, and I wasted time on small gotchas (like pac --version not existing anymore). This write-up removes that friction.

Who this is for:

  • 🚀 New/aspiring Power Platform developers who want a real developer setup
  • 🛠️ Admins & makers ready to script repeatable tasks instead of clicking
  • ⚙️ ALM / DevOps folks building CI/CD pipelines for solutions
  • 📚 Anyone who wants a bookmarkable “install pac in 5 minutes” reference

What you’ll get: a working install, a verified setup, and a handful of first commands so you can do something useful the same day.

If this helps you, feel free to share it with your network. Now, let’s build. 💪


What is PAC CLI?

The Power Platform CLI (pac) is a cross-platform command-line tool that lets you work with Power Platform environments right from your terminal. Think of it as the developer-focused companion to the Power Platform admin center and the maker portal – and the engine behind most modern ALM and automation workflows.

With pac you can:

  • 🔐 Connect and authenticate to environments (pac auth)
  • 📦 Create, export, import, and manage Dataverse solutions (pac solution)
  • 🧩 Build and deploy PCF controls (pac pcf)
  • 🌐 Manage Power Pages sites (pac pages)
  • 🔁 Work with Power Automate, Copilot Studio, and Dataverse plug-ins
  • 🏢 Administer environments, licensing, and governance (pac admin, pac env)
  • 🤖 Bootstrap ALM pipelines (pac pipeline)

It works great interactively and inside CI/CD pipelines (Azure DevOps, GitHub Actions, and more).


Before You Start (Prerequisites)

  • ✅ Windows 10/11 (macOS and Linux also work)
  • ✅ The .NET SDK installed. This walkthrough used .NET SDK 9 and 10. PAC CLI 2.x targets .NET 8+, so a matching runtime is required.

💡 Quick tip: Not sure what you have? Check with:

dotnet --list-sdks
dotnet --list-runtimes

Which Install Method Should You Use?

There are two common ways to install PAC CLI on Windows. Here’s the honest comparison:

MethodBest forAdmin needed?Future updates
.NET global tool ⭐Devs who already have the .NET SDKNoOne command: dotnet tool update
MSI installerMachines without the .NET SDKYesManual reinstall

⚠️ There is currently no winget package for PAC CLI, so the two options above are the ones to use.

This guide uses the .NET global tool — it’s the cleanest option when the .NET SDK is already present, needs no admin rights, and updates in one command.


Step 1 — Install as a .NET Global Tool

Open PowerShell and run:

dotnet tool install --global Microsoft.PowerApps.CLI.Tool

You should see something like:

You can invoke the tool using the following command: pac
Tool 'microsoft.powerapps.cli.tool' (version '2.13.1') was successfully installed.

📁 The tool lands in %USERPROFILE%\.dotnet\tools, which the .NET SDK adds to your user PATH automatically. No fiddling required.


Step 2 — Verify the Installation

Open a new terminal (so the updated PATH is picked up) and run:

pac help

At the top you’ll see the version banner, for example:

Microsoft PowerPlatform CLI
Version: 2.13.1+g251dee1 (.NET 10.0.8)

Want to confirm the command is discoverable? Try:

Get-Command pac

📝 Heads-up (the gotcha I promised to save you): In current versions the version banner is printed by pac help. The classic pac --version flag may report “Not a valid command” — so use pac help instead.

Still not recognized? Add the tools folder to your PATH manually, then reopen the terminal:

$userPath = [Environment]::GetEnvironmentVariable("Path","User")
[Environment]::SetEnvironmentVariable("Path", "$userPath;$env:USERPROFILE\.dotnet\tools", "User")

Step 3 — Explore the Commands

See everything pac can do:

pac help

You’ll find command groups like admin, auth, solution, pcf, pages, plugin, pipeline, copilot, and many more. Don’t feel overwhelmed — you’ll use a handful of these 90% of the time.


Step 4 — Authenticate to an Environment

This is the first real step — connect to your environment:

# Interactive (browser) sign-in
pac auth create --environment https://yourorg.crm.dynamics.com
# List the authentication profiles you've created
pac auth list
# Select a profile by index
pac auth select --index 1

Step 5 — Your First Productive Commands

# List environments you can access
pac env list
# Export a solution to a zip
pac solution export --path ./exports --name MySolution
# Unpack a solution for source control
pac solution unpack --zipfile ./exports/MySolution.zip --folder ./src/MySolution
# List Power Apps in an environment
pac canvas list

Try two or three of these and you’ll already feel the “clicks → code” shift. 🎯


Keeping It Updated

Because it’s a .NET global tool, updates are a one-liner:

dotnet tool update --global Microsoft.PowerApps.CLI.Tool

Removing It (If Needed)

dotnet tool uninstall --global Microsoft.PowerApps.CLI.Tool

The MSI Alternative

No .NET SDK on the machine? Download the standalone MSI installer:

Run it and pac is added machine-wide. Just remember: updates require running a newer MSI, which is why the .NET tool is usually the nicer path for developers.


🎯 Summary

In just a few minutes you went from zero to a fully working PAC CLI:

  1. Installed it → dotnet tool install --global Microsoft.PowerApps.CLI.Tool
  2. Verified it → pac help
  3. Authenticated → pac auth create
  4. Started managing solutions and environments from the terminal

From here, PAC CLI becomes the backbone of automated Power Platform ALM. Wire these same commands into Azure DevOps or GitHub Actions, and you can build, test, and deploy solutions with the exact commands you just ran by hand. 🚀


A Small Ask 🙏

If this helped you, drop a comment with the first thing you automated with pac — I’d love to hear how others in the community are using it. And if you think someone in your network is starting their Power Platform journey, share
this post
with them. Let’s grow the community together. 🤝


Useful Links