Excluding Specific Actions While Including Others When Using Deploy CLI

Hi folks.

I have created a DevOps Pipeline which automates the deployment of Auth0 changes to the staging, dev and prod tenants. I have tested it by deploying the dev tenant config to staging but not done any deployments to dev or prod.

When it comes time to do the dev to prod tenant deployment, we have a potential problem: the dev tenant has 12 custom actions that prod tenant does not and my manager wants the pipeline to exclude those 12 extra actions when the DEV>PROD deployment happens so they stay in dev but don’t go into prod.

How do I accomplish this?

For context, here is the snippet of the pipeline doing the dev to prod deployment. I have censored the sensitive information as those are variables anyway:

  • stage: Deploy_Prod

    displayName: ‘Deploy to Prod’

    dependsOn: Deploy_Dev

    jobs:

    • job: DeployProd

      displayName: ‘Deploy Config to Auth0 Prod’

      pool:

      vmImage: ‘ubuntu-latest’

      steps:

      • checkout: self

      • task: NodeTool@0

        displayName: ‘Install Node.js’

        inputs:

        versionSource: ‘spec’

        versionSpec: ‘22.x’

      • task: CmdLine@2

        displayName: ‘Install Auth0 Deploy CLI via npm’

        inputs:

        script: ‘npm install -g auth0-deploy-cli’

      • script: |

        a0deploy import --config_file=tenant/config-prod.json --input_file=tenant.yaml

        displayName: ‘Deploy Config to Auth0 Prod’

        workingDirectory: tenant

        env:

        AUTH0_DOMAIN: $(prod_domain)

        AUTH0_CLIENT_ID: $(prod_client_id)

        AUTH0_CLIENT_SECRET: $(prod_client_secret)

        AUTH0_INCLUDED_ONLY: ‘[“actions”, “branding”, “emailTemplates”, “pages”]’

From your pipeline snippet, you deploy by running a0deploy import --config_file=tenant/config-prod.json --input_file=tenant.yaml . This means that any Auth0 entities (clients, actions, etc.) defined in tenant.yaml will get deployed to the prod tenant.

You could define two tenant.yaml files, one containing entities that exist in both dev and prod, and another for just dev entities. In your deploy config file (tenant/config-prod.json) set "AUTH0_ALLOW_DELETE": false so that when you import, it won’t delete entities from your tenant that don’t exist in the tenant.yaml you are importing.

Wait, in this page of documentation, it says I can do this for connections: “AUTH0_EXCLUDED_CONNECTIONS”: [“con_O1H3KyRMFP1IWRq3”, “con_9avEYuj19ihqKBOs”]. Could I not just do something like this but with actions?