Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

[ms_rest_azure] Introduce support for acquiring token from Managed Service Identity#889

Merged
vishrutshah merged 8 commits intoAzure:masterfrom
vishrutshah:msi-support
Aug 25, 2017
Merged

[ms_rest_azure] Introduce support for acquiring token from Managed Service Identity#889
vishrutshah merged 8 commits intoAzure:masterfrom
vishrutshah:msi-support

Conversation

@vishrutshah
Copy link
Copy Markdown
Contributor

Addresses #884

@vishrutshah
Copy link
Copy Markdown
Contributor Author

@devigned @veronicagg @sarangan12 Feel free to review as you get chance. Thanks!

@veronicagg
Copy link
Copy Markdown
Contributor

@vishrutshah do you know what's going on with CI failing? what's the issue with nokogiri? is it just a CI problem?

Copy link
Copy Markdown
Contributor

@veronicagg veronicagg left a comment

Choose a reason for hiding this comment

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

Is there a sample or end to end scenario that shows this working for the purpose it's being created?
Code looks good, just a couple of minor questions.

def self.get_settings(azure_environment = MsRestAzure::AzureEnvironments::Azure)
settings = ActiveDirectoryServiceSettings.new
settings.authentication_endpoint = azure_environment.active_directory_endpoint_url
settings.token_audience = azure_environment.resource_manager_endpoint_url
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.

is the token_audience expected to be different from the ActiveDirectoryServiceSettings? how do we know which one should be?

Copy link
Copy Markdown
Contributor Author

@vishrutshah vishrutshah Aug 14, 2017

Choose a reason for hiding this comment

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

I guess yes from the documentation describing the MSI authentication flow, default token audience is https://management.azure.com/ and not https://management.core.windows.net/. but let me verify again because it might be just another audience that works

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As usual, you're right...it's just an another resource token audience. The one we have with ActiveDirectoryServiceSettings also works for acquiring token ...I'll refactor it then. thanks!

it 'should initialize with Azure Cloud properties' do
msi_msi_aad_settings = MSIActiveDirectoryServiceSettings.get_azure_settings

expect(msi_msi_aad_settings).to be_a(ActiveDirectoryServiceSettings)
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.

should this expect "MSIActiveDirectoryServiceSettings"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Supposed to be tested for sub class instead of super.

@vishrutshah
Copy link
Copy Markdown
Contributor Author

vishrutshah commented Aug 14, 2017

  • CI is failing due to the release of azure-core version 0.1.10 with PR change 118ad48702550e. We are in discussion with the azure-storage team to fix this issue.

  • Regarding the end-to-end user scenario, I'll be writing the sample :)

Using latest bundler to resolve dependency
@vishrutshah
Copy link
Copy Markdown
Contributor Author

vishrutshah commented Aug 21, 2017

Waiting for release of azure-core version 0.1.11 from PR Azure/azure-ruby-asm-core#43

#Done

Gemfile Outdated
gem 'azure_mgmt_traffic_manager', path: 'management/azure_mgmt_traffic_manager'
gem 'azure_mgmt_web', path: 'management/azure_mgmt_web'
gem 'azure_sdk', path: 'azure_sdk'
gem 'azure-core', git: 'https://github.com/katmsft/azure-ruby-asm-core.git', branch: 'master'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Revert use of private fork after release of azure-core version 0.1.11

@vishrutshah
Copy link
Copy Markdown
Contributor Author

@veronicagg Feel free to re-review as you get a chance. Thanks!

Copy link
Copy Markdown
Contributor

@veronicagg veronicagg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!!

@vishrutshah
Copy link
Copy Markdown
Contributor Author

@veronicagg Thanks for the review!!

@sarangan12 Let me know if you have any feedback :)

@vishrutshah
Copy link
Copy Markdown
Contributor Author

Thanks everyone for the review!!

@vishrutshah vishrutshah changed the title [In Review] Introduce support for acquiring token from Managed Service Identity [ms_rest_azure] Introduce support for acquiring token from Managed Service Identity Aug 25, 2017
@vishrutshah vishrutshah merged commit ab9cdb6 into Azure:master Aug 25, 2017
@vishrutshah vishrutshah deleted the msi-support branch August 25, 2017 00:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants