Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of parameter "azure domain" when use azure blob storage as a repository #2468

Closed
diddowill opened this issue Nov 8, 2019 · 5 comments · Fixed by #4387
Closed

Lack of parameter "azure domain" when use azure blob storage as a repository #2468

diddowill opened this issue Nov 8, 2019 · 5 comments · Fixed by #4387
Labels
backend: azure help: minor complexity less complex issue, good for beginners that want a little challenge yet not too complicated help: wanted

Comments

@diddowill
Copy link

Output of restic version

restic 0.9.5 compiled with go1.11.5 on linux/amd64

Describe the issue

According to the manual here (https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#microsoft-azure-blob-storage),
we need to provide account name and access key when use azure block storage as a repository.
But that does not work if you azure domain is not azure global, like azure China and azure Germany.
Error is returned as below:

storage: service returned error: StatusCode=403, ErrorCode=AuthenticationFailed, ErrorMessage=Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

The solution from Azure tech. support is, we must specify azure domain in this case as their tool Azure Storage Explore does.

@whs-dot-hk
Copy link
Contributor

hi

looks like the NewBasicClient

client, err := storage.NewBasicClient(cfg.AccountName, cfg.AccountKey)

is used here

which uses the default base url

DefaultBaseURL = "core.windows.net"

@rawtaz rawtaz added the state: need triaging need categorizing, labeling, next-step decision label Nov 22, 2019
@shtratos
Copy link

You can workaround this by using rclone backend:
https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#other-services-via-rclone

rclone supports specifying the azure endpoint via --azureblob-endpoint
https://rclone.org/azureblob/#advanced-options

@MichaelEischer MichaelEischer added help: wanted help: minor complexity less complex issue, good for beginners that want a little challenge yet not too complicated backend: azure and removed state: need triaging need categorizing, labeling, next-step decision labels May 15, 2022
@MichaelEischer
Copy link
Member

Adding a configuration parameter for the azure backend that allows overriding the default BaseURL should be enough to solve this issue.

@arjunajesh
Copy link
Contributor

@MichaelEischer I would like to work on this issue.
Just to be sure, should the domain be passed through an env variable (for example AZURE_DOMAIN)

@arjunajesh
Copy link
Contributor

I believe that I have a solution for this issue. Does anyone have a Chinese Azure account for me to test my fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: azure help: minor complexity less complex issue, good for beginners that want a little challenge yet not too complicated help: wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants