﻿---
title: Upgrade EDOT Cloud Forwarder for Azure
description: Upgrade an existing deployment of EDOT Cloud Forwarder for Azure.
url: https://docs-v3-preview.elastic.dev/elastic/edot-cloud-forwarder-azure/tree/main/reference/edot-cf-azure/upgrade
products:
  - EDOT Cloud Forwarder
  - EDOT Cloud Forwarder for Azure
  - Elastic Cloud Serverless
  - Elastic Observability
applies_to:
  - Serverless Observability projects: Preview
  - Elastic Distribution of OpenTelemetry Cloud Forwarder for Azure: Preview since 0.7
---

# Upgrade EDOT Cloud Forwarder for Azure
This page describes how to upgrade an existing deployment of EDOT Cloud Forwarder for Azure to a later version.

## Upgrade process

Upgrading an existing deployment means re-running the deployment command with the later Bicep template. Azure will update the existing infrastructure and application code in place.
<stepper>
  <step title="Download the new Bicep template">
    Download the latest Bicep template from the release URL:
    ```sh
    curl -L https://ela.st/edot-cf-azure-template -o ecf.bicep
    ```
    You can verify the version included in the template:
    ```sh
    grep 'param version' ecf.bicep
    ```
  </step>

  <step title="Re-run the deployment command">
    Run the same deployment command you used for the initial installation, pointing to the new template file:
    ```sh
    az deployment group create \
        --resource-group <resource_group_name> \
        --template-file ecf.bicep \
        --parameters \
            otlpEndpoint=<otlp_endpoint> \
            elasticApiKey=<elastic_api_key> \
            eventHubPartitionCount=8 \
            eventHubMessageRetentionInDays=1
    ```
    Azure will update the existing resources in the resource group to match the new template.
  </step>
</stepper>


## Breaking changes

Not all upgrades can be applied in place. Code-only changes are generally safe and unlikely to introduce breaking changes. However, infrastructure changes may not be compatible with previous versions.
For example, EDOT Cloud Forwarder 0.7.0 migrated from the Consumption hosting plan to the Flex Consumption plan. Azure doesn't support in-place upgrades from Consumption to Flex Consumption for Function Apps.

### Upgrade when in-place changes aren't supported

When an in-place upgrade is impossible, follow these steps:
<stepper>
  <step title="Deploy a new instance">
    Create a new deployment with the updated version in a separate resource group, as described in [Deploy EDOT Cloud Forwarder for Azure](https://docs-v3-preview.elastic.dev/elastic/edot-cloud-forwarder-azure/tree/main/reference/edot-cf-azure/deploy).
  </step>

  <step title="Route traffic to the new deployment">
    Update your diagnostic settings or Data Collection Rules to stream telemetry to the new deployment's Event Hubs namespace.
  </step>

  <step title="Remove the old deployment">
    Once you've confirmed the new deployment is receiving and processing data correctly, remove the old resource group:
    ```sh
    az group delete --name <old_resource_group_name>
    ```

    <warning>
      If you remove the old resource group, any unprocessed data in the old Event Hubs will be lost.
    </warning>
  </step>
</stepper>