Skip to content

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

Merged
ahmetb merged 2 commits into
Azure:masterfrom
dovreshef:master
Aug 9, 2016
Merged

Make storage client work correctly with read only secondary accounts#376
ahmetb merged 2 commits into
Azure:masterfrom
dovreshef:master

Conversation

@dovreshef

Copy link
Copy Markdown
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/.

Comment thread storage/client.go Outdated
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
Copy Markdown
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

ahmetb commented Aug 9, 2016

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@ahmetb

ahmetb commented Aug 9, 2016

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor Author

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

@ahmetb

ahmetb commented Aug 9, 2016

Copy link
Copy Markdown
Contributor

Ah okay, in that case, merging.

@ahmetb ahmetb merged commit ca0b022 into Azure:master Aug 9, 2016
@dovreshef

Copy link
Copy Markdown
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