---
updatedAt: 2026-05-12T09:55:28.000Z
agentTools:
  projectIndex: https://vi.developers.datature.com/llms.txt
---

# Sync From Azure Blob Storage

Connect a Datature Vi dataset to an Azure Blob Storage container using a service principal and a scoped role assignment. Read-only sync that keeps blobs in your Storage Account.

<WorkflowStages current="prepare-your-data" />

Datature Vi reads images and videos from an Azure Blob Storage container using a service principal that you authorise inside your Azure tenant. The service principal gets the **Storage Blob Data Reader** role on a single container, scoped through a condition so it cannot read anything else in the Storage Account. This guide walks through the full setup.

<ViCallout type="info" title="Before You Start">
  * A paid Datature Vi account. External bucket sync is not available on the free tier.
  * An active Azure subscription with Blob Storage configured.
  * Azure CLI installed locally and signed in (`az login`).
  * A Storage Account with at least one container and the assets you want to sync.
  * Permission to create service principals and assign IAM roles in your subscription.
</ViCallout>

<StepCarousel
  steps={[
    {
      title: "Open the Explorer tab",
      image: "https://files.readme.io/25d607264bda9f61746d57d93eeeb709416b0c73aceebdc2e912cb4f67a0b6ce-Explorer-05-12-2026_03_03_PM.png",
      description: "In the left sidebar, click the Explorer tab on your dataset. This is where the synced assets will appear after the connection is set up."
    },
    {
      title: "Click Connect to External Buckets",
      image: "https://files.readme.io/24eca59d104d380dfd2d9109d5532f4c022090be8de656527158acfd58f353d8-Explorer-05-12-2026_04_43_PM.png",
      description: "Click the Connect to External Buckets button in the top-right of the Explorer, then choose Azure Blob Storage from the storage options."
    },
    {
      title: "Blob Details",
      image: "https://files.readme.io/9a0659ba06bcdde0d0bf13041645601cb318244a8cbbc9710df2ca1b52ce0cd5-Explorer-05-12-2026_05_06_PM.png",
      description: "Enter the connection name, Storage Account name, container name, and optional folder prefix. Click Next to generate the service principal ID and role assignment identifier."
    },
    {
      title: "Azure Policy Configuration",
      image: "https://files.readme.io/d3259285795ede4944611370aef004edbb6124be6be456978ef83eca4a5a5638-Explorer-05-12-2026_05_06_PM_1.png",
      description: "Vi displays the service principal ID and the role assignment identifier. Run the az ad sp create command, then assign the Storage Blob Data Reader role with the container condition in the Azure portal."
    },
    {
      title: "Verify Connection Status",
      image: "https://files.readme.io/6f0ca4fc649eea6262fe528085b859c2043a88941e98b8b1db561aa408d8d026-Explorer-05-12-2026_03_06_PM.png",
      description: "Vi tests the connection by listing one object in the bucket. A green status means the credentials and endpoint are correct. A red status surfaces the specific failure reason. You can choose to sync assets now or later."
    },
    {
      title: "Preview Files to Sync",
      image: "https://files.readme.io/28fb2d1b2c33f74e019a39e899f3d9b3f5cbb58fc1ece80409e2fcd57931fbeb-Explorer-05-12-2026_03_06_PM_1.png",
      description: "If you choose to sync now, Vi scans the bucket prefix and lists the objects it found. Confirm the file count and sample paths look right, then click Sync to start ingestion."
    },
    {
      title: "Sync Started",
      image: "https://files.readme.io/5d431094f67ec474ff3b21a88a8817f3f686311c3bd0764ca478b63a7788748f-Explorer-05-12-2026_03_06_PM_2.png",
      description: "Vi confirms the sync is running in the background. Click I Understand to close the wizard; the sync continues without an open browser tab."
    },
    {
      title: "Track Sync Progress",
      image: "https://files.readme.io/6dc88ababa705ae129a33267f098ecbf50a038a33691ef1c09173552a9cf5085-Explorer-05-12-2026_03_06_PM_3.png",
      description: "Open the Connected Bucket dropdown in the top-right of the Explorer to see the connection status, bucket, prefix, asset count, and a progress bar while assets are retrieved."
    }
  ]}
/>

<UIResultPreview variant="verify" screenshot="https://files.readme.io/7993b2a46fd1040afde9dbb8a5c34a330a235e4731ee913e4162437734fdc92d-Explorer-05-12-2026_04_37_PM.png" caption="Synced images appear in the dataset Explorer. The asset count in the header reflects the blobs that passed the format checks." />

## Step 1: Enter the blob details

Open your dataset, then walk through the wizard.

The Blob Details tab asks for four fields:

<ParamTable title="Blob details">
  <Param name="Connection Name" type="string" required={true} description="A label you choose for this connection. Used to identify the connection in the Connection Manager." />

  <Param name="Storage Account Name" type="string" required={true} description="The name of the Azure Storage Account that holds your container. Three to 24 lowercase letters and numbers, no special characters." />

  <Param name="Container Name" type="string" required={true} description="The container inside the Storage Account that holds your assets." />

  <Param name="Folder Prefix" type="string" required={false} description="A path prefix to scope the sync to a subfolder. Leave empty to sync the whole container." />
</ParamTable>

Click **Next**. Vi generates a unique service principal ID and a role assignment identifier for the next step.

## Step 2: Create the service principal

Vi shows you a unique application ID. Run this command in a shell where the Azure CLI is signed in, replacing the placeholder with the value Vi gave you:

<Terminal title="Create the Datature service principal">
  {`az ad sp create --id <UNIQUE_ID_GENERATED_BY_VI>`}
</Terminal>

This registers a service principal in your tenant for the Vi application. The command finishes with a JSON object describing the principal. You do not need to copy any of that output; the next step uses the role assignment identifier from the Vi wizard, not from this command.

## Step 3: Assign the Storage Blob Data Reader role

Grant the service principal read-only access to the container. The condition below restricts the role to your specific container, so the principal cannot list or read blobs anywhere else in the Storage Account.

<Steps>
  <Step stepNumber="1" title="Open Access Control on the Storage Account">
    In the Azure portal, open the Storage Account, then click **Access Control (IAM)**.

    Assign the role on the **Storage Account**, not on the container or an individual blob. The condition scopes access to a single container; assigning the role at the container level breaks the listing call.
  </Step>

  <Step stepNumber="2" title="Add a role assignment">
    Click **Add**, then **Add role assignment**. Search for and select **Storage Blob Data Reader**.
  </Step>

  <Step stepNumber="3" title="Set the member">
    Switch to the **Members** tab. Paste the IAM Role Assignment identifier that the Vi wizard generated.
  </Step>

  <Step stepNumber="4" title="Add the container condition">
    Switch to the **Conditions** tab and add a condition. Paste the expression below, replacing `<YOUR_CONTAINER_NAME>` with the container you entered in Step 1.

    <CodeGroup>
      ```text Container condition
      (
        (
          !(ActionMatches{'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read'})
        )
        OR
        (
          @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:name] StringEquals '<YOUR_CONTAINER_NAME>'
        )
      )
      ```
    </CodeGroup>
  </Step>

  <Step stepNumber="5" title="Review and assign">
    Click **Review + assign** twice to apply the role.
  </Step>
</Steps>

<ViCallout type="warning" title="Assignment scope matters">
  The role must be assigned at the **Storage Account** level with the container condition above. If you assign it directly on the container or on an individual blob, the listing API call fails and Vi reports a connection error.
</ViCallout>

## Step 4: Configure CORS (videos only)

You only need this step if your container holds video assets. Image previews work without CORS.

<Steps>
  <Step stepNumber="1" title="Open Resource sharing (CORS)">
    In the Storage Account, click **Settings**, then **Resource sharing (CORS)**.
  </Step>

  <Step stepNumber="2" title="Add the Vi origin">
    Add a CORS rule under the **Blob service** tab using `GET` as the allowed method.

    <InfoTable title="Azure CORS entry" headers={['Allowed origins', 'Allowed methods']}>
      <InfoRow cells={['`https://vi.datature.com/`', '`GET`']} />
    </InfoTable>
  </Step>

  <Step stepNumber="3" title="Save">
    Click **Save**. The change takes effect immediately.
  </Step>
</Steps>

## Step 5: Confirm the connection

Back in the Vi wizard, click **Next** to test the connection. Azure can take up to five minutes to propagate the role assignment, so a connection failure right after Step 3 does not always mean something is wrong.

If the test fails, wait a few minutes and click **Retry**. If the failure persists, jump to the troubleshooting section.

## Step 6: Sync your assets

Choose **Sync Now** to start the first sync immediately, or **Sync Later** to set up the connection without syncing. If you pick **Sync Now**, Vi walks through three more screens before the sync starts in earnest.

1. **Preview Files to Sync.** Vi scans the container prefix and shows the file count alongside a sample of blob paths. Confirm the preview matches what you expect, then click **Sync**.
2. **Sync Started.** A confirmation appears letting you know the job is running in the background. Click **I Understand** to dismiss the dialog; the sync continues even after you close the wizard or the browser tab.
3. **Track progress.** Open the **Connected Bucket** dropdown in the top-right of the Explorer to see the connection name, status, provider, container, prefix, asset count, and a live progress bar while blobs are retrieved.

