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.
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 Command | Primary Purpose | Key Options & Output Behavior |
|---|---|---|
pa connector list | Lists connectors available in the configured Power Platform environment | Accepts --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 create | Creates a new connection for a specified connector in the active environment | Requires --connector <connector-id> (e.g., shared_office365, shared_teams). Optional --display-name and --json. Returns the new Connection ID upon success. |
pa connection list | Lists existing connections and their metadata in the current environment | Retrieves the Connection ID and connector identifier if you did not save the output from pa connection create. |
pa connection list-datasets | Lists available datasets for a tabular connection (e.g., SQL Server or SharePoint sites) | Requires --connector and --connection-id. |
pa connection list-tables | Lists available tables or lists inside a specific dataset | Uses --connector, --connection-id, and --dataset. |
pa connection list-procedures | Lists available SQL stored procedures within a dataset | Requires --connection-id and --dataset. |
pa app add data-source | Wires a connection or native Dataverse table into the code app and generates TypeScript models and services | Supports --connector, --connection-id, --connection-ref, --solution-id, --dataset, --table, --procedure, and --as (table or action). |
pa app refresh data-source | Regenerates the local TypeScript model and service files when an underlying schema changes | Requires --name <data-source-name> (and --connector where applicable). |
pa app remove data-source | Removes a wired data source from the code app | Requires --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:
# 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:
- Query the environment via
pa connector list --jsonandpa connection list --jsonto see what data sources are available. - Provision a missing connection via
pa connection createor bind an existing one viapa app add data-source. - Inspect the resulting TypeScript interfaces in
src/generated/modelsand wire the UI components tosrc/generated/serviceswithout 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-sourcefor one of these connectors without specifying--table,--procedure, or--as, an interactive terminal will pause and askAdd 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 tableor--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
--tableflag. 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-urlparameter. Furthermore, Dataverse actions and functions are added viapa app add dataverse-api(discovered viapa app find-dataverse-api) rather than--as action. - Using Connection References for Enterprise ALM: Binding an app directly to a personal
--connection-idis 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 runpa solution listto grab a solution ID, runpa connection list-references --solution-id <solution-id>to find the connection reference's logical name (such ascr123_sharedsharepointonline_1a2b3, not its display name), and pass--solution-idand--connection-reftopa app add data-source. - Local Play Browser Restrictions in Edge and Chrome: When testing a code app locally via
pa app run(ornpm run dev), the CLI spins up a local server and provides a "Local Play" URL hosted on Power Apps that communicates withlocalhost. 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 includeallow="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
- PowerApps: Building modern apps - Use CLI to discover, create, and wire connectors in code apps Microsoft 365 Roadmap · 2026-10-16T19:09:00.607348Z
- Use CLI to discover, create, and wire connectors in code apps | Microsoft Learn learn.microsoft.com
- How to: Create a Connection from the Power Apps CLI - Power Apps | Microsoft Learn learn.microsoft.com