Connect Code Apps to Data

Connect Your Code App to Data

How to: Connect Your Code App to Data

Code apps support integration with Power Platform connectors for secure data access. All connections must be created and managed in Power Apps.

Create and Set Up Connections in Power Apps

  1. Create and configure connections from the Power Apps Connections page.
  2. Supported connectors include:
    • Dataverse (CRUD operations)
    • SQL Server
    • SharePoint
    • Office 365 Users & Groups
    • Azure Data Explorer
    • OneDrive
    • Microsoft Teams
    • Translator
    • Weather

Launch the Power Apps Connections Page

Power Apps Connections Page

Go to Power Apps and navigate to the Connections page from the left-hand navigation.


Example: Create an Office 365 Users Connection

  1. Select + New connection.
  2. Select Office 365 Users.
  3. Select Create.
Office 365 Users Connection

Get Connection Metadata for All Created Connections

There are two ways to retrieve connection metadata:

  1. Using PAC CLI:
    Run pac connection list to view all connections along with their Connection ID and API Name.
  2. Using Power Apps URL:
    Open a connection in Power Apps and copy the API Name and Connection ID from the browser URL.
Connection URL Metadata

Add Data Sources to a Code App

  1. Create or identify existing connections in Power Apps and collect the API Name and Connection ID.
  2. Add data sources to the code app using the Power Platform CLI (PAC).
  3. Supported data source types include:
    • Nontabular data sources (e.g., Office 365 Users)
    • Tabular data sources (e.g., SQL Server, SharePoint tables)
    • SQL stored procedures
  4. Adding a data source automatically generates typed TypeScript models and service files.
  5. If a data source schema changes, delete and re-add the data source to regenerate the models.

Use Connections, Validate, and Deploy


Related Information