Skip to content
Cloudflare Docs

Serve /static-assets from Azure Blob Storage

Route requests with a URI path starting with /static-assets to an Azure Blob Storage container using Cloud Connector.

To serve static assets from an Azure Blob Storage container:

  1. Log in to the Cloudflare dashboard and select your account and domain.
  2. Navigate to Rules > Cloud Connector.
  3. Select Microsoft Azure - Blob Storage as your cloud provider.
  4. Enter the bucket URL. Use the following URL structure:
    • Subdomain-style URL: Set the hostname to <BUCKET_NAME>.blob.core.windows.net. In this case, your bucket should include a folder named static-assets, and files should be placed inside this folder. For example, https://<YOUR_HOSTNAME>/static-assets/style.css will map to https://<BUCKET_NAME>.blob.core.windows.net/static-assets/style.css.
  5. (Optional) Use URL Rewrite Rules to adjust the URL structure. For example, you can create a URL rewrite that changes /static-assets to /my-pages-project/static-assets to match the file structure of your object storage bucket.
  6. (Optional) Use Cache Rules to adjust the caching behavior for objects returned from the bucket. For example, you can create a cache rule that caches every returned object matching the /static-assets URI path for seven days (defined through the Edge TTL setting).
  7. Click Next and enter a descriptive name like Serve static assets from Azure in Cloud Connector name.
  8. Under If, select Custom filter expression and enter the following expression: http.request.full_uri wildcard "http*://<YOUR_HOSTNAME>/static-assets/*"
  9. Select Deploy to activate the rule.

This setup ensures that all traffic matching http*://<YOUR_HOSTNAME>/static-assets/* (HTTPS and HTTP requests) is served from your Azure Blob Storage container. Make sure to replace <YOUR_HOSTNAME> with your actual hostname and adjust the example paths according to your setup.