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

Make storage client work correctly with read only secondary accounts #376

Merged
merged 2 commits into from
Aug 9, 2016

Conversation

dovreshef
Copy link
Contributor

We need to remove the "-secondary" string from the account name when using it to authorize access.

See also here: https://blogs.technet.microsoft.com/ksasaki/2013/12/23/use-ra-grs/.

func (c Client) getCanonicalizedAccountName() string {
// since we may be trying to access a secondary storage account, we need to
// remove the -secondary part of the storage name
return strings.Replace(c.accountName, "-secondary", "", -1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be strings.TrimSuffix?

@ahmetb
Copy link
Contributor

ahmetb commented Aug 9, 2016

See also here: https://blogs.technet.microsoft.com/ksasaki/2013/12/23/use-ra-grs/.

@dovreshef do you know if there is an English version of this article?

@dovreshef
Copy link
Contributor Author

@ahmetalpbalkan that's the only mention of the issue that I found. Had to use Google translate :).

@ahmetb
Copy link
Contributor

ahmetb commented Aug 9, 2016

@dovreshef I'm trying to understand why would you specify storage account name as the -secondary endpoint in your code. Why do you need to hit the secondary endpoint instead of the primary one? I'm not familiar with the topic quite enough.

@dovreshef
Copy link
Contributor Author

@ahmetalpbalkan We use it to simulate a regional downtime, read all the backups off the storage.

@ahmetb
Copy link
Contributor

ahmetb commented Aug 9, 2016

Ah okay, in that case, merging.

@ahmetb ahmetb merged commit ca0b022 into Azure:master Aug 9, 2016
@dovreshef
Copy link
Contributor Author

@ahmetalpbalkan thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants