Deployment Best Practices
Use automated deployment for rules
Coding a rule within the Auth0 Dashboard rule editor is a great way to implement and test while still in the development stage. However, when it comes time to deploy into automated test or production environments, a more automated mechanism is required; copying and pasting code between Auth0 tenants is not a satisfactory method to employ.
Set up version control extensions
Changes made to a rule deployed to an Auth0 tenant will be made live immediately because changes instantly overwrite what is already there. We recommended that you use version control such as Git via GitHub or the like, is employed to provide change management capability.
Auth0 provides automated deployment methods for rules between Auth0 tenant environments. The Auth0 GitHub, GitLab, and Bitbucket extensions allow you to update rules from the version control system—both manually and automatically (for example, when a change in the version control system is detected).
Use Deploy CLI tool for rule import and export
In addition, the Auth0 Deploy CLI tool can be used to automate deployment between Auth0 tenants. Deploy CLI works with files stored in the file system together with the Auth0 Management API and provides the capability to allow the export of rule assets from an Auth0 tenant, as well as import of them into an Auth0 tenant. Further, the tool provides for programmatic control over rule ordering and rule environment configuration as part of deployment automation.
As a best practice, you should use the Auth0 Deploy CLI tool in almost all cases involving deployment to test or production environments. While the extensions can provide automated detection of changes deployed to the respective version control system, the Deploy CLI tool allows precise control of what’s deployed when, where, and how.
Set up test tenants
We recommend that you set up a separate Test Tenant in Auth0 to provide safe testing of any rules before deploying to production