Edit

Share via


pac code

(Preview) Commands to manage your Code apps.

Note

Starting with Power Apps SDK v1.0.4 and higher, the SDK includes an npm-based CLI for code apps. This new CLI reduces prerequisites for building code apps and will replace these commands, which will be deprecated in a future release. To learn more about the new commands and get started, see Quickstart with new npm CLI.

Commands

Command Description
pac code add-data-source Adds a new datasource to the app.
pac code delete-data-source Deletes a data source from the current app.
pac code init Initializes a Code app in the current directory.
pac code list Lists the code apps available in the current environment.
pac code list-connection-references Lists connection references in the specified environment and solution.
pac code list-datasets Lists datasets accessible by the provided connector.
pac code list-sql-stored-procedures Lists stored procedures accessible by the provided SQL connection and dataset.
pac code list-tables Lists tables accessible by the provided connector and dataset.
pac code push Publishes a new version of a Code app.
pac code run Runs a local server for connections loading locally in the app.

pac code add-data-source

Adds a new datasource to the app.

Required Parameters for code add-data-source

--apiId -a

The api id of the datasource.

Optional Parameters for code add-data-source

--connectionId -c

The connection id of the datasource.

--connectionRef -cr

The connection reference ID.

--dataset -d

The dataset name of the datasource.

--environment -env

The environment URL to connect to the data source.

--logLevel -l

The logging level for the command.

--solutionId -s

The solution ID of the connection reference. Used only when connection reference parameter is present.

--storedProcedure -sp

The stored procedure name to add (only supported for shared_sql).

--table -t

The table name of the datasource.

pac code delete-data-source

Deletes a data source from the current app.

Required Parameters for code delete-data-source

--apiId -a

The api id of the datasource.

--dataSourceName -ds

The name of the data source to delete.

Optional Parameters for code delete-data-source

--storedProcedure -sp

The stored procedure name to remove from the app.

pac code init

Initializes a Code app in the current directory.

Required Parameters for code init

--displayName -n

The display name of the Code app.

Optional Parameters for code init

--appUrl -a

The local url the app is running on.

--buildPath -b

The directory of your apps build assets.

--description -d

The description of the Code App.

--environment -env

Specifies the target Dataverse. The value may be a Guid or absolute https URL. When not specified, the active organization selected for the current auth profile will be used.

--fileEntryPoint -f

The entry point for the app to load from.

--logoPath -l

The path to the logo file for the app.

--region -c

The region to host the Code app in.

pac code list

Lists the code apps available in the current environment.

pac code list-connection-references

Lists connection references in the specified environment and solution.

Required Parameters for code list-connection-references

--solutionId -s

The ID of the solution to list connection references from.

Optional Parameters for code list-connection-references

--environment -env

The environment URL to list connection references from. If not provided, uses the current environment.

pac code list-datasets

Lists datasets accessible by the provided connector.

Required Parameters for code list-datasets

--apiId -a

The api id of the datasource.

Optional Parameters for code list-datasets

--connectionId -c

The connection id of the datasource.

pac code list-sql-stored-procedures

Lists stored procedures accessible by the provided SQL connection and dataset.

Required Parameters for code list-sql-stored-procedures

--connectionId -c

The connection id of the datasource.

--dataset -d

The dataset name of the datasource.

pac code list-tables

Lists tables accessible by the provided connector and dataset.

Required Parameters for code list-tables

--apiId -a

The api id of the datasource.

Optional Parameters for code list-tables

--connectionId -c

The connection id of the datasource.

--dataset -d

The dataset name of the datasource.

pac code push

Publishes a new version of a Code app.

Optional Parameters for code push

--environment -env

Specifies the target Dataverse. The value may be a Guid or absolute https URL. When not specified, the active organization selected for the current auth profile will be used.

--solutionName -s

The Solution Name for the code app to associate with.

pac code run

Runs a local server for connections loading locally in the app.

Optional Parameters for code run

--appUrl -a

The local url the app is running on.

--port -p

The port to run the local server on.

See also

Microsoft Power Platform CLI Command Groups
Microsoft Power Platform CLI overview