Skip to content

Commit

Permalink
azure: tweak documentation for endpoint suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelEischer committed Jul 7, 2023
1 parent 068b115 commit e36d17a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 5 additions & 1 deletion changelog/unreleased/issue-2468
@@ -1,6 +1,10 @@
Enhancement: Add support for non-global Azure clouds

Restic backups on azure only worked for storages on the global domain `core.windows.net`. This meant that backups to other domains such as Azure China (`core.chinacloudapi.cn') were not supported. Restic now allows overriding the global domain using the environment variable `AZURE_ENDPOINT_SUFFIX'.
Restic backups on Azure only supported storages using the global domain
`core.windows.net`. This meant that backups to other domains such as Azure
China (`core.chinacloudapi.cn') or Azure Germany (`core.cloudapi.de`) were
not supported. Restic now allows overriding the global domain using the
environment variable `AZURE_ENDPOINT_SUFFIX'.

https://github.com/restic/restic/issues/2468
https://github.com/restic/restic/pull/4387
6 changes: 3 additions & 3 deletions doc/030_preparing_a_new_repo.rst
Expand Up @@ -537,12 +537,12 @@ or
$ export AZURE_ACCOUNT_NAME=<ACCOUNT_NAME>
$ export AZURE_ACCOUNT_SAS=<SAS_TOKEN>
Restic will use Azure's global domain ``core.windows.net`` by default. You can specify other
domains to be used like so:
Restic will by default use Azure's global domain ``core.windows.net`` as endpoint suffix.
You can specify other suffixes as follows:

.. code-block:: console
$export AZURE_ENDPOINT_SUFFIX=<ENDPOINT_SUFFIX>
$ export AZURE_ENDPOINT_SUFFIX=<ENDPOINT_SUFFIX>
Afterwards you can initialize a repository in a container called ``foo`` in the
root path like this:
Expand Down
2 changes: 1 addition & 1 deletion doc/040_backup.rst
Expand Up @@ -614,7 +614,7 @@ environment variables. The following lists these environment variables:
AZURE_ACCOUNT_NAME Account name for Azure
AZURE_ACCOUNT_KEY Account key for Azure
AZURE_ACCOUNT_SAS Shared access signatures (SAS) for Azure
AZURE_ENDPOINT_SUFFIX Domain of Azure Storage (default: core.windows.net)
AZURE_ENDPOINT_SUFFIX Endpoint suffix for Azure Storage (default: core.windows.net)
GOOGLE_PROJECT_ID Project ID for Google Cloud Storage
GOOGLE_APPLICATION_CREDENTIALS Application Credentials for Google Cloud Storage (e.g. $HOME/.config/gs-secret-restic-key.json)
Expand Down
3 changes: 2 additions & 1 deletion internal/backend/azure/config.go
Expand Up @@ -72,7 +72,8 @@ func (cfg *Config) ApplyEnvironment(prefix string) {
if cfg.AccountSAS.String() == "" {
cfg.AccountSAS = options.NewSecretString(os.Getenv(prefix + "AZURE_ACCOUNT_SAS"))
}

if cfg.EndpointSuffix == "" {
cfg.EndpointSuffix = os.Getenv("AZURE_ENDPOINT_SUFFIX")
cfg.EndpointSuffix = os.Getenv(prefix + "AZURE_ENDPOINT_SUFFIX")
}
}

0 comments on commit e36d17a

Please sign in to comment.