The first sync takes 5 to 40 minutes depending on the container size.

## Asset requirements

Blobs in the container must meet the same format rules as direct uploads.

<InfoTable title="Azure asset requirements" headers={['Asset type', 'Requirement']}>
  <InfoRow cells={['Images', 'No EXIF orientation tag, or an orientation value of 1.']} />

  <InfoRow cells={['MP4 videos', 'Major brand `mp42` and pixel format `yuv420p`. Run `ffprobe your-video.mp4` to verify.']} />

  <InfoRow cells={['Other formats', 'See [Upload Images](https://vi.developers.datature.com/docs/upload-images) and [Upload Videos](https://vi.developers.datature.com/docs/upload-videos) for the full supported list.']} />
</InfoTable>

Annotations are not part of the bucket sync. Vi reads only image and video metadata from the Azure container. If you have existing labels in COCO, YOLO, Pascal VOC, CSV, or Vi JSONL, [upload them directly to Vi](https://vi.developers.datature.com/docs/upload-annotations) once the assets finish syncing.

## Troubleshooting

<ViAccordionGroup>
  <ViAccordionItem title="Connection test fails right after I added the role">
    Azure changes can take up to five minutes to propagate. Wait a few minutes and click **Retry** in the wizard.
  </ViAccordionItem>

  <ViAccordionItem title="Connection test still fails after waiting">
    The most common cause is assigning the role at the wrong scope. Confirm the role is on the Storage Account (not on the container or a blob) and that the condition references the correct container name. Re-paste the JSON if needed.
  </ViAccordionItem>

  <ViAccordionItem title="Sync finished but some assets are missing">
    Check your remaining data row quota in [Billing](https://vi.developers.datature.com/docs/billing). Synced blobs count toward the same monthly quota as direct uploads. Files that fail the format requirements (rotated images, non-`mp42` videos) are skipped during sync.
  </ViAccordionItem>

  <ViAccordionItem title="Video previews fail to load in the browser">
    Confirm the CORS rules above are present on the Storage Account. Image previews work without CORS, but video streaming requires the cross-origin headers.

    Verify the current CORS configuration with the Azure CLI:

    <Terminal title="List CORS rules on the Storage Account">
      {`az storage cors list \\
          --account-name your-account \\
          --services b`}
    </Terminal>

    The output should include `https://vi.datature.com` under `AllowedOrigins`. If the rule is missing, re-add it from Step 4.
  </ViAccordionItem>

  <ViAccordionItem title="Previews load but the image is rotated">
    The image has an EXIF orientation tag other than 1. You have two options.

    **Option 1: Bake the orientation into the pixels with ImageMagick.** This rotates the image data and resets the orientation tag to 1.

    <Terminal title="Auto-orient with ImageMagick">
      {`mogrify -auto-orient your-image.jpg`}
    </Terminal>

    **Option 2: Strip the orientation tag with exiftool.** Use this when the pixels are already correct and only the tag is wrong.

    <Terminal title="Remove the EXIF orientation tag">
      {`exiftool -Orientation= -overwrite_original your-image.jpg`}
    </Terminal>

    To process a whole folder, point either tool at the directory:

    <Terminal title="Batch fix every image in a folder">
      {`mogrify -auto-orient ./images/*.jpg
                                                      exiftool -Orientation= -overwrite_original -r ./images`}
    </Terminal>

    Re-upload the fixed files to the container and run the sync again.
  </ViAccordionItem>

  <ViAccordionItem title="I changed the container but Vi still shows old blobs">
    Re-run the sync from the Connection Manager. Container changes do not propagate automatically; Vi re-reads the metadata only when you start a new sync.
  </ViAccordionItem>
</ViAccordionGroup>

## Next steps

<BentoGrid className="grid grid-cols-1 md:grid-cols-3 gap-4 my-6">
  <BentoCard title="Annotate Data" description="Label the synced images and videos in the visual annotator." href="doc:annotate-data" faIcon="fa-solid fa-pen-to-square" />

  <BentoCard title="Sync From External Buckets" description="Compare Azure Blob with the other supported storage providers." href="doc:sync-from-external-buckets" faIcon="fa-solid fa-cloud-arrow-down" />

  <BentoCard title="Train A Model" description="Fine-tune a vision-language model on the synced dataset." href="doc:train-a-model" faIcon="fa-solid fa-brain" />
</BentoGrid>