Table of Contents
- Key Highlights
- Introduction
- What app automation tokens are — and what they replace
- Generating and configuring an app automation token in the Dev Dashboard
- Running Shopify CLI deploys in CI: minimal command and examples
- Real-world release patterns using app automation tokens
- Migrating from Partner Dashboard CLI tokens: checklist and rollout plan
- Best practices for token lifecycle, security, and least privilege
- Troubleshooting common deployment issues
- Practical considerations for complex apps and extension components
- Compliance, auditing, and governance for automated deployments
- Future-proofing your CI/CD with app automation tokens
- FAQ
Key Highlights
- App automation tokens, available in the Dev Dashboard, enable app-scoped authentication so CI/CD tools can deploy Shopify apps securely using the Shopify CLI.
- Replace Partner Dashboard CLI tokens by generating app automation tokens, storing them as CI secrets, and running
shopify app deploy --config production --allow-updatesin your pipeline for automated releases.
Introduction
Shopify now supports app deployment in CI/CD pipelines for all apps through app automation tokens issued in the Dev Dashboard. These tokens authenticate the Shopify CLI with permissions tied to a single app, providing stronger isolation and simpler management compared with the previous Partner Dashboard CLI tokens. For teams adopting automated release workflows—GitHub Actions, GitLab CI, Bitbucket, or enterprise pipelines—app automation tokens streamline deployments and reduce risk by giving per-app credentials that can be rotated or revoked independently.
The change shifts how teams secure automated operations, from global or user-scoped tokens to narrowly scoped app credentials. The result: fewer blast-radius concerns, cleaner audit and rotation practices, and a straightforward integration path for common CI/CD tools. Below is a practical guide to what app automation tokens offer, how to create and use them in CI/CD, migration steps, best practices, troubleshooting tips, and real-world patterns you can adopt immediately.
What app automation tokens are — and what they replace
App automation tokens are short-lived, app-scoped credentials created in the Dev Dashboard that grant the Shopify CLI authorization to act on behalf of a specific Shopify app. They replace the CLI tokens previously generated in the Partner Dashboard, eliminating the need for broader-scoped or user-tied credentials when automating app deployment.
Key benefits:
- App-specific scope: Each token is tied to a single app, preventing cross-app access if a token is compromised.
- Easier revocation: Revoke an app token without affecting other apps or team members.
- CI-friendly: Store tokens as CI secrets and reference them when calling Shopify CLI commands.
Existing Partner Dashboard CLI tokens will continue working until they expire, but migrating to app automation tokens is the recommended approach for production automation.
Official resources:
- Managing app automation tokens: https://shopify.dev/docs/apps/build/dev-dashboard/app-automation-tokens
- Deploy app components in a CD pipeline: https://shopify.dev/docs/apps/launch/deployment/deploy-in-ci-cd-pipeline
Generating and configuring an app automation token in the Dev Dashboard
Generating an app automation token is a Dev Dashboard operation. The following outline explains the typical steps and practical considerations to create and prepare a token for CI use.
Steps to create an app automation token
- Open the Shopify Dev Dashboard and select the app you want to automate.
- Find the App Automation Tokens section (the UI labels may evolve; look under app settings or security/automation settings).
- Create a new automation token. Name it to reflect its purpose and environment—e.g., "CI: GitHub Actions (production)".
- Copy the token value immediately. For security reasons, the UI may show the token only once upon creation.
- Save the token into your CI provider’s secret storage (e.g., GitHub repository or organization secrets, GitLab CI/CD variables, AWS Secrets Manager). Do not commit tokens to source.
Naming and scoping considerations
- Include environment and usage in the token name (e.g., app-name-prod-deploy) so token purpose is evident during audits.
- Generate separate tokens for staging and production pipelines to limit exposure.
- Use per-app tokens rather than a single token for multiple apps; this reduces blast radius.
Handling token visibility and storage
- Treat the token as a secret. Copy it once and store it only in an encrypted secret vault.
- Do not paste tokens into chat, code comments, or issue trackers.
- If token visibility is required for transfer, use protected channels with limited access and delete copies after secure handoff.
Running Shopify CLI deploys in CI: minimal command and examples
App automation tokens are designed to integrate with the Shopify CLI for automated app releases. The minimal pattern used by CLI-based pipelines is:
- Export the token to an environment variable that the CLI reads.
- Run the deploy command with the appropriate config.
A simple shell command pattern:
export SHOPIFY_APP_AUTOMATION_TOKEN="<token>"
shopify app deploy --config production --allow-updates
Key points about the command:
- The CLI reads the
SHOPIFY_APP_AUTOMATION_TOKENenvironment variable. Set this in your CI as a secret. -
--config productiontells the CLI to use settings from your local configuration for the production environment. Adjust tostagingor another config as appropriate. -
--allow-updatesis required for upgrades to deployed app components; omit or adjust according to your workflow and CLI behavior.
Below are concrete CI provider examples and sample YAML for common scenarios.
GitHub Actions example
- Store your token as a repository or organization secret named SHOPIFY_APP_AUTOMATION_TOKEN.
- A basic workflow uses a step to install the Shopify CLI, sets the secret as an environment variable, and calls the deploy command.
Example workflow:
name: Deploy Shopify App
on:
push:
branches:
- main
- release/**
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
curl -fsSL https://shopify.dev/cli/install.sh | bash
shopify version
- name: Deploy to Shopify
env:
SHOPIFY_APP_AUTOMATION_TOKEN: ${{ secrets.SHOPIFY_APP_AUTOMATION_TOKEN }}
run: |
shopify app deploy --config production --allow-updates
Notes:
- Use the fastest approved method to install the Shopify CLI in your environment. The example uses a bootstrap script; adjust to your organization’s installation and caching policies.
- Running
shopify versionconfirms the installed version for debugging and audit logs.
GitLab CI example
- Add the token to Project > Settings > CI/CD > Variables as SHOPIFY_APP_AUTOMATION_TOKEN and set it to "protected" and "masked" if appropriate.
.gitlab-ci.yml:
stages:
- deploy
deploy_prod:
stage: deploy
image: ubuntu:22.04
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://shopify.dev/cli/install.sh | bash
- shopify app deploy --config production --allow-updates
only:
- main
variables:
SHOPIFY_APP_AUTOMATION_TOKEN: $SHOPIFY_APP_AUTOMATION_TOKEN
Bitbucket Pipelines example
- Store the secret in Repository settings > Pipelines > Repository variables.
bitbucket-pipelines.yml snippet:
pipelines:
branches:
main:
- step:
name: Deploy to Shopify
image: alpine:3.16
script:
- apk add --update curl bash
- curl -fsSL https://shopify.dev/cli/install.sh | bash
- export SHOPIFY_APP_AUTOMATION_TOKEN=$SHOPIFY_APP_AUTOMATION_TOKEN
- shopify app deploy --config production --allow-updates
Adapting patterns for enterprise CI tools
- For Jenkins, TeamCity, or Azure Pipelines, inject the token into a secure environment variable and run the same
shopifycommand in a build agent step. - For containers and infrastructure as code, use the token to perform app component updates as part of your release pipeline.
Real-world release patterns using app automation tokens
Teams deploy apps with different release patterns depending on risk profile, customer exposure, and complexity of app components. App automation tokens enable the same patterns used for web apps and services. Common patterns:
- Tag-based releases
- Create a tag in Git (e.g., v1.2.3) and trigger a workflow that deploys tagged builds. This provides a clear mapping from a release artifact to a Shopify deployment.
- Environment segregation with separate tokens
- Maintain separate configurations and tokens for staging and production. Deploy to staging automatically on feature branch merges and gate production deploys to release tags or protected branches.
- Canary and gradual rollouts
- If your app surfaces behavior change to merchants, combine feature flags or subset rollouts within your app code and deploy via CI. The token used in CI is unchanged; the deployment strategy is driven by app configuration and release orchestration.
- Blue/green or immutable deployments
- For apps with components hosted on infrastructure you control, have CI deploy immutable artifacts (Docker images, Lambda versions) and update Shopify-related configurations through the CLI as part of the same pipeline.
Example: BrightCart (fictional) BrightCart, a mid-sized app developer, uses GitHub Actions with two app automation tokens: one for staging and one for production. Staging deploys occur on every push to the staging branch. Production only deploys when the release manager creates a Git tag and opens a release. Tokens are named "brightcart-staging-ci" and "brightcart-prod-ci", rotated quarterly, and stored as organization secrets.
The pipeline:
- On push to staging: action runs unit tests, builds artifacts, deploys to staging with the staging token.
- On push tag matching v*: action runs integration tests and deploys to production with the production token.
Migrating from Partner Dashboard CLI tokens: checklist and rollout plan
Migration reduces exposure from broader-scoped or shared tokens. The migration plan should aim for minimal disruption while ensuring secure replacement.
Migration checklist
- Inventory existing CLI tokens: list tokens per app and where they are used in CI.
- Create app automation tokens in Dev Dashboard for each app and environment.
- Add tokens to CI secrets as environment variables (e.g., SHOPIFY_APP_AUTOMATION_TOKEN).
- Update CI/CD workflows to reference the new secrets. If workflows already use
SHOPIFY_APP_AUTOMATION_TOKEN, update the secret value; otherwise, update the variable name used by the scripts. - Verify deployment on a non-production environment: trigger a staging run and confirm that the CLI can deploy with the new token.
- Monitor logs and deployment results for any discrepancies.
- Revoke or let expire the old Partner Dashboard CLI tokens only after successful verification.
- Document the change and update runbooks and incident playbooks.
Rollout tips
- Start with a single non-critical app or staging pipeline to validate the process.
- Keep the old token active until the new workflow proves stable.
- Use short maintenance windows for production migration if your deployment affects merchant traffic.
- Share migration steps with developer teams and platform engineers; ensure audit entries are captured for compliance.
Avoiding common pitfalls
- Forgetting to copy the token: the Dev Dashboard may show the token only once. Have your CI admin ready to paste it into the secrets store immediately.
- Wrong secret name: align environment variable names in your pipeline with the CLI's expected variable or update scripts accordingly.
- Outdated Shopify CLI: CI agents must run a CLI version that supports app automation tokens. Install or cache the newest stable CLI in your pipeline.
Best practices for token lifecycle, security, and least privilege
App automation tokens reduce risk but require operational guardrails. Adopt the following practices to maintain security and compliance.
Principals for token management
- Least privilege: Use separate tokens per app and environment. Do not reuse a single token across multiple apps.
- Shorter lifetimes: If your platform supports specifying expiry or ephemeral tokens, prefer shorter lifetimes for CI tokens and automate rotation. If expiry is not available, rotate tokens on a regular schedule (e.g., every 90 days).
- Use protected secrets: Store tokens in secure secret managers that support access control, versioning, and audit trails (GitHub Secrets, GitLab CI Variables, AWS Secrets Manager, HashiCorp Vault).
- Audit and logging: Enable pipeline audit logs, and maintain records of token creation, use, and revocation. Log deploy operations and correlate with CI run IDs and commit hashes.
Operational controls
- Role-based access: Limit who can create or view repository-level secrets. Use organization-level secrets for multi-repo apps with fine-grained access policies.
- Approvals and gating: Gate production deployments with approval steps that require human verification for high-risk changes.
- Token naming and metadata: Include environment and purpose in token names (e.g., myapp-prod-ci-2026Q2) to simplify audits.
- Emergency response: Have an incident-runbook that includes steps to revoke a compromised token and rotate to a new token, and a fallback method to disable the app if needed.
Testing and verification
- Smoke deploys: Automate a smoke test after each deployment to confirm the app and relevant components function as expected.
- Canary testing: Deploy to a small cohort or internal merchant accounts before full rollout.
- CI/CD hygiene: Ensure build artifacts are repeatable and immutable to avoid surprise behavior during redeploys.
Troubleshooting common deployment issues
Despite careful setup, deployments may fail. This section lists common symptoms, root causes, and recommended fixes.
Symptom: CI job fails immediately with authorization errors
- Possible cause: Token missing or secret incorrectly named.
- Fix: Verify secret exists in CI provider, confirm the name matches the environment variable used by the script (SHOPIFY_APP_AUTOMATION_TOKEN). Ensure the secret is available to the branch, environment, or runner used by the job (protected secrets may be restricted to certain branches).
Symptom: CLI prints errors about insufficient permissions
- Possible cause: The token lacks the required app permissions for specific operations.
- Fix: Review what the deploy operation needs (app updates, component uploads, extension builds). Regenerate the token with appropriate permissions if the Dev Dashboard allows selecting them; otherwise check the app configuration and Dev Dashboard settings for automation token scope options. Consult the Shopify.dev token documentation.
Symptom: Deploy succeeds but behavior differs from local runs
- Possible cause: CI environment variables or configuration differ (e.g., secrets, environment, configuration file variations).
- Fix: Reproduce the CI run locally by setting the same environment variables. Ensure
--configpoints to the expected configuration file or section. Confirm asset builds produce deterministic outputs.
Symptom: Token appears expired or stopped working unexpectedly
- Possible cause: Token revoked or expired.
- Fix: Generate a new app automation token, update CI secret, and redeploy. Implement token rotation and notification procedures to minimize downtime during changes.
Symptom: CLI not found in CI runner
- Possible cause: Shopify CLI not installed or PATH not set.
- Fix: Add an installation step or use a container image that includes the Shopify CLI. Validate installation by running
shopify version.
Diagnostic steps
- Add a step in your pipeline to echo the CLI version and basic diagnostics (without printing secrets).
- Capture CLI logs and CI run IDs for correlation with Dev Dashboard events.
- Run the same
shopify app deploycommand locally with the token exported in a safe environment and compare outputs.
Practical considerations for complex apps and extension components
Complex Shopify apps include multiple components: backend services, front-end admin pages, Shopify App Extensions, and theme app extensions. App automation tokens facilitate deploying the Shopify-specific pieces, but pipelines must handle the broader stack.
Coordinating multi-component releases
- Separate responsibilities: Let the Shopify CLI handle app component updates while dedicated deployment systems manage backend services or front-end assets.
- Atomic release visibility: Tag artifacts and include the Git commit or image tags in Shopify deployment logs so you can correlate a deployed app version with code and infrastructure deployments.
- Use release artifacts: Build a release artifact in CI, push it to an artifact registry, then trigger a deploy stage that uses the artifact alongside the
shopify app deploysteps.
Extensions and theme components
- Theme app extensions or online store components often require additional build and packaging steps. Run those builds in the CI job prior to calling
shopify app deploy. - Keep extension credentials and build-time secrets separate from the app automation token.
Rollback strategies
- Maintain a tested rollback plan for quick reversion if a deployment introduces errors. Use infrastructure patterns that support fast rollback (image tags, feature flags).
- For Shopify-specific changes that cannot be reverted automatically through the CLI, prepare forensic steps and manual procedures for restoring previous app settings or merchant-facing assets.
Compliance, auditing, and governance for automated deployments
Automated deployments touch production systems that may be governed by compliance obligations. App automation tokens simplify governance by providing clear lines of authority and auditability.
Audit logs and CI traces
- Keep the CI run logs and store them securely for the retention period required by your compliance posture.
- Make the CI run ID and Git commit SHA a required field in release notes and attach it to deployment metadata.
Access control and approvals
- Enforce least privilege on secrets and restrict who can update them.
- Use protected branches and require approvals for merges that trigger production deployments.
Change management
- Make sure each release includes release notes, test results, and stakeholder sign-off where necessary.
- Keep a changelog that maps releases to Shopify deploys and highlight migrations between token types.
Regulatory considerations
- Evaluate whether storing tokens in SaaS CI providers meets your data residency and regulatory requirements. Consider self-hosted runners or on-prem secret management if needed.
Future-proofing your CI/CD with app automation tokens
Adopt practices that reduce friction and allow your deployment strategy to evolve without disrupting merchant experiences.
Automation and observability
- Integrate deployment events with observability platforms: include pipeline results in Sentry, Datadog, or your centralized logging so platform engineers can see and alert on failed deploys.
- Use webhooks or APIs to notify downstream systems and stakeholders of successful Shopify CLI deploys.
Policy enforcement
- Enforce token creation and rotation policies through internal platform tooling or automation. For large teams, consider implementing a token lifecycle manager that creates tokens via the Dev Dashboard API (if available) and rotates them according to policy.
Developer experience
- Create developer onboarding docs that show how to create tokens, set up local development clones with safe practices, and test CI deploys to staging before production migration.
- Provide sample workflows and helper scripts to reduce cognitive overhead for new team members.
FAQ
Q: How do I create an app automation token? A: Create one from the Shopify Dev Dashboard within the specific app’s settings. Copy it immediately and store it securely in your CI provider’s secrets/variables storage. Consult the official guide: https://shopify.dev/docs/apps/build/dev-dashboard/app-automation-tokens
Q: Do app automation tokens replace Partner Dashboard CLI tokens? A: Yes. App automation tokens replace CLI tokens that were previously generated on the Partner Dashboard. Existing CLI tokens remain functional until they expire, but you should migrate to app automation tokens for better security and control.
Q: What environment variable does the Shopify CLI read for the token? A: The Shopify CLI reads the token from SHOPIFY_APP_AUTOMATION_TOKEN. Set that environment variable in your CI job to the token value.
Q: What is the simplest command for deploying an app in CI? A: Export the token as an environment variable and call the Shopify CLI deploy command:
export SHOPIFY_APP_AUTOMATION_TOKEN="<token>"
shopify app deploy --config production --allow-updates
Q: Can I use one token for multiple apps or environments? A: Do not. Use separate tokens per app and per environment where practical. This follows least-privilege principles and reduces blast radius in the event of a compromise.
Q: What about token rotation and expiry? A: Rotate tokens regularly and use short-lived tokens where available. If the Dev Dashboard supports setting expirations or generating ephemeral tokens, prefer those features. Otherwise, schedule rotation and automate updates of CI secrets to replace tokens on a predictable cadence.
Q: How do I test a new token without disturbing production? A: Use a staging CI job configured with a staging token and staging app configuration. Run a full deploy pipeline against staging and validate the app behavior and artifact integrity before updating production secrets.
Q: My CI job fails with permission errors after switching tokens—what now? A: Check whether the new automation token has the permissions required for the deploy operations performed by the CLI. Confirm you are using the latest Shopify CLI, and verify that the secret was correctly stored and referenced by the pipeline.
Q: Does the Shopify CLI need any special version to work with app automation tokens? A: Use a Shopify CLI version that supports app automation tokens. When installing the CLI in CI, check the installed version using shopify version. Refer to Shopify.dev for the most current CLI installation guidance.
Q: Where can I learn more about deploying various app components in a CD pipeline? A: The Shopify developer docs provide detailed guidance on deploying app components: https://shopify.dev/docs/apps/launch/deployment/deploy-in-ci-cd-pipeline
Q: How should I name tokens and secrets for clarity? A: Use descriptive names that include the app name and environment, for example: myapp-prod-ci, myapp-staging-ci. Document naming conventions centrally for consistent audits.
Q: What if a token is exposed or compromised? A: Immediately revoke the compromised token in the Dev Dashboard, create a new token, and update the CI secret. Run a rollback or mitigation plan if the exposure could affect merchant-facing behavior.
Q: Are automation tokens visible after creation? A: Typically the Dev Dashboard shows token values only at creation time for security. Store the token immediately in your CI secrets store; if you lose it, revoke and create a new one.
Q: Can the token be limited to specific CI IP ranges or runners? A: The token itself is app-scoped; additional network or runner restrictions must be applied through CI provider controls, IP allowlists, or VPC configurations. Use protected runners and runner-specific variables if advanced restrictions are needed.
Q: Will older Partner Dashboard CLI tokens stop working immediately? A: No. Existing Partner Dashboard CLI tokens will continue to function until they expire. Plan migration proactively to minimize disruption and take advantage of app-scoped security.
Q: Can I automate token creation and rotation? A: If Shopify provides APIs or automation endpoints for token lifecycle management, integrate them with your secret manager workflows. Otherwise, create a secure manual process for token creation and rotation and automate CI updates where allowed.
Q: Where can I find migration instructions for Partner Dashboard tokens to app automation tokens? A: Shopify’s migration guide is available here: https://shopify.dev/docs/apps/build/dev-dashboard/app-automation-tokens#migrate-from-partner-dashboard-tokens
App automation tokens simplify and harden the path for automated Shopify app deployments. They align CI/CD practices with security best practices by scoping credentials to individual apps and supporting standard token management controls. Implement app automation tokens in your pipelines, use separate tokens for staging and production, store tokens securely, and follow rotation and auditing practices. The improvements reduce risk and make operational workflows around Shopify apps more manageable and auditable.