You are looking at the documentation of a prior release. To read the documentation of the latest release, please visit here.

Microsoft Azure Storage

Stash supports Microsoft’s Azure Blob Storage as a backend. This tutorial will show you how to use this backend.

In order to use Azure Blob Storage as backend, you have to create a Secret and a Repository object pointing to the desired blob container.

Create Storage Secret

To configure storage secret for this backend, following secret keys are needed:

KeyTypeDescription
RESTIC_PASSWORDRequiredPassword that will be used to encrypt the backup snapshots
AZURE_ACCOUNT_NAMERequiredAzure Storage account name
AZURE_ACCOUNT_KEYRequiredAzure Storage account key

Create storage secret as below,

$ echo -n 'changeit' > RESTIC_PASSWORD
$ echo -n '<your-azure-storage-account-name>' > AZURE_ACCOUNT_NAME
$ echo -n '<your-azure-storage-account-key>' > AZURE_ACCOUNT_KEY
$ kubectl create secret generic -n demo azure-secret \
    --from-file=./RESTIC_PASSWORD \
    --from-file=./AZURE_ACCOUNT_NAME \
    --from-file=./AZURE_ACCOUNT_KEY
secret/azure-secret created

Create Repository

Now, you have to create a Repository crd. You have to provide the storage secret that we have created earlier in spec.backend.storageSecretName field.

Following parameters are available for azure backend.

ParameterTypeDescription
azure.containerRequiredName of Storage container.
azure.prefixOptionalPath prefix inside the container where backed up data will be stored.
azure.maxConnectionsOptionalMaximum number of parallel connections to use for uploading backup data. By default, Stash will use maximum 5 parallel connections.

Below, the YAML of a sample Repository crd that uses an Azure Blob container as a backend.

apiVersion: stash.appscode.com/v1alpha1
kind: Repository
metadata:
  name: azure-repo
  namespace: demo
spec:
  backend:
    azure:
      container: stash-backup
      prefix: /demo/deployment/my-deploy
    storageSecretName: azure-secret

Create the Repository we have shown above using the following command,

$ kubectl apply -f https://github.com/stashed/docs/raw/v2024.4.8/docs/guides/backends/azure/examples/azure.yaml
repository/azure-repo created

Now, we are ready to use this backend to backup our desired data using Stash.

Next Steps

  • Learn how to use Stash to backup workloads data from here.
  • Learn how to use Stash to backup databases from here.
  • Learn how to use Stash to backup stand-alone PVC from here.