Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex DataSphere
  • Getting started
    • All guides
      • Using secrets
      • Working with Yandex Data Processing templates
      • Working with Docker images
      • Working with datasets
      • Working with S3 connectors
      • Working with Spark connectors
      • Working with models
      • Using file storages
    • Migrating a workflow to a new version
  • Terraform reference
  • Audit Trails events
  • Access management
  • Pricing policy
  • Public materials
  • Release notes

In this article:

  • Creating secrets
  • Sharing secrets
  • Invoking a secret in a project cell
  • Copying secrets
  • Updating secrets
  • Deleting secrets
  1. Step-by-step guides
  2. Working with resources
  3. Using secrets

Using secrets

Written by
Yandex Cloud
Updated at March 6, 2025
  • Creating secrets
  • Sharing secrets
  • Invoking a secret in a project cell
  • Copying secrets
  • Updating secrets
  • Deleting secrets

Secrets let you store sensitive data in encrypted form and use it safely in your project code.

Creating secretsCreating secrets

  1. Select the relevant project in your community or on the DataSphere homepage in the Recent projects tab.

  2. Under Project resources, click Secret.

  3. Click Create.

  4. In the Name field, enter a name for the secret.

    The name may contain uppercase and lowercase Latin letters, numbers, and hyphens. The first character must be a letter. The last character cannot be a hyphen or underscore. The allowed length is 3 to 63 characters.

  5. In the Value field, enter a value to be stored in encrypted form.

  6. Click Create. This will display the created secret's info page.

Sharing secretsSharing secrets

Note

You can only share resources within a single organization between communities created in the same availability zone.

To share a secret in a community, you need the Editor role in the project and the Developer role in the community. To learn more about roles in DataSphere, see Access management in DataSphere.

  1. Select the relevant project in your community or on the DataSphere homepage in the Recent projects tab.

  2. Under Project resources, click Secret.
  3. Select the appropriate secret from the list.
  4. Go to the Access tab.
  5. Enable the visibility option next to the name of the community to share the secret in.

To make a secret available for use in another project, the project editor should add it to the Shared tab.

Invoking a secret in a project cellInvoking a secret in a project cell

Once you create a secret, you can use it in project cells as an environment variable.

Python
Bash
import os
os.environ # Getting a list of all environment variables
os.environ['<secret_name>'] # Accessing <secret_name> from environment variables
#!:bash
printenv <secret_name>

Copying secretsCopying secrets

  1. Select the relevant project in your community or on the DataSphere homepage in the Recent projects tab.

  2. Under Project resources, click Secret.
  3. In the list of secrets, choose the one you want to copy to your project, click , and select Clone.
  4. Edit the name and contents of the secret to copy.
  5. Click Create. This will display the created secret's info page.

A copied secret is not bound to the original: you can edit and delete the former without affecting the latter.

Updating secretsUpdating secrets

  1. Select the relevant project in your community or on the DataSphere homepage in the Recent projects tab.

  2. Under Project resources, click Secret.
  3. In the list of secrets, choose the one you want to update, click , and select Edit.
  4. Update the secret: edit its name and contents.
  5. Click Save.

You cannot modify a secret created in a different project, but you can modify its copy.

Deleting secretsDeleting secrets

  1. Select the relevant project in your community or on the DataSphere homepage in the Recent projects tab.

  2. Under Project resources, click Secret.
  3. In the list of secrets, choose the one you want to delete, click , and select Delete.
  4. Click Confirm.

You will see a message saying that the secret has been deleted.

Warning

The actual deletion of resources can take up to 72 hours.

Was the article helpful?

Previous
Setting up template-based notebook creation
Next
Working with Yandex Data Processing templates
Yandex project
© 2025 Yandex.Cloud LLC