Skip to content

[ADL] - Fixing AzureEnvironment to use DataLake audience #4923

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 3 commits into from
Nov 6, 2017

Conversation

ro-joowan
Copy link
Contributor

@ro-joowan ro-joowan commented Nov 3, 2017

  • Fixing some of the methods in AzureEnvironmentExtensions.cs that do not carry over the DataLakeAudience

    • TryGetEndpointString
    • CopyFrom
    • Update
  • Adding DataLakeAudience to some of the Profile tests

Description


This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.

General Guidelines

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.
  • The pull request does not introduce breaking changes (unless a major version change occurs in the assembly and module).

Testing Guidelines

  • Pull request includes test coverage for the included changes.
  • PowerShell scripts used in tests should do any necessary setup as part of the test or suite setup, and should not use hard-coded values for locations or existing resources.

Cmdlet Signature Guidelines

  • New cmdlets that make changes or have side effects should implement ShouldProcess and have SupportShouldProcess=true specified in the cmdlet attribute. You can find more information on ShouldProcess here.
  • Cmdlet specifies OutputType attribute if any output is produced - if the cmdlet produces no output, it should implement a PassThru parameter.

Cmdlet Parameter Guidelines

  • Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
  • Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
  • Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

@ro-joowan ro-joowan requested a review from markcowl November 3, 2017 21:13
@ro-joowan
Copy link
Contributor Author

ro-joowan commented Nov 4, 2017

Since I am not too familiar with the Profile code base, it would be reassuring if the reviewer paid extra attention to my changes. What I do know for sure is that this fix here is needed, but I do not know is if this fix is comprehensive. That is, making sure that the AzureEnvironment uses the default DataLakeAudience ("https://datalake.azure.net") for all of ADL data-plane cmdlets, if the user does not set the DataLakeAudience manually.

  • For example, in AddAzureRmEnvironment and SetAzureRmEnvironment, I see that @begoldsm set the DataLakeAudience in the else-block of the "this.ParameterSetName.Equals(MetadataParameterSet, StringComparison.Ordinal)" if-statement, and I think we can keep it that way.

  • Also, it would be helpful to know if AddAzureRmAccount always uses the default DataLakeAudience if the Environment parameter is not provided by the user. It seems to me that this is the case because the default environment is AzureCloud, which uses the default DataLakeAudience.

@ro-joowan ro-joowan requested a review from cormacpayne November 4, 2017 00:41
@markcowl markcowl changed the base branch from preview to release-5.0.0 November 6, 2017 16:22
@markcowl
Copy link
Member

markcowl commented Nov 6, 2017

@markcowl markcowl merged commit 32355b2 into Azure:release-5.0.0 Nov 6, 2017
@ro-joowan ro-joowan deleted the datalake-audience branch November 6, 2017 20:10
@begoldsm
Copy link
Contributor

begoldsm commented Nov 7, 2017

@ro-joowan this looks good to me! I am curious, was this a change in how AzurePS handles the environment strings, because I thought that I already set the audience strings when they were also updated for the SDK (or was that not the case?)

@ro-joowan
Copy link
Contributor Author

@begoldsm Thanks! (and it's good to hear from you 😃) Are you referring to this change? [AzureEnvironment.cs - Line 55]

The change here addresses cmdlets like Get-AzureRmEnvironment and Set-AzureRmContext, which rely on the PSAzureEnvironment(IAzureEnvironment environment) copy constructor. But the CopyFrom() method in that constructor does not carry over the DataLake audience.

@begoldsm
Copy link
Contributor

begoldsm commented Nov 10, 2017

Ah, that makes sense. Yes, I was referring to this PR: #4136 which added those initial changes. Good find! Don't mind me, just occasionally lurking in the Azure repo still 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants