A developer codes at dual monitors as a workflow diagram shows app integrations leading to an AI chatbot.
For years, building applications on the Microsoft Power Platform meant living in two separate worlds. On one side sat the drag-and-drop canvas of the browser-based maker portal; on the other sat the professional developer's local terminal, code editor, and Git repository. Even when writing pro-code extensions or modern Power Apps code apps, developers frequently had to pause their coding flow, tab over to a web browser, hunt down a connector in the Power Apps maker portal, configure a connection manually, and then wire it back into their project.

With the launch of Microsoft's AI at Work roadmap item 576782—tracked in the Microsoft 365 Message Center under MC1329302 for its June 1, 2026 public preview and MC1411144 for its July 31, 2026 general availability—that context-switching detour is no longer mandatory. The npm-based Power Apps CLI (invoked via the pa command) now allows developers and AI coding agents to discover available Power Platform connectors, provision connections, and generate strongly typed TypeScript data services directly from the command line.

A developer codes at dual monitors as a workflow diagram shows app integrations leading to an AI chatbot. Power Apps CLI Connector Workflow: Leaving the Browser Behind​

At the heart of this update is a straightforward premise: if you are building a Power Apps code app in an IDE like Visual Studio Code, your data plumbing should happen in the terminal alongside your build scripts and version control.

According to Microsoft Learn's Power Apps developer documentation, the workflow centers on the pa command-line tool, distributed globally via npm as @microsoft/power-apps-cli alongside @microsoft/power-apps. When a developer scaffolds a new project—such as pulling down Microsoft's Vite template via npx degit github:microsoft/PowerAppsCodeApps/templates/vite my-app—and runs pa app init, the CLI authenticates against the user's Power Platform account and records the target environment inside a project-root power.config.json file.

From that point forward, every connector and connection operation runs against the environment specified in power.config.json without requiring a trip to the web portal.

CLI CommandPrimary PurposeKey Options & Output Behavior
pa connector listLists connectors available in the configured Power Platform environmentAccepts --search <term> (filters by name or display name) and --json. Interactive terminals page results 20 rows at a time; --json or output redirection returns the full list, including isTabular.
pa connection createCreates a new connection for a specified connector in the active environmentRequires --connector <connector-id> (e.g., shared_office365, shared_teams). Optional --display-name and --json. Returns the new Connection ID upon success.
pa connection listLists existing connections and their metadata in the current environmentRetrieves the Connection ID and connector identifier if you did not save the output from pa connection create.
pa connection list-datasetsLists available datasets for a tabular connection (e.g., SQL Server or SharePoint sites)Requires --connector and --connection-id.
pa connection list-tablesLists available tables or lists inside a specific datasetUses --connector, --connection-id, and --dataset.
pa connection list-proceduresLists available SQL stored procedures within a datasetRequires --connection-id and --dataset.
pa app add data-sourceWires a connection or native Dataverse table into the code app and generates TypeScript models and servicesSupports --connector, --connection-id, --connection-ref, --solution-id, --dataset, --table, --procedure, and --as (table or action).
pa app refresh data-sourceRegenerates the local TypeScript model and service files when an underlying schema changesRequires --name <data-source-name> (and --connector where applicable).
pa app remove data-sourceRemoves a wired data source from the code appRequires --connector <connector-id> and --name <data-source-name>.

Section Summary: The pa CLI brings connector discovery (pa connector list), connection provisioning (pa connection create), and data-source binding (pa app add data-source) into the local terminal, anchoring all operations to the environment defined in power.config.json.

Step-by-Step: Discovering, Creating, and Wiring Connectors​

How does this look in an actual development session? Microsoft Learn outlines a clear sequence for taking a code app from an initialized repository to calling live enterprise services.

1. Discover Available Connectors​

From the root directory of an initialized code app, you can query what connectors exist in your Power Platform environment:

pa connector list --search teams

In an interactive terminal, the CLI pages results in groups of 20 rows (press Enter to advance, or Esc / Q to quit). Each entry displays the connector's display name, its system identifier (such as shared_teams or shared_office365), and an isTabular boolean flag indicating whether the connector supports table-based data operations. If you are scripting the lookup or feeding it into a tool, passing --json bypasses pagination and dumps the full metadata array.

2. Create or Locate a Connection​

Once you know the connector identifier, you create a connection directly from the terminal:

pa connection create --connector shared_teams --display-name "My Teams"

When the command completes, it returns a Connection ID. If you already created a connection earlier or forgot to copy the ID from your terminal buffer, running pa connection list prints a table of existing connections and their IDs in the current environment.

3. Wire the Data Source and Generate TypeScript Services​

Here is where the CLI goes beyond simple administrative plumbing. Running pa app add data-source does not merely register a configuration string; it inspects the connector schema and automatically generates strongly typed TypeScript model and service files inside your repository.

For a non-tabular (action-based) connector like Office 365 Users (shared_office365users), the command requires only the connector and connection ID:

pa app add data-source --connector "shared_office365users" --connection-id "<connection-id>"

Executing that command creates Office365UsersModel.ts (defining request and response interfaces) and Office365UsersService.ts inside your project's generated folders (src/generated/models and src/generated/services). You can then import Office365UsersService directly into your TypeScript components and call methods like await Office365UsersService.MyProfile_V2(...) with full IDE autocomplete and compile-time type checking.

For tabular connectors like SQL Server (shared_sql) or SharePoint, you also pass the dataset and table name:

Code:
# Discover SQL datasets and tables first
pa connection list-datasets --connector "shared_sql" --connection-id "<connection-id>"
pa connection list-tables --connector "shared_sql" --connection-id "<connection-id>" --dataset "server.database.windows.net,dbname"

# Wire the table into the code app
pa app add data-source \
  --connector "shared_sql" \
  --connection-id "<connection-id>" \
  --dataset "server.database.windows.net,dbname" \
  --table "[dbo].[MobileDeviceInventory]"

Microsoft Learn notes a crucial detail here: table and dataset names are case-sensitive and often contain special characters or URL encoding (for example, a SharePoint list might require --table "Travel%20Request" paired with the SharePoint site URL as --dataset), so developers should copy the exact Name string returned by pa connection list-tables. Alternatively, running pa app add data-source with no parameters in an interactive terminal launches a guided prompt that lets you browse connections, pick datasets, and search tables interactively.

Section Summary: Wiring a connector via pa app add data-source links the Power Platform connection to the project and generates local TypeScript model and service classes, supporting both action-based connectors and multi-table SQL or SharePoint datasets.

Agentic Prompt-to-App Workflows: Why CLI Parity Matters for AI​

Why did Microsoft prioritize putting connector discovery and connection creation into an npm CLI alongside agent.md documentation files? Look at how AI coding assistants—such as GitHub Copilot agent mode in Visual Studio Code—actually operate.

An AI coding agent living inside an IDE cannot easily click through a multi-step web wizard in the Power Apps maker portal to set up a SharePoint or Outlook connection. However, an agent can execute terminal commands, parse JSON output (--json), and read generated TypeScript files.

Along with the CLI commands, Roadmap ID 576782 introduces new code app agent.md instruction files and how-to documentation designed specifically for prompt-to-app workflows. When a developer prompts a coding agent to build an internal application, the agent can follow the patterns in agent.md to:

  1. Query the environment via pa connector list --json and pa connection list --json to see what data sources are available.
  2. Provision a missing connection via pa connection create or bind an existing one via pa app add data-source.
  3. Inspect the resulting TypeScript interfaces in src/generated/models and wire the UI components to src/generated/services without human copy-pasting.

That said, veteran IT administrators and developers should keep realistic expectations about where automation stops. While the CLI and agent.md files remove manual portal setup during app generation, they do not bypass Power Platform security or tenant governance. Running pa app init or pa app add flow still requires an authenticated user or authorized service principal that actually has permission to access the environment and underlying connections. An AI agent can run the CLI commands on your behalf, but it only inherits the privileges of the authenticated session.

Section Summary: By exposing connector discovery and JSON outputs on the command line alongside agent.md templates, Microsoft gives IDE-based AI coding agents a scriptable path to connect generated code apps to enterprise data without human browser intervention.

