Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
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
      • File storage operations
    • Migrating a workflow to a new version
  • Terraform reference
  • Audit Trails events
  • Access management
  • Pricing policy
  • Public materials
  • Release notes

In this article:

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

Working with secrets

Written by
Yandex Cloud
Updated at August 15, 2025
  • Creating a secret
  • Sharing a secret
  • Accessing a secret from a project cell
  • Copying a secret
  • Updating a secret
  • Deleting a secret

Secrets enable storing sensitive data in encrypted form and using it securely within your project code.

Creating a secretCreating a secret

  1. Select the project in your community or on the DataSphere home page 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 name must be 2 to 63 characters long.

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

  6. Click Create. You will see a page with detailed info on the secret you created.

Sharing a secretSharing a secret

Note

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

To share a secret within 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 project in your community or on the DataSphere home page in the Recent projects tab.

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

To make a secret available for use in a different project, the project editor needs to add that secret on the Shared tab.

Accessing a secret from a project cellAccessing a secret from 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 a secretCopying a secret

  1. Select the project in your community or on the DataSphere home page 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. You will see a page with detailed info on the secret you created.

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

Updating a secretUpdating a secret

  1. Select the project in your community or on the DataSphere home page 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 by editing its name and contents.
  5. Click Save.

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

Deleting a secretDeleting a secret

  1. Select the project in your community or on the DataSphere home page 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

In fact, resource deletion can take up to 72 hours.

Was the article helpful?

Previous
Setting up template-based notebook creation
Next
Working with Yandex Data Processing templates
© 2025 Direct Cursus Technology L.L.C.