Data Export

Data Export to Azure Blob Storage: setup step by step

How to create a container, issue a SAS token with the four permissions a delivery needs, and connect it in AdShift.

Azure Blob Storage receives partitioned Parquet or CSV files, written into a container you own. AdShift needs a credential to write there, and the recommended one — a container-scoped SAS token — expires on its own and grants nothing outside that container.

This article is the setup walkthrough. For what gets exported and on what schedule, see Data Export.


What you need

  • An Azure Storage account with Blob Storage (StorageV2 or Blob, any tier that supports hot or cool access).
  • Permission to create a container and generate a SAS on it — Storage Account Contributor or the ability to read the account keys.
  • About five minutes.

1. Create a dedicated container

Use a container only for AdShift data. Exported partitions are written and, on a re-delivery, written again under a new version folder, and a container you also write to yourself makes the two hard to separate.

In the Azure portal: Storage account → Containers → + Container. Name it something like adshift-export and leave the access level at Private (no anonymous access).

Container names are lowercase letters, digits and single hyphens, and cannot start or end with a hyphen. AdShift checks this before saving, so a name Azure would reject is caught in the connection form.


2. Generate a SAS token on the container

Generate the SAS on the container, not on the account. An account SAS covers every container you own, which is more than the export needs and the first thing a security review flags.

  1. Open the container.
  2. Click Shared access tokens in the left menu.
  3. Leave Signing method as Account key and pick a signing key.
  4. Under Permissions, tick Read, Write, Delete and List.
  5. Set Expiry to a date comfortably beyond the life of the connection — a year is typical. A SAS that expires stops deliveries silently from Azure's point of view; AdShift surfaces it as a failed run, but you still lose the partitions in between until you replace the token.
  6. Leave Allowed IP addresses empty. Deliveries come from AdShift's infrastructure and the addresses are not fixed.
  7. Click Generate SAS token and URL.

Copy the value labelled Blob SAS token. It starts with sp= and contains sig= and se=.

Do not copy the Blob SAS URL. It is the container address with the token appended, and pasting it into the token field is the single most common setup mistake. AdShift rejects it in the form rather than letting it fail later as a signature error.

Why all four permissions

Each one is used by a normal delivery:

Permission Used for
Write (w) Writing the partition's data files and the _SUCCESS marker
Read (r) Verifying a written blob during the connection test
List (l) Enumerating a partition so a retry can be clean
Delete (d) Removing the test blob, and clearing a partial partition before a retry

A SAS missing one of them passes some checks and fails mid-partition, so AdShift refuses it up front.


Alternative: a storage account key

If your organisation cannot issue a SAS, AdShift also accepts the storage account key — Storage account → Access keys → Show → key1.

Understand the trade: the account key grants full control of every container in the account, cannot be scoped, and does not expire. Rotating it invalidates it everywhere, not just for AdShift. Prefer the SAS unless something prevents it.

The key is stored encrypted and is never shown back to you; the connection form displays [redacted] and leaving the field blank on an edit keeps the stored value.


3. Connect it in AdShift

Go to Data Export → Connections → New connection, pick Azure Blob and fill in:

Field What to enter
Connection name Lowercase letters, digits and hyphens, e.g. azure-marketing
Storage account name Just the name, e.g. acmeexports — not the full https://… URL
Container name adshift-export
Path prefix Optional. A folder inside the container, e.g. adshift. Leave empty to write at the container root
Authentication SAS token (recommended) or Storage account key
SAS token / Storage account key The value from step 2

The panel shows a live preview of where data will land as you type, so you can confirm the path before saving.

Click Test connection. Four checks run — write a probe blob, read it back, list the container, delete the probe — and each is reported separately, so a failure names the permission that is missing rather than just saying the credential is bad.

Then click Save, open Reports on the connection, and pick your datasets.


What you get in the container

adshift-export/
  adshift/                          <- your path prefix, if you set one
    t=clicks/dt=2026-09-15/h=14/
      data_0_0_0.snappy.parquet
      _SUCCESS
  • t= is the dataset, dt= the date, h= the hour. Daily datasets have no h= element.
  • The layout is Hive-style, so Synapse, Databricks and Spark discover the partitions without extra configuration.
  • _SUCCESS is written after every data file. Wait for it before reading a folder; a folder without it is still being written.
  • A re-delivery after late data adds a v=2 element (then v=3, and so on). The first delivery of a partition has no version element. Read the highest version present and treat earlier ones as superseded.
  • If you chose By app folder structure, an app_id= element appears before the version.

If something goes wrong

"SAS token must include the signature (sig) and expiry (se) parameters" — the Blob SAS URL was pasted instead of the token. Copy the shorter value, the one that starts with sp=.

"SAS token is missing … permission" — regenerate it with Read, Write, Delete and List all ticked. Azure does not let you add a permission to an existing token.

AuthenticationFailed on the write check — usually a clock or expiry problem: check se= in the token is in the future, and that the token has not been invalidated by rotating the account key it was signed with.

AuthorizationFailure despite correct permissions — check the storage account firewall under Networking. If it is set to Enabled from selected virtual networks and IP addresses, AdShift cannot reach it; deliveries need public network access to the blob endpoint.

ContainerNotFound — the container name is right but on a different storage account, or the container was created under a different account in the same subscription.

Blobs stop appearing after months of working — the SAS expired. Generate a new one and paste it into the connection; nothing else needs to change.


Revoking access

Disable or delete the connection in AdShift first, then revoke the credential. For a SAS, rotate the account key it was signed with — Azure has no way to revoke a single SAS otherwise, which is another reason to keep expiries finite. For an account key, rotate it in Access keys.

Data already delivered is in your container and is unaffected either way.


See also