Skip to main content

Azure Blob Storage Upload

The Azure Blob Storage upload lets you send flat data files securely to Una's Azure Blob Storage container. Use it for data that you export from your own systems and want brought into Una.

Unlike the CRM and ERP connectors, Una doesn't pull anything from your systems. You push the files to Una, using a time-limited Shared Access Signature (SAS) URL that Una gives you.

What it does​

  1. Share your details. You tell the Una team who to contact and how much data to expect.
  2. Receive a SAS URL. Una gives you a secure upload address for your container.
  3. Upload. You send your CSV files to that address, either from a script or by hand.

Before you start​

You'll need:

Step 1 — Send us your details​

Before your first upload, share the following with the Una technical team:

  • Technical contact details. The name, email address and phone number of the main person we should contact to verify transmissions.
  • Source IP addresses (optional). If your network restricts outbound traffic, send us your public egress IP addresses so that we can whitelist them.
  • Expected file volume and frequency. Roughly how large your files will be and how often you'll send them, for example daily, weekly or ad hoc.

We'll then send you the SAS URL for your container. It comes in two parts: the container address and the SAS token.

Step 2 — Prepare your file​

Files are ingested automatically, so they need to follow these rules:

  • Format. CSV (comma-separated values). UTF-8 encoding is strongly preferred.
  • Delimiter. A standard comma (,).
  • Header row. The first row must contain the column names.
  • File name. DatasetName_yyyyMMdd.csv, for example SalesData_20261016.csv.

Step 3 — Upload with AzCopy​

We recommend running AzCopy from PowerShell. It's built for speed and reliability on large datasets, and it retries automatically if the connection drops.

  1. Copy the script below into a new .ps1 file.
  2. Replace the three placeholders:
    • C:\path\to\Filename.csv with the full path to your file.
    • <<Container name>> with your container name.
    • <<SAS Token>> with the SAS token we sent you.
  3. Run the script. If it works, it ends with uploaded <your file name>.
# ==============================================================================
# Script: Azure Blob File Upload Script (AzCopy Method)
# ==============================================================================

# 1. Define Local File and SAS URL Configuration
$localFilePath = "C:\path\to\Filename.csv"
$container = "https://etlstorage.blob.core.windows.net/<<Container name>>"
$sas = "<<SAS Token>>"

if (-not (Get-Command azcopy -ErrorAction SilentlyContinue))
{
Write-Error "azcopy not found in PATH";
exit 1
}

if (-not (Test-Path $localFilePath))
{
Write-Error "file not found: $localFilePath";
exit 1
}

$fileName = [System.IO.Path]::GetFileName($localFilePath)

azcopy copy "$localFilePath" "$container/$($fileName)?$sas" --block-blob-tier "Cool"

if ($LASTEXITCODE -ne 0)
{
Write-Error "upload failed, exit code $LASTEXITCODE";
exit 1
}

Write-Host "uploaded $fileName"
tip

Make sure word wrap is off in your editor when you paste the script. A command that wraps onto two lines will fail.

If you can't use AzCopy​

Some environments don't have AzCopy installed, and some security policies don't allow third-party executables to run on the server. Each option below works around one of those cases.

Use AzCopy without installing it​

This is the quickest fix. AzCopy is a single portable azcopy.exe file, so it doesn't need an admin install.

  1. Download the standalone executable from Microsoft's AzCopy documentation.
  2. Put azcopy.exe in the same folder as your PowerShell script.
  3. Reference it directly instead of relying on PATH:
.\azcopy.exe copy $LocalFilePath $TargetBlobUrl

Upload with native PowerShell​

If no external executables are allowed, you can upload through the Azure Storage REST API using only what's built into PowerShell. You don't need to install anything.

Set $LocalFilePath to your file, and set $SasUrl to the full SAS URL (the container address, then ?, then the SAS token):

# ==============================================================================
# Native PowerShell REST API Upload (AzCopy Alternative)
# ==============================================================================

$LocalFilePath = "C:\DataUploads\SalesData_20261016.csv"
$SasUrl = "https://<account>.blob.core.windows.net/<container>?<sas-token-string>"

# Split SAS URL components
$BaseUrl, $SasToken = $SasUrl -split '\?', 2
$FileName = [System.IO.Path]::GetFileName($LocalFilePath)
$DestinationUrl = "$BaseUrl/$FileName`?$SasToken"

# Read file bytes
$FileBytes = [System.IO.File]::ReadAllBytes($LocalFilePath)

# Define Azure Storage REST Headers
$Headers = @{
"x-ms-blob-type" = "BlockBlob"
}

# Perform HTTP PUT request
try {
Write-Host "Uploading file via Native REST API..." -ForegroundColor Cyan
$Response = Invoke-RestMethod -Uri $DestinationUrl -Method Put -Headers $Headers -Body $FileBytes -ContentType "text/csv"
Write-Host "Upload completed successfully!" -ForegroundColor Green
} catch {
Write-Error "Upload failed: $_"
}

Upload by hand with Azure Storage Explorer​

If you'd rather upload by hand than run a script:

  1. Download Azure Storage Explorer.
  2. Select Connect to Azure Storage → Blob Container → Use a shared access signature (SAS) URI.
  3. Paste the SAS URL we sent you.
  4. Drag and drop your CSV file into the container.

Keeping your upload secure​

warning

SAS URLs expire automatically. Make sure your files are transferred within the operational window we've agreed with you.

Treat the SAS URL and SAS token like a password:

  • Don't hardcode them in scripts that are committed to a shared or public code repository.
  • Don't write them to logs or anywhere else they could be seen.

Troubleshooting​

azcopy not found in PATH. AzCopy isn't installed, or PowerShell can't find it. Either install it, or put azcopy.exe next to your script and call it as .\azcopy.exe. See Use AzCopy without installing it.

file not found. The path in $localFilePath is wrong. Check it, including the file extension.

upload failed, exit code … or Upload failed: …. The most common cause is a SAS URL that has expired. Check that you copied the container name and SAS token in full, then contact the Una team for a fresh SAS URL if you need one. If your network restricts outbound traffic, also confirm that we've whitelisted your egress IP addresses.

For any other technical problem with your uploads, contact your Una representative.