Docs Menu
Docs Home
/ /
Atlas App Services
/ /

Define and Manage Secrets

On this page

  • Define a Secret
  • Create a New Secret
  • Define the Secret Value
  • Save and Deploy
  • View Secrets
  • Update a Secret
  • Access a Secret
  • Delete a Secret
1

Click Values in the left navigation menu and then click Create New Value. Enter a name for the value and then select Secret for the value type.

Note

Secret Name Restrictions

Secret names must not exceed 64 characters and may only contain ASCII letters, numbers, underscores, and hyphens. The first character must be a letter or number.

2

Enter the secret value in the Add Content input.

Note

Secret Value Restrictions

Secret values may not exceed 500 characters.

3

Once you've defined the secret, click Save. If your application deployment drafts enabled, click Review & Deploy to deploy the changes.

To define a new secret, call appservices secrets create. The CLI will prompt you for your App ID as well as a name and value for the secret.

appservices secrets create

You can also specify the arguments when you call the program:

appservices secrets create --app=<Your App ID> \
--name="<Secret Name>" \
--value="<Secret Value>"

To see a list of the names and IDs of all secrets in an app, click Values in the left navigation menu. The table on the Values screen shows a list of all values, including secrets, and indicates each value's type in its row.

The Value screen in the UI, which shows a table of secret IDs and values
click to enlarge

To list the names and IDs of all secrets in an app, call appservices secrets list. The CLI will prompt you for your App ID.

appservices secrets list

You can also specify the App ID when you call the program:

appservices secrets list --app=<Your App ID>

To update a secret:

  1. Click Values in the left navigation menu.

  2. Find the value that you want to update in the table, open its Actions menu, and select Edit Secret.

  3. Select the Add Content input and enter the new value.

  4. Click Save.

To update the value of a secret, call appservices secrets update. The CLI will prompt you for your App ID.

appservices secrets update

You can also specify the App ID when you call the program:

appservices secrets update --app=<Your App ID> \
--secret="<Secret ID or Current Name>" \
--name="<Updated Secret Name>" \
--value="<Updated Value>"

You cannot directly read the value of a Secret after defining it. There are two ways to access a Secret that already exists in your app:

  1. Link to the Secret by name in Authentication Provider and Service configurations.

  2. Expose the Secret with a Secret Value. You can access the Secret Value in function's with context.values or in a rule expression with %%values.

To delete a secret:

  1. Click Values in the left navigation menu.

  2. Find the value that you want to delete in the table, open its Actions menu, and select Delete Secret.

  3. Confirm that you want to delete the secret.

To delete a secret, call appservices secrets delete. The CLI will prompt you for your App ID and list users in that app for you to select.

appservices secrets delete

You can also specify the arguments when you call the program:

appservices secrets delete --app=<Your App ID> --secret=<Secret ID>

Tip

You can delete multiple secrets with a single command by specifying their name or id values as a comma-separated list.

appservices secrets delete --app=<Your App ID> --secret=some-api-key,609af850b78eca4a8db4303f

Back

Define a Value