Install and Configure the Deploy CLI Tool
This guide will show you how to install the Deploy CLI tool and configure it using the Deploy CLI extension. To do this, you must:
Install the Deploy CLI Tool
Install the Deploy CLI Extension
Configure the Deploy CLI Tool
Run the Deploy CLI Tool
You can also upgrade from a previous version of the tool. The auth0-deploy-cli
tool was completely rewritten from version 1 to version 2 or later, which means that it is not backwards compatible. Please consider the following when upgrading:
The directory structure and format has changed to allow for additional object types.
The command line parameters have changed to allow for additional options, such as export.
Install the Deploy CLI Tool
To install the Deploy CLI Tool, use the command-line interface to run:
npm i -g auth0-deploy-cli
Install the Deploy CLI Extension
The Deploy CLI tool must be authorized to call the Management API. To do this, the Auth0 Deploy CLI extension configures your tenant by creating and configuring an application named auth0-deploy-cli-extension and authorizing it for use with the Management API. Later, you will use the Client ID and Secret from this application to configure the Deploy CLI Tool.
Navigate to Auth0 Dashboard > Extensions, locate the Auth0 Deploy CLI extension, and click the extension.
Click Install.
From the list of installed extensions, click Auth0 Deploy CLI, then click Accept to consent to allow the extension to access your data.
Configure the Deploy CLI Tool
To configure the Deploy CLI tool to use the Deploy CLI application, create a config.json file, including the Client ID and Client Secret from the auth0-deploy-cli-extension application. You can find this application at Auth0 Dashboard > Applications.
{
"AUTH0_DOMAIN": "YOUR_DOMAIN",
"AUTH0_CLIENT_ID": "YOUR_CLIENT_ID",
"AUTH0_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
"AUTH0_KEYWORD_REPLACE_MAPPINGS": { "AUTH0_TENANT_NAME": "YOUR_TENANT" },
"AUTH0_ALLOW_DELETE": false,
"AUTH0_EXCLUDED_RULES": [ "rule-1-name" ]
}
Run the Deploy CLI Tool
To run the Deploy CLI Tool, use the command-line interface to run:
a0deploy export --config_file config.json --format yaml --output_folder <your repo directory>