Using Deploy CLI to automate applying API Access from Dev tenant applications to Staging tenant

Hi all.

We have 3 Auth0 tenants in my organization: staging, dev and prod.

Staging is a pretty new tenant and I have used the Deploy CLI in my Azure DevOps pipeline to populate it with resources by applying the Dev tenant config. This has created the email templates, applications, actions etc.

However, the APIs in staging did not have the exact same client access as their Dev counterparts.

Is it possible to use the Deploy CLI to apply the same permissions and Client Access levels to the APIs in staging that they have in Dev?

In the docs, I see it lists the supported resource types. Are any of them applicable here? Auth0 Deploy CLI - Auth0 Docs

Hi @shayan.bhattacharya

Thank you for reaching out to us!

I understand that you are having issues with importing the API client accesses from your Dev tenant to your Staging one, via Auth0 Deploy CLI.

Overview

The Deploy CLI supports managing resource servers (APIs), which includes configurations for permissions and scopes. You can export your configuration from the Dev tenant (e.g., as YAML or JSON) and apply it to the staging tenant using a CI/CD workflow, however, the Deploy CLI requires a dedicated Auth0 application (Machine to Machine) to interact with the Management API.

You must ensure that the “Deploy CLI” application in the staging tenant is authorized to access the Auth0 Management API and has the specific permissions (scopes) required to manage APIs, such as create:resource_servers, update:resource_servers, read:resource_servers, and delete:resource_servers. If the staging tenant’s Deploy CLI application lacks these permissions, it won’t be able to apply the API configurations properly.

Recommended Actions:

  1. Check Deploy CLI Application Scopes: In your staging tenant, go to Dashboard > Applications > Applications, find the Deploy CLI application, and ensure it has the appropriate scopes authorized for the Auth0 Management API.

  2. Verify Exported Configuration: Ensure your exported configuration files (YAML/JSON) from the Dev tenant actually include the API permissions and client access settings before applying them to staging.

Hope this helped you apply the Dev settings to your Staging tenant!

Have a great one,
Gerald