Skip to content

Deploying Code

When testing Vault code locally through the debugger, the code is only active locally while the debugger is running. To make the code run for all users in your Vault, you must deploy it.

To deploy code, a Vault Admin must enable configuration packages in your Vault. Learn how to enable configuration packages in Vault Help.

Deploy code in the follwing steps:

  1. Create a VPK with your source files
  2. Import the VPK to Vault
  3. Put your Vault into Configuration Mode. Skipping this step can cause unexpected execution errors.
  4. Deploy the VPK

With this deploy method, you can accomplish any of the following:

  • Add or update existing code in the target Vault. This is purely additive and will not delete any existing code.
  • Replace all code currently in the target Vault with the code in a VPK file. This deletes any code from the target Vault which is not in the new VPK.
  • Delete all code currently in the target Vault.

If you need other deploy options, such as deploying or deleting a single file in the target Vault, see Managing Deployed Code. However, deploying a single file rather than a VPK is considered bad practice and should be used sparingly.

Note that your Vault user must have the correct permissions to deploy code. See the related permissions table for more information.

You can also create, validate, import, and deploy a VPK using the Vault Java SDK Maven Plugin.

In this section, you will learn: