Skip to content

Adding code to remove dependency with AzureKeyVaultServiceEndpointResourceId #2544

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

Merged
merged 1 commit into from
Jul 2, 2016
Merged

Conversation

jkapil
Copy link
Member

@jkapil jkapil commented Jul 1, 2016

Adding code to remove dependency with static value specified in AzureKeyVaultServiceEndpointResourceId of Get-AzureRmEnvironment. The keyvault resource Id is now obtained from server using 401 challenge. The Azure PowerShell common infrastructure currently do not support this in an intuitive fashion, so tweaking its usage by overriding the environment endpoint value before acquiring the token.

…KeyVaultServiceEndpointResourceId of Get-AzureRmEnvironment. The keyvault resource Id is now obtained from server using 401 challenge. The Azure PowerShell common infrastructure currently do not support this in an intuitive fashion, so tweaking its usage by overriding the environment endpoint value before acquiring the token.
@azurecla
Copy link

azurecla commented Jul 1, 2016

Hi @jkapil, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.azure.com.

TTYL, AZPRBOT;

@@ -74,14 +84,18 @@ public Task<string> OnAuthentication(string authority, string resource, string s
throw new ArgumentException(string.Format(KeyVaultProperties.Resources.UnsupportedAccountType, context.Account.Type));

if (context.Subscription != null && context.Account != null)
TenantId = context.Subscription.GetPropertyAsArray(AzureSubscription.Property.Tenants)
tenantId = context.Subscription.GetPropertyAsArray(AzureSubscription.Property.Tenants)
Copy link
Member

@markcowl markcowl Jul 1, 2016

Choose a reason for hiding this comment

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

Why not use context.tenant as the first option?

Copy link
Member Author

Choose a reason for hiding this comment

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

We might, didn't wanted to change logic for tenant ID

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes this will be integrated into release 1.2.4

@markcowl
Copy link
Member

markcowl commented Jul 1, 2016

@jkapil one minor comment. I would really like to see a mocked test for the scenario - can you mock this by mocking out the authentication factory?

@markcowl
Copy link
Member

markcowl commented Jul 1, 2016

@jkapil is this also intended for AzureStack TP2? If so, you'll need to open a PR against the release-1.2.4 branch

@hovsepm
Copy link
Contributor

hovsepm commented Jul 1, 2016

@markcowl markcowl merged commit 8ce4876 into Azure:dev Jul 2, 2016
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