Adobe Commerce on cloud: change authentication keys and redeploy

This article provides instructions on how to redeploy Adobe Commerce on cloud infrastructure with different authentication keys. For example, you might have used the keys for another account or you might have used Magento Open Source keys instead of Adobe Commerce keys.

If you used the incorrect keys, deployment fails. To recover, you must clone the project, add the correct keys to auth.json, and push the change to the master branch.

In this article, we assume that your project has a master branch only (master is the default branch when you first create a project).

To redeploy with the correct authentication keys:

  1. Log in to the machine that has your Adobe Commerce on cloud infrastructure SSH keys.

  2. Log in to the project:

    code language-none
    magento-cloud login
    
  3. Create a branch to update code with the name auth:

    code language-none
    magento-cloud environment:branch auth master
    
  4. Change to the project root directory.

  5. Open auth.json in a text editor.

    code language-json
    {
       "http-basic": {
          "repo.magento.com": {
             "username": "<your public key>",
             "password": "<your private key>"
          }
       }
    }
    
  6. Add the correct authentication keys.

  7. Save your changes and exit the text editor.

  8. Commit and merge your changes.

    code language-none
    git add -A
    
    code language-none
    git commit -m "<description of change>"
    
    code language-none
    git push origin master
    
  9. Wait for the deployment to complete.

Messages indicate whether deployment was successful. You can confirm a successful deployment by going to one of the Environment routes displayed on your screen.

recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a