Use notebook secrets
Secrets in ArcGIS Notebooks provide a secure method for storing and using sensitive information, such as connection keys for external systems. This capability is supported for notebooks that use Notebook runtime 15.0 or later.
If you have the privilege to create notebooks, you can create and manage secrets in the Secrets pane of the notebook editor. Any secrets you register appear in this pane, allowing you to add and use them programmatically across your notebooks, for both interactive and scheduled workflows, without exposing hardcoded secret values.
Caution:
Do not print secret values in your notebook.
Note:
If a notebook that references a registered secret is shared with another notebook author, the secret value will not be available to that author. Shared users can create their own secrets using the same name in the notebook.
Secrets are not supported in notebook web tools, as they are shared and run by multiple users.
Register a secret
Using the Secrets pane in the notebook editor, you can create one or more secrets for use in your notebook. To register a secret, complete the following steps:
Follow the steps to open a notebook.
Click Secrets in the top ribbon of the notebook editor.
Click Register secret.
Provide a name and value for the secret.
The name can contain alphanumeric characters, hyphens, and underscores and can be a maximum length of 255 characters. The secret value cannot exceed 5,000 characters.
Click Save.
Your secret is registered.
Add a secret to a notebook
To add a secret to a notebook, complete the following steps:
Follow the steps to open a notebook.
Click Secrets in the top ribbon of the notebook editor.
Click Add to insert a code snippet into your notebook that retrieves the value of the secret.
Optionally, replace secret in the code snippet with your desired variable name.
Click Save.
Your secret is added to your notebook.
Update a secret
To update the value of a registered secret, you must delete the secret and register a new secret with the same name.
Set key
Optionally, you can set a key that will be used to encrypt and decrypt your registered secrets. If you do not provide a key, a default key will be used. To set a key or update an existing key, complete the following steps:
Follow the steps to open a notebook.
Click Secrets in the top ribbon of the notebook editor.
Click Set key.
Enter the value for the key.
Click Save.
Your key is set in your notebook.