# How to bind an edge service to an edge node

import DocButton from '~/components/webkit/DocButton.vue';
import Tabs from '~/components/tabs/Tabs'


**Edge Services** allows orchestrated services to be managed on your own edge nodes. To do so, you must have an edge service created and to bind it to an edge node.

<DocButton href="/en/documentation/products/guides/deploy/create-edge-service/" label="Go to how to create an edge service" kind="secondary" target="_blank" size="medium" />

You can create a relation between an edge node and an edge service using:

- [Azion Console](/en/documentation/products/guides/how-to-access-azion-console/)
- [Azion API](https://api.azion.com/)

<Tabs client:visible>
    <Fragment slot="tab.console">Console</Fragment>
    <Fragment slot="tab.api">API</Fragment>

<Fragment slot="panel.console">
1. Access [Azion Console](/en/documentation/products/guides/how-to-access-azion-console/).
2. On the upper-left corner of the page, open the **Products menu**, represented by three horizontal lines, and then select **Edge Nodes**.
3. Select the edge node you want to bind to a service.
4. In the **Main Settings** tab, look for the option **Add-On Services** under **Orchestration Modules** and activate it.
5. Go to the **Services** tab and click the **+ Service** button.
6. Choose the service you want to bind and add the variables if needed.
7. Click the **Save** button.
</Fragment>

<Fragment slot="panel.api">
1. Run the following `GET` request in your terminal, replacing `[TOKEN VALUE]` with your [personal token](/en/documentation/products/guides/personal-tokens/) and retrieve the edge node ID you wish to bind to an edge service:

```bash 
curl --location 'https://api.azionapi.net/edge_nodes/' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]'
```

2. Run the following `GET` request in your terminal, replacing `[TOKEN VALUE]` with your [personal token](/en/documentation/products/guides/personal-tokens/) and retrieve the edge service ID you wish to bind to an edge node:

```bash 
curl --location 'https://api.azionapi.net/edge_services/' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]'
```

3. Run the following `POST` request in your terminal:

```bash 
curl --location 'https://api.azionapi.net/edge_nodes/:id/services' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
  "service_id": 0,
  "variables": [
    {
      "name": "string",
      "value": "string"
    }
  ]
}'
```

Replace `[TOKEN VALUE]` with your [personal token](/en/documentation/products/guides/personal-tokens/), `:id` with the ID of the edge node informing the edge node ID and inform the following properties in the request body:

| Property | Description | Required | 
| - | - | - | 
| `service_id` | ID of the edge service being bound to the edge node | Yes |
| `variables` | Variables to be replaced during the processing on the edge node | No (requires checking) |

Now, your edge node and your edge service have a relation between them and are ready to be orchestrated. 

:::tip
Check the [Azion API documentation](https://api.azion.com/) and the [OpenAPI specification](https://github.com/aziontech/azionapi-openapi/) to know more about all features available via API.
:::
</Fragment>

</Tabs>