# Hosting

Custom Management Dashboard extensions and cloud functions extend the Emporix platform with tailored logic and integrations. To deploy and run these solutions, you need a reliable hosting environment — Emporix provides exactly that with its built-in, scalable hosting functionality.

{% hint style="warning" %}
Hosting of the extensions and cloud functions is not included in standard billing plans and is billed separately on a pay-as-you-go basis. If you're interested in getting access to the feature, contact the [Sales Team](mailto:support@emporix.com).
{% endhint %}

The **Hosting** view of the Management Dashboard provides a single touchpoint to manage anything related to the hosting of extensions and cloud functions. Instead of running your own cloud infrastructure, use this view to create a hosting project, define how the extension / cloud function is exposed, deploy new versions, and monitor usage and activity. Everything is handled within the Emporix environment, based on a standardized, secure hosting model.

## Create a project

When you want to host any resource on the Emporix side, first you need to initialize a project as a one-time action.

{% stepper %}
{% step %}
**Set up a project**

Go to the **Administration** -> **Hosting** to start your project configuration. Choose the **Initialize project** action.

<figure><img src="/files/DtzlRufRexhO713oki1r" alt="Hosting project initialization" width="300"><figcaption><p>Initialize a hosting project</p></figcaption></figure>

The initialization takes a few minutes to complete. When the process is done, the project gets assigned with a unique **Project ID**. You can now start adding custom extensions and cloud functions to be hosted by Emporix.

<figure><img src="/files/NxzOpSbVviiw4dZ4zmHy" alt="Hosting initialized"><figcaption><p>Initialized empty hosting project</p></figcaption></figure>
{% endstep %}
{% endstepper %}

## Managing extensions hosting

Extensions are custom add-ons that extend the Emporix Management Dashboard with new modules or perspectives. Use the **Hosting** view to deploy, manage, and monitor your extensions directly within the Emporix environment.

{% hint style="warning" %}
The Emporix infrastructure allows you to host up to 20 extensions.
{% endhint %}

### Prerequisites

