Connect to SQL Server from Power Apps
Connect to SQL Server, in either Azure or an on-premises database, so that you can manage your data with create, read, update, and delete operations.
Note
Newly created SQL data sources are no longer prefixed with "[dbo]" as they have been in previous versions of Power Apps. See the common issues and resolutions page for more information.
Prerequisites
Sign up for Power Apps, and then sign in by providing the same credentials that you used to sign up.
Gather the following information for a database that contains at least one table with a primary key:
the name of the database
the name of the server on which the database is hosted
a valid user name and password to connect to the database
the type of authentication needed to connect to the database
If you don't have this information, ask the administrator of the database that you want to use.
For an on-premises database, identify a data gateway that was shared with you (or create one).
Generate an app automatically
In Power Apps Studio, click or tap New on the File menu (along the left edge).
Under Start with your data, click or tap the right arrow at the end of the row of connectors.
If you already have a connection to the database that you want to use, click or tap it, and then skip to step 7 in this procedure.
Click or tap New connection, and then click or tap SQL Server.
Perform either of these steps:
Specify Connect directly (cloud services), and then type or paste the server name, the database name, the user name, and the password for the database that you want to use.
Specify Connect using on-premises data gateway, type or paste the server name, the database name, the user name, and the password for the database that you want to use, and specify the authentication type and the gateway.
Note
If you don't have a gateway, install one, and then click or tap Refresh gateway list.
Click or tap Connect.
Click or tap an option under Choose a dataset, click or tap an option under Choose a table, and then click or tap Connect.
Power Apps creates an app that shows data on three screens. Heuristics suggest what kind of data to show, but you might need to customize the UI to suit your needs.
Customize the app by using techniques that are similar to those that Create an app from Excel describes, starting with changing the app layout.
Build an app from scratch
Sign in to powerapps.com with the same account that you used to sign up for Power Apps.
In the left navigation bar, click or tap Connections:
In the upper-right corner, click or tap New connection, and then click or tap SQL Server.
Perform either of these steps:
Specify Connect directly (cloud services), and then type or paste the server name, the database name, the user name, and the password for the database that you want to use.
Specify Connect using on-premises data gateway, type or paste the server name, the database name, the user name, and the password for the database that you want to use, and specify the authentication type and the gateway.
Note
If you don't have a gateway, install one, and then click or tap the clockwise icon to refresh the list.
Click or tap Create to create the connection.
Create an app by using techniques that are similar to those that Create an app from scratch describes.
Update an existing app
In Power Apps Studio, open the app that you want to update.
Click or tap Data sources on the View tab of the ribbon.
In the right-hand pane, click or tap Add a data source.
Click or tap New connection, click or tap SQL Server, and then click or tap Connect.
Perform either of these steps:
Specify Connect directly (cloud services), and then type or paste the server name, the database name, the user name, and the password for the database that you want to use.
Specify Connect using on-premises data gateway, type or paste the server name, the database name, the user name, and the password for the database that you want to use, and specify the authentication type and the gateway.
Note
If you don't have a gateway, install one, and then click or tap the circular icon to refresh the list.
Click or tap Connect.
Under Choose a dataset, click or tap an option.
Under Choose a table, select one or more checkboxes, and then click or tap Connect.
Next steps
- Learn how to show data from a data source.
- Learn how to view details and create or update records.
- See other types of data sources to which you can connect.
- Understand tables and records with tabular data sources.
Feedback
Submit and view feedback for