Important Caveats, Unsupported Connectors, and ALM Realities​

Before you throw out your existing scripts or drop pa app add data-source into an automated CI/CD pipeline, Microsoft Learn's documentation highlights several architectural boundaries and edge cases you need to plan around:

  • Two Notable Connector Exclusions: While Microsoft states that all Power Platform connectors are officially supported by the code app data-connection workflow, there are two explicit exceptions that are not yet supported: Excel Online (Business) and Excel Online (OneDrive). If your legacy departmental app relies on spreadsheets stored in OneDrive or SharePoint as a makeshift database, you will need to migrate that data to SharePoint lists, SQL, or Dataverse before wiring it into a code app via the CLI.
  • Hybrid Table/Action Connectors and CI/CD Failures: Connectors like SharePoint and SQL Server support both tabular data operations and standalone actions. If you run pa app add data-source for one of these connectors without specifying --table, --procedure, or --as, an interactive terminal will pause and ask Add a table?. In a non-interactive environment—such as an automated CI/CD build or a non-interactive agent shell—the command will fail unless you explicitly pass --as table or --as action.
  • Batching Tables vs. Single-Item Limits: You can add multiple tables from the same connector, connection, and dataset in a single command by repeating the --table flag. If one table fails validation, the CLI still adds the valid tables, reports the ordered successes and failures, and exits with a nonzero status code. However, native Dataverse tables and SQL stored procedures (--procedure) are limited to one per command.
  • Native Dataverse Works Differently: Adding a native Dataverse table (--connector dataverse --table account) does not use a connection ID, connection reference, or dataset parameter; instead, it relies on the table's logical name and, if not already set, the --org-url parameter. Furthermore, Dataverse actions and functions are added via pa app add dataverse-api (discovered via pa app find-dataverse-api) rather than --as action.
  • Using Connection References for Enterprise ALM: Binding an app directly to a personal --connection-id is fine for rapid prototyping, but it creates headaches when moving across Dev, Test, and Production environments. For proper Application Lifecycle Management (ALM), the CLI supports Power Platform solutions and connection references. Developers can run pa solution list to grab a solution ID, run pa connection list-references --solution-id <solution-id> to find the connection reference's logical name (such as cr123_sharedsharepointonline_1a2b3, not its display name), and pass --solution-id and --connection-ref to pa app add data-source.
  • Local Play Browser Restrictions in Edge and Chrome: When testing a code app locally via pa app run (or npm run dev), the CLI spins up a local server and provides a "Local Play" URL hosted on Power Apps that communicates with localhost. Microsoft warns that both Microsoft Edge and Google Chrome block requests from public origins to local network endpoints by default. Developers must test inside the same browser profile authenticated to their Power Platform tenant, grant local-network access permission when prompted by the browser (or have IT configure enterprise browser policies), and include allow="local-network-access" if embedding via an iframe.

Section Summary: Developers adopting the new CLI workflow must account for the lack of Excel Online connector support, mandatory --as flags in non-interactive scripts, solution-aware connection references for ALM, and Chromium local-network security prompts during local testing.

What This Means for Power Platform Developers and Admins​

The general availability of connector commands in the Power Apps CLI marks a maturing point for Power Apps code apps. Instead of treating code-first apps as second-class citizens that still require constant trips to the maker portal for data wiring, Microsoft has closed the loop inside the terminal.

For human developers, pa connector list, pa connection create, and pa app add data-source translate into fewer broken trains of thought and immediate TypeScript type safety against enterprise schemas. For teams experimenting with AI-assisted development, the combination of deterministic CLI flags, JSON outputs, and agent.md documentation means an IDE coding agent can generate not just a pretty React or Vite front end, but one that is already wired to live SharePoint lists, SQL databases, or Microsoft 365 services.

 

References

  1. PowerApps: Building modern apps - Use CLI to discover, create, and wire connectors in code apps Microsoft 365 Roadmap 2026-10-16T19:09:00.607348Z
  2. Use CLI to discover, create, and wire connectors in code apps | Microsoft Learn learn.microsoft.com
  3. How to: Create a Connection from the Power Apps CLI - Power Apps | Microsoft Learn learn.microsoft.com