Skip to content

{HDInsight} Support creating cluster with ADLSGen1/2 storage in national clouds#12310

Merged
VeryEarly merged 3 commits intoAzure:masterfrom
aim-for-better:FixCreateClusterWithADLSIssueInNationCloud
Jul 6, 2020
Merged

{HDInsight} Support creating cluster with ADLSGen1/2 storage in national clouds#12310
VeryEarly merged 3 commits intoAzure:masterfrom
aim-for-better:FixCreateClusterWithADLSIssueInNationCloud

Conversation

@aim-for-better
Copy link
Copy Markdown
Member

@aim-for-better aim-for-better commented Jul 2, 2020

Description

Support creating cluster with ADLSGen1/2 storage in national clouds

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
    • the markdown help files have been regenerated using the commands listed here

idear1203
idear1203 previously approved these changes Jul 2, 2020
Copy link
Copy Markdown
Contributor

@idear1203 idear1203 left a comment

Choose a reason for hiding this comment

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

LGTM

HdInsightManagementClient.VirtualMachines.RestartHosts(resourceGroupName, clusterName, hosts);
}

private void ResetClusterIdentity(ClusterCreateParametersExtended createParams, string cloudAadAuthority, string cloudDataLakeAudience)
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.

Nit - I would drop the word cloud. E.g cloudAadAuthority -> aadAuthority

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nit - I would drop the word cloud. E.g cloudAadAuthority -> aadAuthority

Changed.


string aadTenantIdWithUrl;
clusterIdentity.TryGetValue("clusterIdentity.aadTenantId", out aadTenantIdWithUrl);
string newAadTenantIdWithUrl = aadTenantIdWithUrl?.Replace("https://login.windows.net/", cloudAadAuthority);
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.

Nit - nice to extract a constant for "https://login.windows.net/"

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.

I agree with Dongwei.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nit - nice to extract a constant for "https://login.windows.net/"

Fixed.

{
return;
}
clusterIdentity.SetProperty("clusterIdentity.resourceUri", cloudDataLakeAudience);
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.

Nit - you can just say clusterIdentity["clusterIdentity.resourceUri"] = cloudDataLakeAudience; for simplicity. BTW, what if clusterIdentity["clusterIdentity.resourceUri"] is not set originally?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nit - you can just say clusterIdentity["clusterIdentity.resourceUri"] = cloudDataLakeAudience; for simplicity. BTW, what if clusterIdentity["clusterIdentity.resourceUri"] is not set originally?

Fixed. If it is not set originally, then our code will add the key/value pair, I think it is ok.

{
return;
}
clusterIdentity.SetProperty("clusterIdentity.resourceUri", cloudDataLakeAudience);
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.

Just throw a question out of curiosity. Is there such a scenario that clusterIdentity is not null but cloudAadAuthority /cloudDataLakeAudience is null? I am not familiar with clusterIdentity, so if my question is wrong, please correct it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just throw a question out of curiosity. Is there such a scenario that clusterIdentity is not null but cloudAadAuthority /cloudDataLakeAudience is null? I am not familiar with clusterIdentity, so if my question is wrong, please correct it.

Yes, cloudDataLakeAudience may be null. A dictionary can accept a null as value. From the code side, it is ok.

@VeryEarly VeryEarly self-assigned this Jul 3, 2020
@VeryEarly VeryEarly merged commit 81b6b3f into Azure:master Jul 6, 2020
litchiyangMSFT pushed a commit to litchiyangMSFT/azure-powershell that referenced this pull request Aug 4, 2020
…nal clouds (Azure#12310)

* Support creating cluster with Adlsgen1/2 storage in national clouds

* Update ChangeLog.md

* Refactor the ResetClusterIdentity function

Co-authored-by: Zhenyu Zhou <zhezhou@microsoft.com>
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