Antti Alasvuo
Nov 30, 2025
visibility 946
star star star star star
(0 votes)

Mastering Optimizely DXP: How to Download Blobs Like a Pro with PowerShell

In 2021 I wrote a blog post with detailed instuctions on how to download blobs from Optimizely DXP environment. I at least have used that blog post ever since as my notes "What were the steps" when ever I've needed to download projects blobs to my local. But every time I've downloaded blobs I have thinked that I should write a simple PowerShell script that does all the steps for me after I have provided the API credential and environment information. It would be also nice, if the script would print out the container names and I could select which container to download.

Well it took me four years to find the time to write the PowerShell script but here it is.

Prerequisities

  • EpiCloud PowerShell module installed
  • AzCopy installed
  • Optimizely DXP API credential or access to PAAS-portal to create API credential
  • Get my script from GitHub Gist (might be updated in future) and save it as download-dxp-blobs.ps1, or use the one this page

You can check my old blog post for the install instructions.

Using the PowerShell script

  • Open command prompt and navigate to the folder where you have the script
  • The Optimizely EpiCloud module is not signed and therefore You have to run PowerShell bypassing execution policy, so in command prompt run the following command:
    • powershell.exe -ExecutionPolicy Bypass
  • Now execute the script with the required arguments
    • & .\download-dxp-blobs.ps1
      • -ApiKey [your API key]
      • -ApiSecret [your API secret]
      • -ProjectId [your project id]
      • -Environment [Optimizely DXP environment string]
      • -DownloadPath [path where to download in double quotes]
      • -RetentionHours [how many hours SAS link is valid]
        • This is optional, default is four hours

Sample command:

& .\download-dxp-blobs.ps1 -ApiKey 1234567890123456238937223 -ApiSecret 9874677436746763443434dsaJKDSSJKHD -ProjectId 4D50395E-3805-498E-AD8C-82D7F530A596 -Environment Production -DownloadPath "C:\Downloads\DXP\ProjectXBlobs" -RetentionHours 6

Sample output from the script:

 

PowerShell script for reference

Here is the script for reference, but you can also get it from this gist.

# Simple script to download Optimizely DXP blobs
# Created by Antti Alasvuo
# https://github.com/alasvant
# https://world.optimizely.com/blogs/Antti-Alasvuo/
#
# Gist: https://gist.github.com/alasvant/f41f8ffec7826b94efdc1b5796ae4d36
#
# ApiKey, ApiSecret and ProjectId You get from Optimizely PAAS-portal (DXP Management Portal) from API tab,
# create new API credential there if you don't have one yet
#
# Environment: Integration, Preproduction or Production
#
# DownloadPath, is the path where the selected container is downloaded to
#
# RetentionHours, how many hours the created SAS link is valid (how long this script can access the containers blobs)
# Default is 4 hours, you should ensure it is greater value than how long it takes to download all the blobs

# Get needed arguments for Optimizely cmd-lets
param (
 [Parameter(Mandatory)]
 [string]
 $ApiKey,
 [Parameter(Mandatory)]
 [string]
 $ApiSecret,
 [Parameter(Mandatory)]
 [string]
 $ProjectId,
 [Parameter(Mandatory)]
 [string]
 $Environment,
 [Parameter(Mandatory)]
 [string]
 $DownloadPath,
 [int]
 $RetentionHours = 4
)

# Not using Connect-EpiCloud because then when calling Get-EpiStorageContainer the "table"
# output is printed to console where ever I try to redirect the output :D

Write-Host 'Getting DXP containers..'
Write-Host ''

$containers = Get-EpiStorageContainer -ClientKey $ApiKey -ClientSecret $ApiSecret -ProjectId $ProjectId -Environment $Environment | Select-Object -ExpandProperty storageContainers

# Just a counter used in the loop to have not zero based numbers in the selection
$foreachCounter = 1

foreach ($containerName in $containers)
{
	Write-Host ("{0}) {1}" -f ($foreachCounter++), $containerName)
}

$selectedIndex = -1

do
{
	$isInputValid = [int]::TryParse((Read-Host 'Enter container number (and press enter)'), [ref]$selectedIndex)
	
	if ((-not $isInputValid))
	{
		Write-Host 'Invalid value entered.'
	}
	elseif (($selectedIndex -lt 1) -or ($selectedIndex -gt $containers.length))
	{
		Write-Host 'Invalid number selected for container.'
		$isInputValid = $false
	}
} while (-not $isInputValid)

$selectedContainerName = $containers[$selectedindex-1]

Write-Host ''
Write-Host ("Selected container: {0}" -f $selectedContainerName)

Write-Host ''
Write-Host 'Acquiring SAS link..'

$sasLink = Get-EpiStorageContainerSasLink -ClientKey $ApiKey -ClientSecret $ApiSecret -ProjectId $ProjectId -Environment $Environment -StorageContainer $selectedContainerName -RetentionHours $RetentionHours | Select-Object -ExpandProperty sasLink

Write-Host 'SAS link acquired.'
Write-Host ''

Write-Host 'Starting download using azure copy.'
Write-Host ''

azcopy copy $sasLink $DownloadPath --recursive

Write-Host "Done."

 

Footer note: Would you have guessed that the blog post heading was created by Copilot :D

 

Nov 30, 2025

Comments

error Please login to comment.
Latest blogs
Architecting an Enterprise-Grade Development Pipeline in Optimizely SaaS CMS

Most enterprise teams show up to Optimizely SaaS CMS with a clear roadmap for their release pipeline: DEV → QA → Stage → Prod. Four logical...

Vipin Banka | Jul 12, 2026

Bynder DAM Connector for Optimizely SaaS CMS: Improved Metadata Property Synchronization

While working with the Bynder DAM Connector for Optimizely SaaS CMS , one of the key areas I explored was how Bynder asset metadata is synchronized...

Vipin Banka | Jul 11, 2026

Optimizely DXP: Every Supported Culture, One Searchable Page

Quick one for anyone building multi-language sites on Optimizely DXP. I put together a reference tool listing all 806 supported cultures. More...

Adnan Zameer | Jul 10, 2026 |

A day in the life of an Optimizely OMVP: London Meetup 2026

On 2nd July 2026 the Optimizely London Developer Meetup returned to The Lightwell, and the running theme across the evening was less about individu...

Graham Carr | Jul 10, 2026

Optimizely’s Summer ’26 Roadmap: The CMS Is Starting to Look Less Like a Publishing Tool and More Like Marketing Infrastructure

Optimizely’s Summer ’26 Product Roadmap event was not just a list of product updates. At least, that is not the part I found most interesting. The...

Augusto Davalos | Jul 9, 2026

Optimizely Content JS SDK v2.1.0 — What's New and Why It Matters

  v2.1.0 of the Optimizely Content JS SDK and CLI landed on July 7, 2026. This is a substantial release bringing a wave of capabilities for...

Vipin Banka | Jul 8, 2026