How do I migrate away from `vercel.json` env and build.env?

This article will help you migrate your vercel.json environment variables (legacy method) to the Environment Variables UI.

Migrate Your Environment Variables

You may have configured the env and build.env legacy properties in a vercel.json file:

{
  "env": {
    "MY_KEY": "this is the value",
    "SECRET": "@my-secret-name"
  },
  "build": {
    "env": {
      "MY_KEY": "this is the value",
      "SECRET": "@my-secret-name"
    }
  }
}

A configured vercel.json file with environment variables.

We no longer recommend you use this legacy method for environment variables. Instead, we recommend you migrate your environment variables to the Environment Variables UI. Here is how to add the same envrionment variables setup to our Environment Variables UI using the example above:

Migrating to the Environment Variables UI will help you avoid errors when implementing your environment variables.

Redeploy

Once you have successfully moved your environment variables to the Environment Variables UI, make sure to redeploy your Vercel Project to reflect these new changes.

Updated February 3rd 2021