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
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex DataSphere
  • Getting started
    • All guides
      • Authentication in DataSphere Jobs
      • Running a job in DataSphere Jobs
      • Working with jobs from Visual Studio Code
      • Using results of completed jobs
      • Working with a service agent from a job
    • Migrating a workflow to a new version
  • Terraform reference
  • Audit Trails events
  • Access management
  • Pricing policy
  • Public materials
  • Release notes
  1. Step-by-step guides
  2. DataSphere Jobs
  3. Working with a service agent from a job

Working with a service agent from a job

Written by
Yandex Cloud
Updated at April 11, 2025

You can work with other services from jobs using a service agent. A service agent is a special service account under which DataSphere projects will perform actions in other Yandex Cloud services.

You can work with other services from jobs using a service agent:

  1. Create a service agent and enable it in the community.

  2. Run the job. The token for using the service agent will be saved to a file and will be available from the SA_TOKEN_FILENAME environment variable.

  3. Use the SA_TOKEN_FILENAME variable to work with other services. For example, this is how you can get the contents of the Yandex Lockbox secret using the API:

    curl --header "Authorization: Bearer $(cat $SA_TOKEN_FILENAME)" \
      https://payload.lockbox.api.cloud.yandex.net/lockbox/v1/secrets/<secret_ID>/payload
    

    Result:

    {
     "entries": [
      {
       "key": "my-key",
       "textValue": "key-example"
      }
     ],
     "versionId": "e6qlcb7fqtt6********"
    }
    

Was the article helpful?

Previous
Using results of completed jobs
Next
Publishing a notebook
© 2025 Direct Cursus Technology L.L.C.