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 Studio
    • 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
    • Education and Science
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud Functions
  • Comparison with other Yandex Cloud services
    • All tutorials
    • Creating a skill for Alice
    • Deploying a web application
    • Creating a skill for Alice and a website with authorization
    • Writing data from a device into a database
    • Writing load balancer logs to PostgreSQL
    • Developing a Slack bot
    • Developing a Telegram bot
    • Connecting to a YDB database from a Python function
    • Connecting to a YDB database from a function in Node.js
    • Converting a video to a GIF in Python
    • Creating a Node.js function using TypeScript
    • Developing a custom integration
    • Creating a budget trigger that invokes a function to stop a VM
    • Creating an interactive serverless application using WebSocket
    • Automatically copying objects from one Object Storage bucket to another
    • Running computations on a schedule in DataSphere
    • Interactive debugging of functions
    • Regular asynchronous recognition of audio files from Object Storage
    • Canary release of Cloud Functions
    • Deploying a fault-tolerant architecture with preemptible VMs
    • Creating triggers that invoke a function to stop a VM and send a Telegram notification
    • Loading data from Yandex Direct to a Yandex Managed Service for ClickHouse® data mart using Yandex Cloud Functions, Yandex Object Storage, and Yandex Data Transfer
    • Status monitoring of geographically distributed devices
    • Sensor reading monitoring and event notifications
    • Emulating multiple IoT devices
    • Streaming Yandex Cloud Postbox events to Yandex Data Streams and analyzing them using Yandex DataLens
    • URL shortener
    • Yandex Tracker: data export and visualization
    • Running computations in DataSphere using the API
    • Developing a Telegram bot for text and audio recognition
    • Configuring responses in Yandex Cloud Logging and Cloud Functions
    • Developing functions in Functions Framework and deploying them to Yandex Serverless Containers
    • Configuring CI/CD with SourceCraft
    • Creating an AI agent with Cloud Functions
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ

In this article:

  • Get your cloud ready
  • Required paid resources
  • Set up your environment
  • Create resources
  • Create a bucket
  • Create an API gateway
  • Create a database
  • Create an app
  • Set the project variables
  • Create the secrets file
  • Create the configuration file
  • Deploy your project
  • Apply a data schema
  • Get an OAuth token
  • Upload the backend code to Cloud Functions
  • Upload the frontend code to Object Storage
  • Update the API gateway configuration
  • Register a skill for Alice
  • Create a dialog
  • Configure authorization on the Alice page
  • Add intents
  • Test the skill
  • How to delete the resources you created
  1. Tutorials
  2. Creating a skill for Alice and a website with authorization

Creating a skill for Alice and a website with authorization

Written by
Yandex Cloud
Improved by
Updated at July 23, 2025
  • Get your cloud ready
    • Required paid resources
  • Set up your environment
  • Create resources
    • Create a bucket
    • Create an API gateway
    • Create a database
    • Create an app
  • Set the project variables
    • Create the secrets file
    • Create the configuration file
  • Deploy your project
    • Apply a data schema
    • Get an OAuth token
    • Upload the backend code to Cloud Functions
    • Upload the frontend code to Object Storage
    • Update the API gateway configuration
  • Register a skill for Alice
    • Create a dialog
    • Configure authorization on the Alice page
    • Add intents
  • Test the skill
  • How to delete the resources you created

In this tutorial, you will develop a skill for Alice and deploy a web app to create, read, and edit to-do lists using Alice, and share such lists with other website users.

The project's data is stored in a Yandex Object Storage bucket and Yandex Managed Service for YDB database. Yandex Cloud Functions process requests; Yandex API Gateway enables service interaction.

To deploy a project:

  1. Get your cloud ready.
  2. Set up your environment.
  3. Create resources.
  4. Set the project variables.
  5. Deploy the project.
  6. Register a skill for Alice.
  7. Test the skill.

If you no longer need the resources you created, delete them.

Get your cloud readyGet your cloud ready

Sign up in Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or register a new account.
  2. On the Yandex Cloud Billing page, make sure you have a linked billing account with an ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can navigate to the cloud page to create or select a folder for your infrastructure to operate in.

Learn more about clouds and folders.

Required paid resourcesRequired paid resources

The infrastructure support costs include:

  • Fee for the number of function calls, computing resources allocated for the functions, and outbound traffic (see Yandex Cloud Functions pricing).
  • Fee for YDB operations and data storage (see Yandex Managed Service for YDB pricing).
  • Fee for storing data in a bucket (see Yandex Object Storage pricing).
  • Fee for the number of requests to the API gateway and outbound traffic (see Yandex API Gateway pricing).
  • Fee for logging operations and data storage in a log group (see Yandex Cloud Logging pricing).