Ensure your extension is built in a format compatible with the Emporix Management Dashboard. Extensions must follow the MD extension template that is based on the module federation concept to be accepted by the hosting environment. For more information, refer to the [MD Module Template](https://github.com/emporix/md-module-template) repository.

### Host an extension

Follow these steps to host a custom extension.

{% stepper %}
{% step %}
**Start a new extension hosting**

In the **Administration** -> **Hosting** view, choose the **New extension hosting**.
{% endstep %}

{% step %}
**Configure the hosting details**

Provide the hosting details:

* **Hosting ID** - Provide a unique identifier of the hosting, the ID becomes a part of the hosting URL.
* **Extension registration** - Choose where to place the extension - it can be available either as an extension (module) or as a perspective in the Management Dashboard.
* **Display names** - Enter the localized names for the extension to display in the UI.
* **Path URL** - (For *perspectives* only) Define the URL path where the extension is available at; it starts with the `/`.

<figure><img src="/files/uk7Xvs538WRDbHLyEkRd" alt="Extension hosting configuration" width="400"><figcaption><p>Extension hosting configuration</p></figcaption></figure>

When done, choose **Create** to save the configuration.
{% endstep %}

{% step %}
**Go to the hosting details**

Open the card with the details of the created hosting.

<figure><img src="/files/amN8UcqeAVahqtMjOz5y" alt="Extension hosting details" width="400"><figcaption><p>Extension hosting details</p></figcaption></figure>

The details view allows you to monitor the extensions usage metrics as well as to check the build details and upload new versions. The first time you come here, the view is empty.

<figure><img src="/files/Va2QxZd59oR2rcXT9iiC" alt="Extension hosting details view"><figcaption><p>Extension hosting details view</p></figcaption></figure>
{% endstep %}

{% step %}
**Deploy the extension**

Choose the **New deployment** to upload the extension. You have a few options for adding the extension:

* **GitHub** - Deploy from a repository.
  * Provide the URL, token and relevant branch.
* **Upload** - Attach and upload an archive with the extension.
  * Select `zip` or `tar.gz` from your device.

Confirm the extension upload with the **Deploy** action.
{% endstep %}

{% step %}
**Build an extension**

After the upload, the system triggers the extension build process. You can monitor the progress of the build steps.

If there is any technical obstacle, the build fails.

<figure><img src="/files/JEvEoJuIgthIIjXA2JDU" alt="Extension deployment failed"><figcaption><p>Extension deployment failed</p></figcaption></figure>

When everything is correct, the build ends successfully.

<figure><img src="/files/jW5E9c9JBeKO7Li2QVtk" alt="Successful extension deployment"><figcaption><p>Successful extension deployment</p></figcaption></figure>

You can see the details such as the Deployment ID and timeline.

The successful build pushes the extension to the release state — you see that the version appears under the **Releases** section labelled as `Current` and `Finalized`.

<figure><img src="/files/YeyMc8zdW2y44gPnI0hH" alt="Extension release"><figcaption><p>Extension release</p></figcaption></figure>

The release results in pushing the extension to the Management Dashboard **Extensions** module or **Perspectives** — depending on your initial setup. You can start using the hosted extension straightaway.
{% endstep %}
{% endstepper %}

### Deployment lifecycle

To update your custom extension with new logic or provide technical fixes, deploy a new version.

Go to the selected extension hosting details and choose the **New deployment**. Then, upload the updated file either from a GitHub repository or directly from your device.

Each time you deploy a new version of an extension, a build is triggered. All the builds are visible in the **Build History**. Build details include deployment ID, build ID, status, and timeline.

{% hint style="success" %}
**Extensions Rollback**

Each time you deploy a new version of an extension, the previous versions remain visible in the **Releases** panel. Each published version shows the details such as version ID, status, and timeline. If for any reason you need to return to the previous version of the deployed extension, you can use the **Rollback** option. This triggers a build and release of that version.
{% endhint %}

### Monitor extensions metrics

The **Hosting** view allows you to control the usage related to hosting extensions. The usage is a basis for the hosting costs calculation. You get insights into the following data:

* **Storage usage** - Total storage volume (in MB) currently used by your hosted extensions.
* **Network bandwidth** - Total data transfer volume (in MB) related to network usage.

<figure><img src="/files/SOyN6DOSNP6rWdEVma37" alt="Extensions metrics"><figcaption><p>Extensions metrics</p></figcaption></figure>

## Managing cloud functions hosting

Cloud functions are serverless pieces of custom logic that can be triggered by events, APIs, or other platform processes. Use the **Hosting** view to deploy, manage, and monitor your cloud functions directly within the Emporix environment.

### Prerequisites

Prepare a cloud function that contains the business logic corresponding to your needs. To see the example of a cloud function structure, refer to the [Extension and Cloud Function Hosting](/ce/extensibility-and-integrations/extensibility-cases/extension-hosting.md#cloud-functions).

### Host a cloud function

Follow these steps to host a custom cloud function.

{% stepper %}
{% step %}
**Start a new cloud function hosting**

In the **Administration** -> **Hosting** view, choose the **New cloud function hosting**.
{% endstep %}

{% step %}
**Configure the hosting details**

Enter the cloud function name and selectone of the available runtime environments.
{% endstep %}

{% step %}
**Open the hosting details**

Open the card with the created cloud function details. The view is empty when you enter it for the first time, but it allows you to monitor the cloud function hosting and upload the custom code.

<figure><img src="/files/D6It2sxA9uHvAkmd3vrQ" alt="Cloud function hosting details"><figcaption><p>Cloud function hosting details</p></figcaption></figure>
{% endstep %}

{% step %}
**(Optional) Set variables**

You can define custom environment variables that are used in the cloud function to decode credentials data. Choose the **Environment variables** and provide key-value pairs.

<figure><img src="/files/ryF1n14pBjIbdUNrGvca" alt="Cloud function environment variables"><figcaption><p>Setting environment variables for a cloud function</p></figcaption></figure>
{% endstep %}

{% step %}
**Deploy a cloud function**

Choose the **New deployment** option to add the cloud function code. You have a few options for adding the cloud function:

* **GitHub** - Deploy from a repository.
  * Provide the URL, access token and relevant branch.
* **Upload** - Attach and upload an archive with the cloud function.
  * Select `zip` or `tar.gz` from your device.

Confirm the cloud function upload with the **Deploy** option.
{% endstep %}

{% step %}
**Build a cloud function**

After the upload, the system triggers the cloud function build process. You can monitor the progress of the build steps in real-time. The successful build ends after a few minutes.

<figure><img src="/files/kTLcSXtgIL3rjRIpxT0Z" alt="Successful cloud function deployment"><figcaption><p>Successful cloud function deployment</p></figcaption></figure>

You can see the details such as the Deployment ID and timeline of the steps.

{% hint style="info" %}
To add a new version of the cloud function, follow the same steps and deploy a new file. The build history shows all previous deployment details.
{% endhint %}

The successful build prepares the cloud function to be exposed in the Partner Library or used within custom integrations through an API.

{% hint style="success" %}
Learn more about how to invoke the hosted cloud function in the [Invoking cloud functions](/ce/extensibility-and-integrations/extensibility-cases/extension-hosting.md#invoking-cloud-functions).
{% endhint %}
{% endstep %}
{% endstepper %}

### Deployment lifecycle

To update your custom cloud function with new logic or provide technical fixes, deploy a new version.

Go to the selected hosting details and choose the **New deployment**, then upload the updated file either from a GitHub repository or directly from your device.

Each time you deploy a new version of a cloud function, a build is triggered. All the builds are visible in the **Build History**. Build details include deployment ID, build ID, status, and timeline.

### Monitor cloud function resources usage

Overall hosting costs for cloud functions are calculated based on the usage metrics below. In the **Hosting** view, you see the following charts:

* **Requests** - Number of requests triggered by the cloud function.
* **Request latency** - Average latency time (in milliseconds).

<figure><img src="/files/NUWUT3kf2CbV8DnFtFIA" alt="Cloud function metrics"><figcaption><p>Cloud function metrics</p></figcaption></figure>

#### Logs

The hosting details of a particular cloud function show the full logs of how and when it is being invoked in the system. You can monitor the operations with the cloud function and see their outcomes.

<figure><img src="/files/DaOrjOBpFcOHWYmYo4r6" alt="Cloud function logs"><figcaption><p>Cloud function logs</p></figcaption></figure>

{% hint style="info" %}
See also the [Extension and Cloud Function Hosting](/ce/extensibility-and-integrations/extensibility-cases/extension-hosting.md).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/ce/management-dashboard/administration/hosting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
