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

Fix issue #88: Use env to set Azure auth if existed #91

Merged

Conversation

atlas-comstock
Copy link
Collaborator

No description provided.

@atlas-comstock
Copy link
Collaborator Author

I tested this on local, it works.

return spt, err
if settings, err := auth.GetSettingsFromEnvironment(); err == nil {
if cc, err := settings.GetClientCredentials(); err == nil {
monitor.Info("azure: acquired Manange Identity Credentials from ENV")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be better to use "acquired credentials from Environment" because the one below it is not a managed identity, but rather a service principal. I think it was an oversight before

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, thanks, good observation

@atlas-comstock atlas-comstock force-pushed the use-env-for-azure-auth-if-existed branch from e6a773c to 95344a7 Compare May 19, 2022 04:08
@atlas-comstock
Copy link
Collaborator Author

2022/06/01 03:00:46 azure: acquired Manange Identity Credentials
panic: ServerError: target=storage/writer/azure/azure.go.107, reason=Internal Server Error, msg=azure: unable to get azure storage credential due to adal: Refresh request failed. Status Code = '404'. Response body: <?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>404 - Not Found</title>
 </head>
 <body>
  <h1>404 - Not Found</h1>
 </body>
</html>
 Endpoint http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fstorage.azure.com%2F

goroutine 1 [running]:
main.openTable(0x40008363b0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40008363a0, 0x9, ...)
        /go/src/talaria/main.go:108 +0x27c
main.main()
        /go/src/talaria/main.go:68 +0xaec

@kelindar kelindar merged commit c6fb73c into talariadb:master Jun 2, 2022
@atlas-comstock atlas-comstock deleted the use-env-for-azure-auth-if-existed branch June 2, 2022 07:17
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.

4 participants