Set up your environmentSet up your environment

Windows
Linux
  1. Install Windows Subsystem for Linux (WSL) to use Linux.
  2. Run WSL (Ubuntu by default).
  3. Configure the environment as described in this guide for Linux.

Note

If you are using a distribution other than Ubuntu, install the specified software using your package manager.

  1. Clone the yc-serverless-alice-shareable-todolist repository:

    git clone https://github.com/yandex-cloud-examples/yc-serverless-alice-shareable-todolist.git
    
  2. Install and configure the following:

    • Yandex Cloud CLI
    • YDB CLI
    • Bash
    • AWS CLI
    • jq
    • Node.js
    • npm package manager
    • Terraform
    • Go programming language
  3. Optionally, to finalize the project, additionally install:

    • go-swagger
    • api-spec-converter

Create resourcesCreate resources

Create a bucketCreate a bucket

Create a bucket to store static data in:

Management console
  1. Go to the Yandex Cloud management console and select the folder where you will perform the operations.
  2. On the folder page, click Create resource and select Bucket.
  3. In the ** Name** field, enter a name for the bucket consistent with the naming conventions:
  4. In the Object read access, Object listing access, and Read access to settings fields, select Restricted.
  5. Specify the maximum size of the bucket in GB.
  6. Click Create bucket.

Create an API gatewayCreate an API gateway

Create an API gateway for interaction between services:

Management console
  1. In the management console, select the folder you are using to complete this tutorial.
  2. In the list of services, select API Gateway.
  3. Click Create API gateway.
  4. In the Name field, enter gate-1.
  5. Click Create.
  6. Wait for the API gateway status to change to Active.
  7. Select the created API gateway.
  8. Find the ID and Default domain fields and save their values. You will need them to configure the skill.

Create a databaseCreate a database

Create a YDB database in Serverless mode:

Management console
  1. In the management console, select the folder where you created the bucket.

  2. Select Managed Service for YDB.

  3. Click Create a database.

  4. Specify a Name for the database. Follow these naming requirements:

    • It must be from 2 to 63 characters long.
    • It can only contain lowercase Latin letters, numbers, and hyphens.
    • It must start with a letter and cannot end with a hyphen.
  5. Under Database type, select Serverless.

  6. Click Create a database.

  7. Wait for the database status to change to Running.

  8. Select the created database.

  9. Under Connection, find the Endpoint field and save its value. You will need it when creating functions.

Create an appCreate an app

Create an application in Yandex.OAuth:

Interface Yandex.OAuth
  1. Go to the Yandex OAuth website and log in.

  2. Click Create app.

  3. Specify the appropriate app name and upload an icon.

  4. Under Platforms, select Web services and click Save and continue.

  5. Under Platforms, specify the following URIs in the Redirect URI field:

    • https://social.yandex.net/broker/redirect
    • <API_gateway_service_domain>/receive-token.

    Leave the Suggest Hostname field blank.

  6. Click Save and continue.

  7. Under Permissions, select Access to user avatar and click Save and continue.

  8. Under Email address, specify your email address and click Save and continue.

  9. Verify the data and click Everything is correct. Create the app.

You can read more about the service features in the Yandex.OAuth documentation.

Set the project variablesSet the project variables

Configure the project using the values you got when creating your resources.

Create the secrets fileCreate the secrets file

Create a file named secure-config.json with secrets:

Bash
  1. To create a file from the secure-config-template.json template, navigate to the yc-serverless-alice-shareable-todolist project files folder and run this command:

    cp secure-config-template.json secure-config.json
    
  2. Open the secure-config.json file in nano:

    nano secure-config.json
    
  3. Substitute these variable values into the file:

    • oauth_secret: Password of the app (Client Secret) registered in Yandex OAuth.
    • hash: Base64-encoded random 64-byte string, e.g., qrJagO5NVwOj0FeTmgYSwUN+XXkiQJMWifvrklF53wT55q80Xk8vmEB3kxhtpDnA1WDC893Z9Bh6QcqK********. You can generate a random value in your terminal using openssl rand -base64 64 | tr -d '\n'.
    • block: Base64-encoded random 32-byte string, e.g., uwk0duFgn2nYyfu2VzJe+MnWKWQrfKaiZijI********. You can generate a random value in your terminal using openssl rand -base64 32 | tr -d '\n'.

    You can generate random values at generate.plus.

Create the configuration fileCreate the configuration file

Create a file named variables.json with project deployment configuration:

Bash
  1. To create a file from the variables-template.json template, navigate to the project files folder and run this command:

    cp variables-template.json variables.json
    
  2. Open the variables.json file in nano:

    nano variables.json
    
  3. Substitute these variable values into the file:

    • folder-id: Cloud folder ID.
    • domain: gate-1 API gateway service domain without https://, e.g., d5dbo25bol8n********.apigw.yandexcloud.net.
    • oauth-client-id: ClientID field value of the app registered in Yandex.OAuth.
    • database: Database location, the second part of the previously saved Endpoint field value (following /?database=), e.g., /ru-central1/r1gra875baom********/g5n22e7ejfr1********.
    • database-endpoint: First part of the previously saved Endpoint field value (following grpcs:// and preceding /?database=), e.g., ydb.serverless.yandexcloud.net:2135.
    • yc-profile: Yandex Cloud CLI profile name.
    • secure-config-path: Path to the secure-config.json secrets file.
    • storage-bucket: Name of the bucket you created for storing static data.
    • gateway-id: API gateway gate-1 ID.

Deploy your projectDeploy your project

Transfer the project files to Yandex Cloud and update the configuration.

Apply a data schemaApply a data schema

To create tables in the database, navigate to the project files folder and run this command:

Bash
./upload_ydb_schema.sh

Get an OAuth tokenGet an OAuth token

Get an OAuth token:

  1. Go to Yandex.OAuth. Before issuing a token, the service may request data access.
  2. Save the new token: you will need it for code uploading.

Upload the backend code to Cloud FunctionsUpload the backend code to Cloud Functions

Use Terraform to automate your operations. Before you start, initialize it.

Terraform

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the relevant documentation on the Terraform website or its mirror.

If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

  1. Run the following command in the folder with the app.tf configuration file:

    terraform init
    

    Note

    If you encounter a permission denied error during Terraform provider initialization, run the sudo chown $(whoami) ~/yc-serverless-alice-shareable-todolist command to edit current user's access permissions for the project folder.

  2. After successful initialization, create resources by providing the OAuth token for Yandex Cloud authorization:

    terraform apply -var-file ./variables.json -var yc-token=<OAuth_token>
    

    As a result, Terraform will automatically create or update the required resources.

Upload the frontend code to Object StorageUpload the frontend code to Object Storage

To deploy the frontend web app, build the static files and upload them to Object Storage.

Bash
  1. Before compiling static files, make sure you have Node.js and the npm package manager installed.

  2. Navigate to the yc-serverless-alice-shareable-todolist/frontend directory and run the following command:

    npm run build
    

    If during the compilation you encounter the

    • ERR_OSSL_EVP_UNSUPPORTED error, create a NODE_OPTIONS variable:

      export NODE_OPTIONS=--openssl-legacy-provider
      
    • npm ERR! Could not resolve dependency, run the command:

      npm install --legacy-peer-deps && npm install --force
      

    Result:

    > todolist@0.1.0 build
    > react-scripts build
    
    Creating an optimized production build...
    Compiled successfully.
    
    File sizes after gzip:
    
      75.93 KB  build/static/js/2.84be0fca.chunk.js
      23.26 KB  build/static/css/2.ef9168ec.chunk.css
      2.63 KB   build/static/js/main.d9e069c9.chunk.js
      776 B     build/static/js/runtime-main.676997b0.js
      402 B     build/static/css/main.e5cbab88.chunk.css
    
    The project was built assuming it is hosted at /.
    You can control this with the homepage field in your package.json.
    
    The build folder is ready to be deployed.
    You may serve it with a static server:
    
      npm install -g serve
      serve -s build
    
  3. To upload the files to Object Storage, run this command:

    cd ../
    ./upload_static.sh
    

    Result:

    ./upload_static.sh
    upload: frontend/build/robots.txt to s3://frontent-statics/robots.txt
    upload: frontend/build/manifest.json to s3://frontent-statics/manifest.json
    upload: frontend/build/static/css/main.e5cbab88.chunk.css.map to s3://frontent-statics/static/css/main.e5cbab88.chunk.css.map
    upload: frontend/build/index.html to s3://frontent-statics/index.html
    upload: frontend/build/asset-manifest.json to s3://frontent-statics/asset-manifest.json
    upload: frontend/build/static/js/2.84be0fca.chunk.js.LICENSE.txt to s3://frontent-statics/static/js/2.84be0fca.chunk.js.LICENSE.txt
    upload: frontend/build/static/css/main.e5cbab88.chunk.css to s3://frontent-statics/static/css/main.e5cbab88.chunk.css
    upload: frontend/build/static/js/main.d9e069c9.chunk.js to s3://frontent-statics/static/js/main.d9e069c9.chunk.js
    upload: frontend/build/static/js/2.84be0fca.chunk.js to s3://frontent-statics/static/js/2.84be0fca.chunk.js
    upload: frontend/build/static/js/runtime-main.676997b0.js to s3://frontent-statics/static/js/runtime-main.676997b0.js
    upload: frontend/build/static/js/runtime-main.676997b0.js.map to s3://frontent-statics/static/js/runtime-main.676997b0.js.map
    upload: frontend/build/static/js/main.d9e069c9.chunk.js.map to s3://frontent-statics/static/js/main.d9e069c9.chunk.js.map
    upload: frontend/build/static/css/2.ef9168ec.chunk.css to s3://frontent-statics/static/css/2.ef9168ec.chunk.css
    upload: frontend/build/static/css/2.ef9168ec.chunk.css.map to s3://frontent-statics/static/css/2.ef9168ec.chunk.css.map
    upload: frontend/build/static/js/2.84be0fca.chunk.js.map to s3://frontent-statics/static/js/2.84be0fca.chunk.js.map
    

Update the API gateway configurationUpdate the API gateway configuration

To upload the current specification to API Gateway, run this command:

Bash
./update_gateway.sh

Result:

done (2s)
id: d5dsj4st2g81********
folder_id: b1g86q4m5vej********
created_at: "2024-10-22T16:01:54.777Z"
name: gate-1
status: ACTIVE
domain: d5dm1lba80md********.i9******.apigw.yandexcloud.net
connectivity:
  network_id: enp3srbi9u49********
log_options:
  folder_id: b1g86q4m5vej********
execution_timeout: 300s

Register a skill for AliceRegister a skill for Alice

Create a dialogCreate a dialog

Yandex Dialogs console
  1. Go to Yandex Dialogs and log in to the console.
  2. Click Create dialog and select the Skill dialog type.
  3. In the Skill name field, specify To-do lists.
  4. Under Backend, enable Yandex Cloud function and from the list select the todolist-alice function you created earlier in Cloud Functions.
  5. Enable Use data storage in the skill.
  6. Fill in the required fields under Publication in folder. Configure the other settings as needed. For example, you can specify various word forms to trigger the skill, select a voice, or set access type.
  7. Click Save at the bottom of the page.

For more information, see the Yandex Dialogs documentation.

Configure authorization on the Alice pageConfigure authorization on the Alice page

Yandex Dialogs console
  1. Go to the Account linking tab.

  2. Enter the following:

    • Application ID: ClientID field value of the app registered in Yandex.OAuth.
    • Application secret: Client secret field value of the app registered in Yandex.OAuth.
    • Authorization URL: https://oauth.yandex.com/authorize.
    • Get token URL: https://oauth.yandex.com/token.
    • Refresh token URL: https://oauth.yandex.com/token.
  3. Click Save.

To learn more about OAuth 2.0, see RFC 6749.

Add intentsAdd intents

Yandex Dialogs console
  1. Go to the Settings tab.

  2. Go to the Intents tab and click Create.

  3. Add intents for every action possible in the dialog. The intents you make reside are in the project's yc-serverless-alice-shareable-todolist/intents folder.

  4. Enter the following:

    • Name: Any name you want displayed in the interface.
    • ID: Intent ID equal to the name of the file in the intents folder.
    • Grammar: Grammar text equal to the contents of the file in the intents folder.
  5. Click Save.

  6. To complete creating the dialog, click Submit for moderation on the right side of the page.

To learn more about intents, see Alice's skills.

Test the skillTest the skill

To debug the skill, use the Testing tab in the Yandex Dialogs console or one of the devices you selected when designing the skill.

In the Yandex Dialogs console:
On the surface
On the website

Navigate to the Testing tab. You will see a chat with Alice on the left and an interaction log in JSON format on the right.

Dialog example:

Let me help you with your lists!

  Hi Alice. Create a Groceries list.

Done, I created a Groceries list.

  Add milk to Groceries.

Done, I added "milk" to Groceries.

  Add bread.

What list should I add "bread" to?

  Groceries.

Done, I added "bread" to Groceries.

  Add eggs.

What list should I add "eggs" to?

  Groceries.

Done, I added "eggs" to Groceries.

  Alice, tell me what's on the Groceries list.

Groceries:
1. Milk
2. Bread
3. Eggs

To start a dialog, use any device or service supported by Alice.

In your browser, follow the URL in the Default domain field of your gate-1 API gateway and log in. The My lists page will open. In any of the lists, you can add or remove items and grant other users access to the list.

How to delete the resources you createdHow to delete the resources you created

To stop paying for the resources you created:

  • Delete the bucket.
  • Delete the database.
  • Delete the functions.
  • Delete the API gateway.
  • Delete the log group.

Was the article helpful?

Previous
Deploying a web application
Next
Writing data from a device into a database
© 2025 Direct Cursus Technology L.L.C.