# Updating a connector in Azure

Periodically, you may need to update your Azure connector to help maintain functionality, performance, and security.

This article explains how to update and redeploy a connector through the Azure CLI.

***

### Prerequisites

<table><thead><tr><th width="238">Item</th><th>Description</th></tr></thead><tbody><tr><td><strong>Apono Token</strong></td><td><p>Account-specific Apono authentication value<br><br>Use the following steps to obtain your token:</p><ol><li>On the <a href="https://app.apono.io/connectors"><strong>Connectors</strong></a> page, click <strong>Install Connector</strong>.The <strong>Install Connector</strong> page appears.</li><li>Click <strong>Azure > No, Just Install The Connector > CLI (Container Instance)</strong>.</li><li>Copy the token in step listed on the page in step 1.</li></ol></td></tr><tr><td><strong>Azure Command Line</strong><br><strong>Interface (Azure CLI)</strong></td><td><a href="https://learn.microsoft.com/en-us/cli/azure/install-azure-cli">Open-source tool</a> that enables interacting with Azure services using your command-line shell</td></tr><tr><td><strong>Resource Group Name</strong></td><td>Name of the Azure <a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal#open-resource-groups">resource group</a></td></tr><tr><td><strong>Subscription ID</strong></td><td>Identifier for the <a href="https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id">Azure subscription</a></td></tr><tr><td><strong>User Access Administrator Role</strong></td><td><a href="https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#user-access-administrator">Azure subscription role</a> that enables managing user access to Azure resources</td></tr><tr><td><strong>User Administrator Role</strong></td><td><p><a href="https://learn.microsoft.com/en-us/entra/identity/role-based-access-control/permissions-reference#user-administrator">Microsoft Entra ID role</a> that enables the following tasks:</p><ul><li>Create and manage users and groups</li><li>Reset passwords for users, helpdesk administrators, and user administrators</li></ul></td></tr></tbody></table>

***

### Update a connector

To update an Apono connector for Azure, follow these steps in the shell environment with Azure CLI installed:

1. Set the `APONO_CONNECTOR_ID` environment variable to your chosen connector ID.

   ```shell
   export APONO_CONNECTOR_ID=apono-connector
   ```
2. Set the `APONO_TOKEN` environment variable to your account token.

   ```shell
   export APONO_TOKEN=abcd1234-e5f6-7g8h-90123i45678
   ```
3. Set the `SUBSCRIPTION_ID` environment variable to the Azure subscription ID.

   ```shell
   export SUBSCRIPTION_ID=abcdef01-23456789-0abc-def012345678
   ```
4. Set the `RESOURCE_GROUP_NAME` environment variable to the Azure resource group name.

   ```shell
   export RESOURCE_GROUP_NAME=myResourceGroup0816
   ```
5. Set the `REGION` environment variable.

   <pre class="language-shell" data-overflow="wrap"><code class="lang-shell">export REGION=$(az group show --name $RESOURCE_GROUP_NAME --query location --output tsv)
   </code></pre>
6. Run the following command to deploy an updated version of the connector on the Azure Container Instance service.

   <pre class="language-shell" data-overflow="wrap"><code class="lang-shell">az container create --subscription $SUBSCRIPTION_ID --resource-group $RESOURCE_GROUP_NAME --name $APONO_CONNECTOR_ID --ports 80 --os-type linux --image registry.apono.io/apono-connector:&#x3C;&#x3C;connectorVersion>> --environment-variables APONO_CONNECTOR_ID=$APONO_CONNECTOR_ID APONO_TOKEN=$APONO_TOKEN APONO_URL=api.apono.io CONNECTOR_METADATA='{"cloud_provider":"AZURE","subscription_id":"'"$SUBSCRIPTION_ID"'","resource_group":"'"$RESOURCE_GROUP_NAME"'","region":"'"$REGION"'","is_azure_admin":true}' --cpu 1 --memory 1.5 --registry-login-server registry.apono.io --registry-username apono --registry-password $APONO_TOKEN --location $REGION --assign-identity --query identity.principalId --output tsv
   </code></pre>
7. On the [**Connectors**](https://app.apono.io/connectors) page, verify that the connector has been updated.
