﻿---
title: Deploy Elastic Cloud Forwarder for Azure
description: Deploy the Elastic Cloud Forwarder for Azure using Bicep templates and Azure CLI.
url: https://www.elastic.co/docs/reference/opentelemetry/edot-cloud-forwarder/azure/deploy
products:
  - Elastic Cloud Forwarder
  - Elastic Cloud Forwarder for Azure
  - Elastic Cloud Serverless
  - Elastic Observability
applies_to:
  - Serverless Observability projects: Preview
  - Serverless Security projects: Preview
  - Elastic Cloud Forwarder for Azure: Preview since 0.7
---

# Deploy Elastic Cloud Forwarder for Azure
Follow these steps to deploy Elastic Cloud Forwarder for Azure in a resource group to send telemetry data to the Elastic Cloud Managed OTLP Endpoint endpoint.

## Deploy automatically

You can deploy Elastic Cloud Forwarder for Azure automatically with **Deploy to Azure**:
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fedotcfazure5gdoxpg7d2rim.blob.core.windows.net%2Freleases%2Fv0.10.0%2Fecf.json/uiFormDefinitionUri/https%3A%2F%2Fedotcfazure5gdoxpg7d2rim.blob.core.windows.net%2Freleases%2Fv0.10.0%2Fecf.uiFormDefinition.json)
This opens the Azure portal with the Bicep template pre-filled. You can then configure the parameters and deploy the template. In the **Essentials** step, the **Encoding** section lets you select the logs encoding mode. You can also download [the Elastic Cloud Forwarder for Azure Bicep template](https://ela.st/edot-cf-azure-template).

## Deploy using Azure CLI

<stepper>
  <step title="Create the resource group">
    Create the resource group that hosts all the resources for Elastic Cloud Forwarder for Azure.
    ```sh
    az group create --name <resource_group_name> --location <azure_region>
    ```
  </step>

  <step title="Download the Bicep template">
    Download [the Elastic Cloud Forwarder for Azure Bicep template](https://ela.st/edot-cf-azure-template).
  </step>

  <step title="Deploy the Bicep template">
    Deploy the Bicep template using the following command:
    ```sh
    az deployment group create \
        --resource-group <resource_group_name> \
        --template-file ecf.bicep \
        --parameters \
            otlpEndpoint=<otlp_endpoint> \ 
            elasticApiKey=<elastic_api_key> \ 
            logsEncodingExtension=<encoding> \ 
    ```
    For a complete list of parameters, refer to [Configure Elastic Cloud Forwarder for Azure](https://www.elastic.co/docs/reference/opentelemetry/edot-cloud-forwarder/azure/configure).
  </step>
</stepper>


## Collect telemetry data

Once Elastic Cloud Forwarder for Azure is deployed, configure the Azure side to stream telemetry to the Event Hubs created by the deployment. Each signal has its own setup steps:
- [Logs](/docs/reference/opentelemetry/edot-cloud-forwarder/azure/signals/logs#collection) — set up Diagnostic Settings to stream Activity logs and resource logs.
- [Metrics](/docs/reference/opentelemetry/edot-cloud-forwarder/azure/signals/metrics#collection) — set up Data Collection Rules or Diagnostic Settings for platform metrics.


## Upgrade an existing deployment

To upgrade an existing Elastic Cloud Forwarder for Azure deployment to a later version, refer to [Upgrade Elastic Cloud Forwarder for Azure](https://www.elastic.co/docs/reference/opentelemetry/edot-cloud-forwarder/azure/upgrade).

## Remove the resource group

If you no longer need the resources and want to remove them, use the following command:
```sh
az group delete --name <resource_group_name>
```

This removes all the resources in the resource group.
<warning>
  If you remove the resource group, data that's still unprocessed will be lost.
</warning>