Developing a Service

Here are the steps usually performed in a workflow when developing a service with the BaaS tool extension. The commands mentioned here are also available as menu items and buttons in the BaaS Side Bar view that is opened from the Activity Bar.

Create a Service Workspace

The first step is to create new multi-root workspace where each root folder is one BaaS service. There is a command to do that where a few questions guide you to the creation of a service manifest and project files.

Press F1 and select 'BaaS: Create Service in new Workspace'.

To add another service into an existing BaaS workspace, run the command.

Press F1 and select 'BaaS: Create Service in open Workspace'.

Work with OpenAPI Definitions

The preferred way to define a service is to use an OpenAPI definition of the interface.

The minimum OpenAPI version supported is 3.0.2.

For an existing OpenAPI definition, run the add command and select the file.

Press F1 and select 'BaaS: Add Existing OpenAPI file'.

To create a blank OpenAPI definition to use as a starting point, run the create command.

We recommend using the 'OpenAPI (Swagger) Editor' available under Extensions (CTRL+SHIFT+X).

Press F1 and select 'BaaS: Create new OpenAPI file'.

When OpenAPI files have been added or changed, the generate command must be executed.

Press F1 and select 'BaaS: Generate Code from OpenAPI files'.

Work with Service Handlers

When a BaaS service is created by the create command, one handler is added to the manifest. If another type of trigger is needed, run the add command.

Press F1 and select 'BaaS: Add Service Handler'.

When the Handlers section of the Service Manifest has been manually added or changed, the generate command must be executed.

Press F1 and select 'BaaS: Generate Code from Service Handlers'.

Build and Deploy the Service

To build and deploy a BaaS service, run the build command.

Press F1 and select 'BaaS: Build and Deploy'.

Build the Service with Code Scan

To build with a Code Scan to detect potential security issues, run the build command.

Press F1 and select 'Baas: Code Scan'.

Build and Deploy the Service for Promote

To build and deploy for promote, command marks the service as promotable to another Tenant, that is, the production tenant.

The build promote command also performs a Code Scan and stops if there are code scan findings to be dealt with and approved before deploying the service to the Tenant.

Press F1 select 'BaaS: Promote Build'.

Test the Service

See Manual/Local Development/Postman Client or Manual/Local Development/OpenAPI Swagger Preview.