Azion Object Storage lets you create buckets and integrate your object storage with your edge infrastructure. This guide covers how to create, update, and delete a storage bucket using the Azion API.
By creating a native bucket on Azion, you ensure your data resides on the same global network infrastructure that processes your requests, eliminating fetch latency from external providers and ensuring zero Data Transfer Out (DTO) cost.
Learn more about Object StorageRefer to the guide How to upload and download objects from a bucket to perform object operations.
To create your first bucket via the Azion Console:
- In the upper-left menu, select Object Storage.
- Click the + Bucket button.
- Bucket Name: Set a unique name (between 6 and 63 characters).
- Tip: Use names that describe the purpose, such as
media-assets-prod.
- Tip: Use names that describe the purpose, such as
- Workloads Access: Choose how the Azion platform will interact with your data:
- Read Only: Recommended for serving static content (HTML, images). The Edge can read but not modify.
- Read-Write: Allows Edge applications (Functions) to read and write files to the bucket.
- Restricted: Blocks direct access from the Azion Web Platform; access will only be allowed via API or the S3 Protocol.
- Click Save.
Create a read-only bucket
Run the following POST request in your terminal, replacing [TOKEN VALUE] with your personal token and the name value with the bucket name to create a new read-only bucket:
curl --location 'https://api.azion.com/v4/storage/buckets' \--header 'Accept: application/json; version=3' \--header 'Content-Type: application/json' \--header 'Authorization: Token [TOKEN VALUE]' \--data '{ "name": "my-bucket-ro", "edge_access": "read_only"}'You should receive the following response:
{ "state": "executed", "data": { "name": "my-bucket-ro", "edge_access": "read_only" }}Now you can use the bucket to upload and download objects.
Grant read-write permission to a bucket
Run the following PATCH request in your terminal, replacing [TOKEN VALUE] with your personal token and bucket_name with the bucket name to grant read and write permissions:
curl --location 'https://api.azion.com/v4/storage/buckets/<bucket_name>' \--header 'Accept: application/json; version=3' \--header 'Content-Type: application/json' \--header 'Authorization: Token [TOKEN VALUE]' \--data '{ "edge_access": "read_write"}'You should receive the following response:
{ "state": "executed", "data": { "name": "my-bucket-ro", "edge_access": "read_write" }}Delete a bucket
Run the following DELETE request in your terminal, replacing [TOKEN VALUE] with your personal token and bucket_name with the name of the bucket you want to delete:
curl --location --request DELETE 'https://api.azion.com/v4/storage/buckets/<bucket_name>' \
--header 'Accept: application/json' \
--header 'Authorization: Token [TOKEN VALUE]'
You can adjust permissions or remove buckets as your application evolves.
Change permissions
- In the bucket list, click the name of the desired bucket.
- Change the Access level.
- Click Save.
Delete a bucket
- Make sure there are no objects in the bucket.
- In the bucket list, click the trash icon or select the bucket and click Delete.