Skip to main content

Deploy from Azure Container Registry (ACR) to VideoSDK Cloud

This guide walks you through building, pushing, and deploying an agent container image stored in Azure Container Registry (ACR) to VideoSDK Agent Cloud.

You will:

  1. Build your Docker image with the VideoSDK CLI.
  2. Push the image to Azure Container Registry.
  3. Create an image pull secret in VideoSDK Cloud for ACR.
  4. Deploy your agent using the ACR image and image pull secret.

Prerequisites

  • A working agent project with a Dockerfile.
  • Azure account with access to an ACR registry.
  • Azure CLI installed and logged in.
  • VideoSDK CLI installed and authenticated.

1. Build Image with VideoSDK CLI

Use the videosdk agent build command to build your Docker image.

videosdk agent build \
--image myregistry.azurecr.io/my-agent:latest

Replace myregistry with your ACR registry name and my-agent with your repository name.

2. Push Image to ACR

Login to ACR and push the built image.

# Login to ACR
az acr login --name myregistry

# Push using VideoSDK CLI
videosdk agent push \
--image myregistry.azurecr.io/my-agent:latest \
--server myregistry.azurecr.io

3. Create Image Pull Secret for ACR

To allow VideoSDK Cloud to pull your private image, you need to create an image pull secret with your ACR credentials.

Obtaining ACR Credentials

You can use either an Admin User or a Service Principal:

  1. Admin User (Simplest):

    • Go to the Azure Portal > Container Registries > Select your registry.
    • Under Settings, select Access keys.
    • Ensure Admin user is enabled.
    • Use the Registry name as -u (username) and one of the passwords as -p.
  2. Service Principal (Recommended):

    • Create a Service Principal with AcrPull permissions.
    • Use the Application (client) ID as -u (username) and the Client Secret as -p (password).

Create the Secret

videosdk agent image-pull-secret my-acr-secret \
--server myregistry.azurecr.io \
-u myusername \
-p mypassword

Replace myusername and mypassword with the values obtained above.

4. Deploy Agent Using ACR Image

Now deploy your agent, referencing both the ACR image and the image pull secret you just created.

videosdk agent deploy \
--image myregistry.azurecr.io/my-agent:latest \
--image-pull-secret my-acr-secret \
--min-replica 1 \
--max-replica 3

Your agent will now run on VideoSDK Cloud using the image stored in Azure Container Registry.

Got a Question? Ask us on discord