We are trying to build up a scratch org with sfdx-project.json file. Post that we are deploying all the live code to it from git. Now during the code deploy, we are facing issues due to the fact that few AppExchange apps deployed in prod are missing from scratch org.

Is there any feature/setting in the sfdx-project.json file to deploy specific/all AppExchange apps in scratch org which are deployed in Production?

  • Check installedpackages, you can refer to the metadata api’s documentation
    – glls
    May 13, 2019 at 12:04
  • @glls - Sorry but didn't found any quick guidance over it... Any references to include in config file
    – Varun SFDC
    May 13, 2019 at 12:27
  • Its not in the config file, its in the project default folder - you should really check the metadata api documentation. I’m on mobile, so i cant provide a complete answer atm.
    – glls
    May 13, 2019 at 12:40

1 Answer 1


The comments from glls are referring you to the Metadata API's InstalledPackage entity. You can construct a Metadata API deployment composed exclusively of these entities, which define the version number and namespace of the package you wish to install, as a step prior to pushing your code.

The XML metadata looks like this (from the documentation above):

<?xml version="1.0" encoding="UTF-8"?>
<InstalledPackage xmlns="http://soap.sforce.com/2006/04/metadata">

Note that

You can’t deploy a package along with other metadata types. When you deploy InstalledPackage, it must be the only metadata type specified in the manifest file.

so what you'd probably want to do is build a separate directory with your InstalledPackage files and run sfdx force:mdapi:deploy against it to request the installation of those packages in your org prior to your SFDX push.

Alternately, you can script the CLI via the sfdx force:package:install --package 04t... command, but you'll need the 04t package version Id for each package you wish to install.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .