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

Azure: Support authentication using user-assigned managed identity #4636

Merged
merged 3 commits into from
Sep 14, 2021

Conversation

amrmahdi
Copy link
Contributor

@amrmahdi amrmahdi commented Sep 3, 2021

Adds support for user-assigned managed identity.

When using the user_assigned_id the change does not require setting msi_resource it defaults to https://<storage account name>.<endpoint> unless the config explicitly sets the msi_resource.

Tested against Azure.

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Verification

@amrmahdi amrmahdi changed the title [azure] Support authentication using user-assigned managed identity Azure: Support authentication using user-assigned managed identity Sep 3, 2021
Adds support for [user-assigned managed identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview#managed-identity-types).

When using the `user_assigned_id` the change does not require setting `msi_resource` it defaults to `https://<storage account name>.<endpoint>` unless the config explicitly sets the `msi_resource`.

Tested against Azure.

Signed-off-by: Amr Hanafi (MAHDI)) <amrh@microsoft.com>
wiardvanrij
wiardvanrij previously approved these changes Sep 3, 2021
Copy link
Member

@wiardvanrij wiardvanrij left a comment

Choose a reason for hiding this comment

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

Ah this is nice. Explains the different auth methods much better than I could figure out from the MS docs lol. Readme is spot on and makes a lot of sense. Just a little nitpick/suggestion on the code logic.

pkg/objstore/azure/helpers.go Outdated Show resolved Hide resolved
Signed-off-by: Amr Hanafi (MAHDI)) <amrh@microsoft.com>
wiardvanrij
wiardvanrij previously approved these changes Sep 3, 2021
@amrmahdi
Copy link
Contributor Author

amrmahdi commented Sep 6, 2021

@bwplotka Hoping this can get on the 0.23 release train :)

Signed-off-by: Amr Hanafi (MAHDI)) <amrh@microsoft.com>
Copy link
Member

@GiedriusS GiedriusS left a comment

Choose a reason for hiding this comment

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

👍

@GiedriusS GiedriusS merged commit 00bb6f7 into thanos-io:main Sep 14, 2021
someshkoli pushed a commit to someshkoli/thanos that referenced this pull request Nov 7, 2021
…hanos-io#4636)

* Azure: Support authentication using user-assigned managed identity

Adds support for [user-assigned managed identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview#managed-identity-types).

When using the `user_assigned_id` the change does not require setting `msi_resource` it defaults to `https://<storage account name>.<endpoint>` unless the config explicitly sets the `msi_resource`.

Tested against Azure.

Signed-off-by: Amr Hanafi (MAHDI)) <amrh@microsoft.com>

* refactor service token fetch into own method

Signed-off-by: Amr Hanafi (MAHDI)) <amrh@microsoft.com>

* do not use deprecated method

Signed-off-by: Amr Hanafi (MAHDI)) <amrh@microsoft.com>
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