Skip to main content
Version: 24.10

Microservices

Through Microservices, you can create, package, and publish scripts so that the technical teams of the organization can easily run them. This also allows delegation to initial support levels for its execution, so that user requests can be effectively addressed, and the most frequent problems can be solved.

The created microservices can be executed on the devices themselves, with local administrator permissions or user session permissions.

marketplace

They can also be scheduled to run at the most opportune moment. They even support event or alert triggers, which can be used as a self-remediation mechanism upon problem detection.

Microservices management

Microservices have several configuration options that modify their behavior; for example, this can change depending on whether the script is run from the user session or from the local administrator.

Activation in Portal

To activate a microservice and have it available for execution in Workspaces, go to Marketplace in Microservices of Portal. From there, after exploring and finding the microservice of interest, you will be able to enable it with the button located at the top right of the interface.

Pasados unos segundos, el microservicio será visible en Workspaces y podrá ser ejecutado en los dispositivos.

Creating microservices

To create a new microservice, you must access the Designer section and click on New. The wizard that opens will ask you to enter the following information:

  • Microservice name
  • Icon color
  • Microservice icon
  • Brief description of what the microservice does
  • The language in which it is developed
  • Version number
  • Execution scope, being possible to select at the system level (administrative access) or at the session level (with the user's identity)
  • Operating system for which it is designed
  • Category: directory or group of accessible microservices from Workspaces where this microservice will be hosted
  • Time efficiency achieved with each execution

The microservice name should not contain special characters (such as \ / : * ? " < > and other language-specific characters for certain keyboard layouts) if the microservice will be used as an end-user Microservice.

MS_Creation

Microservices States

The microservices have three states:

  • Enabled
  • Disabled
  • Archived

Considerations on the code to use

Although microservices allow the execution of any CMD or PowerShell command on Windows devices, the commands sent will be executed from the local administrator or from the user session, depending on the scope assigned to them. This may mean that some cmdlets do not have the expected output concerning the execution; for this reason, if you are creating a script in PowerShell, you must consider a series of considerations:

  • It is recommended that the version of PowerShell installed on the devices be the same as the one used to develop the microservices.

  • Microservices can be executed under the user's session identity or from the local administrator.

    • Execution from the local administrator: in Scope you can configure Applies to Workspaces or Applies to servers, which makes it much easier to interact with processes, services, and act with administrative permissions on the device, but it may complicate access to user-specific information or their session.

    • Execution from the user session: in Scope you can configure Applies to user sessions, which is very useful for accessing user information such as the registry, information contained in the profile, etc. It should be noted that the script will run with the user's permission level, so if the user is not a local administrator there will be certain limitations when they want to act at the system level.

  • When we want to display a message in the microservice's output, it is recommended to use the cmdlet "Write-Output" instead of "Write-Host".

  • The output of the execution can be consulted in the details of the Job generated during the execution.

Ways to consume the microservices

Microservices can be created and enabled in the Portal, and from there they can be configured to be executed by the end user, initiated via a Flow, or to be executed with automated or support actions from Workspaces.

Execution by the end user

In Portal -> Enabled by clicking on a microservice, you access its characteristics. In the Recipients tab -> Execution from Workspaces, the execution permissions that the microservice has in Workspaces are shown. Next, in Execution by the end user, you can see if the microservice has the option to be executed by the end user enabled. If so, it shows the user's name and the number of devices where it is available.

target_microservice

If the Execution by the end user option is activated, the microservice will add a button on the user's device home screen, so they can execute it more easily and directly.

The microservice name should not contain special characters (such as \ / : * ? " < > and other language-specific characters for certain keyboard layouts) if the microservice will be used as an end-user Microservice.

ms_inicio

A configuration change to an existing end-user microservice can take up to 15 minutes to apply to all linked devices.

Execution via a flow

Flows is a feature that can be configured in the Portal. It allows the creation of automation flows and the automatic execution of a microservice when certain conditions on the device are met.

Its main feature is that, through the execution of a microservice, it simplifies proactive diagnostic actions and quickly solves problems when there is a focus on their detection. In the section Flows more information about their features and configuration can be obtained.

Execution from Workspaces

Desde el módulo Workspaces se puede ejecutar cualquier microservicio que haya sido habilitado previamente en Portal. To do so, the user must go to the Workspaces or Sessions tab and select the device(s) to which they want to apply the microservice.

Microservices will be available from the Workspaces tab when they have been previously configured to run at the system level. And from Sessions when the option to run at the session level has been selected in its configuration.

The authority to execute certain microservices will depend on the user's role or permissions on the platform.

type_ms_wsp


Microservices in Automate

It is also possible to execute a microservice from the Automate module. In this case, users do not have to go to the Home screen of their device to activate it; they can do it from the Service Catalog, a space that acts as a self-service panel for the user to choose the microservice they wish to execute.

selfservice

Executing a microservice from Automate has two advantages:

  • It allows the creation of parameters: certain microservices can have different selectable values, where the user can decide the type of information they want to obtain when activating the microservice. It also has the option to enter the value of a variable to customize the execution.

  • They can go through an approval flow: when executing microservices that can have significant implications, such as economic or security, they will require going through an approval process within their own organization and by Flexxible.