Before you start
  • Connect the container in CloudFiles first, as described in Azure Blob (steps 3 to 5).
  • Create one subscription for each connected container. A storage account with four connected containers needs four subscriptions.
  • If you use more than one Salesforce org, for example a sandbox and production, set up each org separately with that org's own webhook secret.

Step 1: Navigate to Azure Storage Account

  1. Log into your Azure Portal.
  2. Locate and select your Storage Account from the dashboard or resource groups.

Step 2: Access Events

  • On your storage account overview page, click Events in the left sidebar.

Step 3: Create an Event Subscription

  1. Click on + Event subscription.
  2. Provide a name that identifies the container, e.g., CloudFiles-<container-name>.
  3. Select Event Grid Schema from the dropdown under Event Schema.
  4. Under Topic Details, ensure your storage account details are correctly filled.

Step 4: Configure Event Types

  • Under Event Types, select:
    • Blob Created
    • Blob Deleted

Step 5: Setup Endpoint

  • In the Endpoint details, choose Web Hook.
  • Configure the endpoint URL as:

https://api.cloudfiles.io/webhooks/azure-event-grid/blob

Step 6: Delivery Properties

  1. In the Delivery properties, click Add new header.
  2. Add the following details:
    • Header Name: x-webhook-secret
    • Type: Static
    • Value: Copy this value from the CloudFiles App in the Salesforce org where this container is connected (See screenshot below)
    • Secret: Set to True (check the box)

Use the secret from the same orgEach Salesforce org has its own webhook secret. A secret copied from a different org, for example production when the container is connected in a sandbox, does not work: Azure shows a validation error when you create the subscription.

Step 7: Configure Retry Policies

  1. Navigate to the Additional Features tab.
  2. Under Retry Policies, set:
    • Max Event Delivery Attempts: 30
    • Event Time to Live: 1 day, 0 hours, 0 minutes, and 0 seconds

Step 8: Filter to One Container (Required)

  1. Open the Filters tab.
  2. Check Enable subject filtering.
  3. In Subject Begins With, enter the path below, replacing <container-name> with the exact name of the container. Keep the trailing slash.

/blobServices/default/containers/<container-name>/
This filter is requiredCloudFiles uses this filter to match the subscription to a container. A subscription without it does not work with CloudFiles: Azure shows a validation error when you create it.

Step 9: Create the Subscription and Enable Sync

  1. Review all configurations and click Create.
  2. In CloudFiles, turn on Enable Sync for this container.
  3. Repeat Steps 3 to 9 for each other container you have connected.

Sync starts when you turn on Enable Sync and stops when you turn it off. Files created or deleted in the container while sync is off are not synced later.

Troubleshooting

  • Azure shows a validation error when you create the subscription. Check that the subject filter names one container (Step 8), that the container is connected in CloudFiles, and that the webhook secret comes from the org where the container is connected (Step 6).
  • Enable Sync says the Azure Event Grid subscription has not been validated yet. CloudFiles has no validated subscription for this container. Create one by following Steps 3 to 9. If a correct subscription already exists, delete it and create it again, then turn on Enable Sync.
  • An existing subscription has no subject filter. It sends CloudFiles events for every container in the storage account. Create a filtered subscription for each connected container, then delete the unfiltered one.