If you're generating automated screenshots for your application, you'll eventually need a reliable place to store them. Azure Blob Storage is an excellent choice, especially if your infrastructure already runs on Microsoft Azure or you need enterprise-grade storage with flexible access controls.
In this guide, I'll show you how to automatically save screenshots generated with Urlbox directly to your Azure Blob Storage container. You'll learn how to set up secure access using SAS tokens, configure storage paths, and implement best practices for managing your screenshot archive.
Prerequisites
Before you begin, you'll need:
- An Azure account with an active subscription
- A storage account created in Azure
- A blob container created within that storage account
- A Urlbox account
Understanding SAS tokens and access policies
Azure uses Shared Access Signature (SAS) tokens to grant limited access to your storage resources. Unlike traditional access keys that provide full account access, SAS tokens can be scoped to specific containers and permissions.
Here's the important part: once you generate a SAS token, its permissions and expiry date are fixed. You can't modify them later. This is where Stored Access Policies become essential.
With a stored access policy, you can:
- Update the expiry date without regenerating the token
- Modify permissions on the fly
- Revoke access instantly by deleting the policy
This means you can configure your Urlbox project once and manage access entirely from the Azure Portal. No need to update credentials in your application when tokens expire or permissions change.
Setting up Azure Blob Storage with Urlbox
Let's walk through the setup process step by step.
Step 1: Create a stored access policy
Navigate to your container in the Azure Portal and select Access policy under Settings.
Create a new stored access policy with these settings:
- Identifier: any-name-you-want
- Permissions: Create, Delete (not needed, but recommended)
Click Add to save the policy.
A note on permissions: We recommend starting with just Create and Delete permissions. The Create permission allows Urlbox to upload renders, while Delete enables automatic cleanup of test files. Only add Write permission if you specifically need to use custom paths with the ability to overwrite existing files. We'll talk more about that later
Step 2: Generate a container-level SAS token
Navigate to your container and select Shared access tokens.
Configure the token:
- Signing method: Account key
- Stored access policy: Select
the-policy-you-created-earlier - Permissions: Will be inherited from your policy
- Allowed protocols: HTTPS only
Click Generate SAS token and URL.
Copy the Blob SAS token from the output. It will look something like:
sv=2025-10-30
Keep this token secure - you'll need it for the next step. Remember, once you leave this page, you'll no longer be able to view, edit or delete a created sasToken. (This is why you want to control it's access via an Access Policy)
Step 3: Configure Urlbox with your Azure credentials
Log in to your Urlbox dashboard and navigate to your project settings. Scroll down to the Azure Blob Storage Configuration section.
Click Add Azure Config and fill in:
- Account Name: Your storage account name (e.g.,
mycompanyscreenshots) - Container Name: Your container name (e.g.,
screenshots) - SAS Token: The token you just generated
Click Save Azure Config.
Urlbox will upload a test file to validate the credentials. If your SAS token includes Delete permission, this test file will be automatically removed. Otherwise, you can safely delete it manually from the Azure Portal.
Using Azure Blob Storage with Urlbox
Now that everything is configured, saving screenshots to Azure is as simple as adding one option to your API request.
Basic usage
Now make a request with the URL you want to screenshot to https://api.urlbox.com/render/async:
curl -X POST \
https://api.urlbox.com/v1/render/async \
-H 'Authorization: Bearer your_urlbox_api_secret' \
-H 'Content-Type: application/json' \
-d '
{
"url": "https://www.google.com",
"use_azure": true
}
'
The screenshot will be saved to your Azure container with the render ID as the filename.
Using custom paths
You can organize your screenshots with custom paths using the azure_path option:
curl -X POST \
https://api.urlbox.com/v1/render/async \
-H 'Authorization: Bearer your_urlbox_api_secret' \
-H 'Content-Type: application/json' \
-d '
{
"url": "https://www.google.com",
"use_azure": true,
"azure_path": "screenshots/google/image.png"
}
'
This will save the screenshot to screenshots/google/image.png in your container.
Important: If you need to reuse the same path (overwriting existing files), your SAS token must include Write permission. However, be cautious - enabling Write allows files to be overwritten, which could result in unintentional data loss. Only enable it if you specifically need this capability.
The response will include the full Azure Blob Storage URL where your screenshot is stored. Access to it depends on Anonymous Access on both Storage Account and Container. Remember that allowing anonymous read will allow anyone with the link to view the blob.
Using Azure with render links
If you want to use render links (synchronous rendering) with Azure, you'll need to configure anonymous read access on your container. This allows Urlbox to serve the screenshots directly from Azure.
However, be careful with this approach - anyone with the link can access your files. For sensitive screenshots, it's better to use the asynchronous API and handle distribution through your own application.
Troubleshooting common issues
"Permission denied" error
This usually means your SAS token lacks the required permissions. Verify that your stored access policy includes at least Create permission and it's not expired.
"Container not found" error
Double-check that your account name and container name are spelled correctly.
SAS token expired
If you used a stored access policy, you can extend the expiry date in the Azure Portal without regenerating the token. If you didn't use a policy, you'll need to generate a new token and update your Urlbox configuration.
Overwrite failed when using custom paths
If you're trying to upload to the same azure_path twice, you'll need Write permission in your SAS token. Update your stored access policy to include Write permission.
Conclusion
Azure Blob Storage provides a robust, scalable solution for storing automated screenshots. With Urlbox's built-in Azure integration, you can start archiving screenshots to your own storage with just a few configuration steps.
The combination of SAS tokens and stored access policies gives you enterprise-grade security with the flexibility to manage access without touching your application code. Whether you're building a monitoring tool, creating a content archive, or generating screenshots for your application, Azure Blob Storage can handle your needs at any scale.
Ready to get started? Sign up for a free Urlbox trial and configure your Azure storage in minutes. Check out our complete Azure Blob Storage documentation for more detailed setup instructions and advanced configuration options.

