Cert++
Close

dw.json connection settings for cartridge uploads

Key Takeaway

Put dw.json at the top level of your repository, where the upload tools read it. The code-version key in dw.json, written with a hyphen, names the code version that receives your uploaded cartridges.

dw.json is a small JSON file that tells the B2C Commerce upload tools three things: which sandbox to connect to, which user to sign in as, and which code version should receive your cartridges. The command-line upload tools and Visual Studio Code read the file from the top level of your repository when they upload cartridges to the server. So the values in this one file decide where your code goes.

What dw.json holds

dw.json holds the information needed to establish a server connection, plus the code version to upload cartridges into. Two tools use it to upload cartridges to a sandbox: the SFRA command-line upload tool and the Prophet Debugger in Visual Studio Code. A typical file looks like this:

{
  "hostname": "dev01-web-company5.cloudkicks.com",
  "username": "admin",
  "password": "passwordjkl",
  "code-version": "version1"
}

The file must be valid JSON. Each key holds one piece of the connection or upload information:

KeyWhat it holdsExample value
hostnameThe fully qualified domain name (FQDN) of the sandbox, entered without http or httpsdev01-web-company5.cloudkicks.com
usernameA user with Site Development rightsadmin
passwordThat user's passwordpasswordjkl
code-versionThe code version that receives the uploaded cartridgesversion1 on a new sandbox
cartridge (optional)An array of cartridge names["cartridge A", "cartridge B"]

Write the key as code-version, with a hyphen. Because this key names the code version that receives your cartridges, a different value sends your uploads to a different code version.

dw.json is normally unencrypted. The file holds the instance and password data needed to upload code, so you can take extra measures to secure it.

B2C Commerce Developer Study Guide

Checklist progress

0/237Learned

Given a sandbox environment, configure an IDE to use WebDAV to deploy cartridges to the correct version directories

0/6

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other B2C Commerce Developer studiers.