Skip to content

Commit 007e7e4

Browse files
committed
Merge branch 'master' of https://github.com/Azure/azure-powershell into remove-nonCanonical-cmdlet-in-AzureRM.Example.psm1#9737
2 parents fc906b1 + 23b4589 commit 007e7e4

File tree

34 files changed

+8364
-151573
lines changed

34 files changed

+8364
-151573
lines changed

src/Advisor/Advisor/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- Additional information about change #1
2020
-->
2121
## Upcoming Release
22+
* Added new category "Operational Excellence" to Get-AzAdvisorRecommendation cmdlet.
2223

2324
## Version 1.0.1
2425
* Fixed miscellaneous typos across module

src/Advisor/Advisor/Cmdlets/GetAzAdvisorRecommendation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class GetAzAdvisorRecommendation : ResourceAdvisorBaseCmdlet
5252
/// </summary>
5353
[Parameter(ParameterSetName = "IdParameterSet", Mandatory = false, HelpMessage = "Category of the recommendation")]
5454
[Parameter(ParameterSetName = "NameParameterSet", Mandatory = false, HelpMessage = "Category of the recommendation")]
55-
[ValidateSet("Cost", "HighAvailability", "Performance", "Security")]
55+
[ValidateSet("Cost", "HighAvailability", "OperationalExcellence", "Performance", "Security")]
5656
public string Category { get; set; }
5757

5858
/// <summary>
@@ -96,4 +96,4 @@ public override void ExecuteCmdlet()
9696
this.WriteObject(results, true);
9797
}
9898
}
99-
}
99+
}

src/Advisor/Advisor/Cmdlets/Utilities/RecommendationHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public static List<PsAzureAdvisorResourceRecommendationBase> RecommendationFilte
5151

5252
List<PsAzureAdvisorResourceRecommendationBase> filteredList = new List<PsAzureAdvisorResourceRecommendationBase>();
5353

54-
// Filter by category only if its a valid input
55-
if (Category.Cost.Equals(category) || Category.HighAvailability.Equals(category) || Category.Performance.Equals(category) || Category.Security.Equals(category))
54+
// Filter by category
55+
if (!string.IsNullOrEmpty(category))
5656
{
5757
// If resourceGroup filtering is as well specified
5858
if (!string.IsNullOrEmpty(resourceGroup))

src/Advisor/Advisor/help/Get-AzAdvisorRecommendation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Category of the recommendation
8080
Type: String
8181
Parameter Sets: (All)
8282
Aliases:
83-
Accepted values: Cost, HighAvailability, Performance, Security
83+
Accepted values: Cost, HighAvailability, Performance, Security, OperationalExcellence
8484

8585
Required: False
8686
Position: Named

src/DataFactory/DataFactoryV2/help/Az.DataFactory.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Locale: en-US
1111
Azure Data Factory V2 is the data integration platform that goes beyond Azure Data Factory V1's orchestration and batch-processing of time-series log data, with a general purpose app model supporting modern data warehousing patterns and scenarios, lift-and-shift SSIS, and data-driven SaaS applications. Compose and manage reliable and secure data integration workflows at scale. Use native ADF data connectors and Integration Runtimes to move and transform cloud and on-premises data that can be unstructured, semi-structured, and structured with Hadoop, Azure Data Lake, Spark, SQL Server, Cosmos DB and many other data platforms.
1212

1313
## Az.DataFactory Cmdlets
14+
### [Add-AzDataFactoryV2DataFlowDebugSessionPackage](Add-AzDataFactoryV2DataFlowDebugSessionPackage.md)
15+
Add data flow resource and its dependencies into specific data flow debug session.
16+
1417
### [Get-AzDataFactory](Get-AzDataFactory.md)
1518
Gets information about Data Factories.
1619

@@ -50,6 +53,12 @@ Gets information about activity runs for a pipeline run.
5053
### [Get-AzDataFactoryV2Dataset](Get-AzDataFactoryV2Dataset.md)
5154
Gets information about datasets in Data Factory.
5255

56+
### [Get-AzDataFactoryV2DataFlow](Get-AzDataFactoryV2DataFlow.md)
57+
Gets information about data flows in Data Factory.
58+
59+
### [Get-AzDataFactoryV2DataFlowDebugSession](Get-AzDataFactoryV2DataFlowDebugSession.md)
60+
Get all active data flow debug sessions by Azure Data Factory.
61+
5362
### [Get-AzDataFactoryV2IntegrationRuntime](Get-AzDataFactoryV2IntegrationRuntime.md)
5463
Gets information about integration runtime resources.
5564

@@ -80,8 +89,11 @@ Returns information about trigger runs.
8089
### [Invoke-AzDataFactoryV2IntegrationRuntimeUpgrade](Invoke-AzDataFactoryV2IntegrationRuntimeUpgrade.md)
8190
Upgrades self-hosted integration runtime.
8291

92+
### [Invoke-AzDataFactoryV2DataFlowDebugSessionCommand](Invoke-AzDataFactoryV2DataFlowDebugSessionCommand.md)
93+
Invoke debug action in data flow debug session.
94+
8395
### [Invoke-AzDataFactoryV2Pipeline](Invoke-AzDataFactoryV2Pipeline.md)
84-
Invokes a pipeline to start a run for it.
96+
Invokes a pipeline to start a run for it.
8597

8698
### [New-AzDataFactory](New-AzDataFactory.md)
8799
Creates a data factory.
@@ -137,6 +149,9 @@ Removes a data factory.
137149
### [Remove-AzDataFactoryV2Dataset](Remove-AzDataFactoryV2Dataset.md)
138150
Removes a dataset from Data Factory.
139151

152+
### [Remove-AzDataFactoryV2DataFlow](Remove-AzDataFactoryV2DataFlow.md)
153+
Removes a data flow from Data Factory.
154+
140155
### [Remove-AzDataFactoryV2IntegrationRuntime](Remove-AzDataFactoryV2IntegrationRuntime.md)
141156
Removes an integration runtime.
142157

@@ -173,6 +188,9 @@ Creates a data factory.
173188
### [Set-AzDataFactoryV2Dataset](Set-AzDataFactoryV2Dataset.md)
174189
Creates a dataset in Data Factory.
175190

191+
### [Set-AzDataFactoryV2DataFlow](Set-AzDataFactoryV2DataFlow.md)
192+
Creates a data flow in Data Factory.
193+
176194
### [Set-AzDataFactoryV2IntegrationRuntime](Set-AzDataFactoryV2IntegrationRuntime.md)
177195
Updates an integration runtime.
178196

@@ -191,6 +209,9 @@ Starts a managed dedicated integration runtime.
191209
### [Start-AzDataFactoryV2Trigger](Start-AzDataFactoryV2Trigger.md)
192210
Starts a trigger in a data factory.
193211

212+
### [Start-AzDataFactoryV2DataFlowDebugSession](Start-AzDataFactoryV2DataFlowDebugSession.md)
213+
Starts a data flow debug session in Azure Data Factory.
214+
194215
### [Stop-AzDataFactoryV2IntegrationRuntime](Stop-AzDataFactoryV2IntegrationRuntime.md)
195216
Stops a managed dedicated integration runtime.
196217

@@ -200,6 +221,9 @@ Stops a pipeline run in a data factory.
200221
### [Stop-AzDataFactoryV2Trigger](Stop-AzDataFactoryV2Trigger.md)
201222
Stops a trigger in a data factory.
202223

224+
### [Stop-AzDataFactoryV2DataFlowDebugSession](Stop-AzDataFactoryV2DataFlowDebugSession.md)
225+
Stops a data flow debug session in Azure Data Factory.
226+
203227
### [Suspend-AzDataFactoryPipeline](Suspend-AzDataFactoryPipeline.md)
204228
Suspends a pipeline in Azure Data Factory.
205229

src/HDInsight/HDInsight.Test/DataLakeStoreDefaultFilesystemTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class DataLakeStoreDefaultFilesystemTests : HDInsightTestBase
3232
private const string StorageName = "dummystorage.azuredatalakestore.net";
3333
private const int ClusterSize = 4;
3434
private Guid ObjectId = new Guid("11111111-1111-1111-1111-111111111111");
35+
private Guid ApplicationId = new Guid("11111111-1111-1111-1111-111111111111");
3536
private Guid AadTenantId = new Guid("11111111-1111-1111-1111-111111111111");
3637
private string Certificate = "";
3738
private string CertificatePassword = "";
@@ -61,6 +62,7 @@ public void CanCreateClusterConfigWithDataLakeStoreParameters()
6162
CommandRuntime = commandRuntimeMock.Object,
6263
HDInsightManagementClient = hdinsightManagementMock.Object,
6364
ObjectId = ObjectId,
65+
ApplicationId = ApplicationId,
6466
CertificateFilePath = Certificate,
6567
AadTenantId = AadTenantId,
6668
CertificatePassword = CertificatePassword,
@@ -76,6 +78,7 @@ public void CanCreateClusterConfigWithDataLakeStoreParameters()
7678
c.AADTenantId == AadTenantId &&
7779
c.CertificatePassword == CertificatePassword &&
7880
c.ObjectId == ObjectId &&
81+
c.ApplicationId == ApplicationId &&
7982
c.CertificateFilePath == Certificate &&
8083
c.DefaultStorageAccountName == StorageName
8184
)),
@@ -91,6 +94,7 @@ public void CanCreateDataLakeClusterWithCertificateFileContents()
9194
CommandRuntime = commandRuntimeMock.Object,
9295
HDInsightManagementClient = hdinsightManagementMock.Object,
9396
ObjectId = ObjectId,
97+
ApplicationId = ApplicationId,
9498
CertificateFileContents = CertificateFileContents,
9599
AadTenantId = AadTenantId,
96100
CertificatePassword = CertificatePassword,
@@ -106,6 +110,7 @@ public void CanCreateDataLakeClusterWithCertificateFileContents()
106110
c.AADTenantId == AadTenantId &&
107111
c.CertificatePassword == CertificatePassword &&
108112
c.ObjectId == ObjectId &&
113+
c.ApplicationId == ApplicationId &&
109114
c.CertificateFileContents == CertificateFileContents &&
110115
c.DefaultStorageAccountName == StorageName
111116
)),
@@ -121,6 +126,7 @@ public void ShouldThrowIfCertificateOptionsAreNotPassed()
121126
CommandRuntime = commandRuntimeMock.Object,
122127
HDInsightManagementClient = hdinsightManagementMock.Object,
123128
ObjectId = ObjectId,
129+
ApplicationId = ApplicationId,
124130
AadTenantId = AadTenantId,
125131
CertificatePassword = CertificatePassword
126132
};
@@ -137,6 +143,7 @@ public void ShouldThrowIfBothCertificateOptionsArePassed()
137143
CommandRuntime = commandRuntimeMock.Object,
138144
HDInsightManagementClient = hdinsightManagementMock.Object,
139145
ObjectId = ObjectId,
146+
ApplicationId = ApplicationId,
140147
AadTenantId = AadTenantId,
141148
CertificatePassword = CertificatePassword,
142149
CertificateFileContents = CertificateFileContents,

src/HDInsight/HDInsight.Test/UnitTests/DataLakeStoreTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class DataLakeStoreTests : HDInsightTestBase
3030
{
3131
private NewAzureHDInsightClusterCommand cmdlet;
3232
private Guid ObjectId = new Guid("11111111-1111-1111-1111-111111111111");
33+
private Guid ApplicationId = new Guid("11111111-1111-1111-1111-111111111111");
3334
private Guid AadTenantId = new Guid("11111111-1111-1111-1111-111111111111");
3435
private string Certificate = "";
3536
private string CertificatePassword = "";
@@ -59,6 +60,7 @@ public void CanCreateClusterConfigWithDataLakeStoreParameters()
5960
CommandRuntime = commandRuntimeMock.Object,
6061
HDInsightManagementClient = hdinsightManagementMock.Object,
6162
ObjectId = ObjectId,
63+
ApplicationId = ApplicationId,
6264
CertificateFilePath = Certificate,
6365
AadTenantId = AadTenantId,
6466
CertificatePassword = CertificatePassword
@@ -73,6 +75,7 @@ public void CanCreateClusterConfigWithDataLakeStoreParameters()
7375
c.AADTenantId == AadTenantId &&
7476
c.CertificatePassword == CertificatePassword &&
7577
c.ObjectId == ObjectId &&
78+
c.ApplicationId == ApplicationId &&
7679
c.CertificateFilePath == Certificate
7780
)),
7881
Times.Once);
@@ -87,6 +90,7 @@ public void CanCreateDataLakeClusterWithCertificationFileContents()
8790
CommandRuntime = commandRuntimeMock.Object,
8891
HDInsightManagementClient = hdinsightManagementMock.Object,
8992
ObjectId = ObjectId,
93+
ApplicationId = ApplicationId,
9094
CertificateFileContents = CertificateFileContents,
9195
AadTenantId = AadTenantId,
9296
CertificatePassword = CertificatePassword
@@ -101,6 +105,7 @@ public void CanCreateDataLakeClusterWithCertificationFileContents()
101105
c.AADTenantId == AadTenantId &&
102106
c.CertificatePassword == CertificatePassword &&
103107
c.ObjectId == ObjectId &&
108+
c.ApplicationId == ApplicationId &&
104109
c.CertificateFileContents == CertificateFileContents
105110
)),
106111
Times.Once);
@@ -115,6 +120,7 @@ public void ShouldThrowIfCertificateOptionsAreNotPassed()
115120
CommandRuntime = commandRuntimeMock.Object,
116121
HDInsightManagementClient = hdinsightManagementMock.Object,
117122
ObjectId = ObjectId,
123+
ApplicationId = ApplicationId,
118124
AadTenantId = AadTenantId,
119125
CertificatePassword = CertificatePassword
120126
};
@@ -131,6 +137,7 @@ public void ShouldThrowIfBothCertificateOptionsArePassed()
131137
CommandRuntime = commandRuntimeMock.Object,
132138
HDInsightManagementClient = hdinsightManagementMock.Object,
133139
ObjectId = ObjectId,
140+
ApplicationId = ApplicationId,
134141
AadTenantId = AadTenantId,
135142
CertificatePassword = CertificatePassword,
136143
CertificateFileContents = CertificateFileContents,

src/HDInsight/HDInsight/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Fixed the bug that customer will get "Not a valid Base-64 string" error when using Get-AzHDInsightCluster to get the cluster with ADLSGen1 storage.
22+
* Add a parameter named "ApplicationId" to three cmdlets Add-AzHDInsightClusterIdentity, New-AzHDInsightClusterConfig and New-AzHDInsightCluster so that customer can provide the service principal application id for accessing Azure Data Lake.
2123

2224
## Version 2.0.2
2325
* Call out breaking changes

src/HDInsight/HDInsight/ClusterConfigurationUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static AzureHDInsightDefaultStorageAccount GetDefaultStorageAccountDetail
7474
storageRootPath: storageRootPath,
7575
applicationId: appId,
7676
tenantId: tenantId,
77-
certificateContents: Convert.FromBase64String(certContents ?? ""),
77+
certificateContents: null,
7878
certificatePassword: certPassword,
7979
resourceUri: resourceUri
8080
);

src/HDInsight/HDInsight/ManagementCommands/AddAzureHDInsightClusterIdentity.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ public class AddAzureHDInsightClusterIdentity : HDInsightCmdletBase
6161
HelpMessage = "The Service Principal AAD Tenant Id for accessing Azure Data Lake.")]
6262
public Guid AadTenantId { get; set; }
6363

64+
[Parameter(Position = 5,
65+
Mandatory = false,
66+
HelpMessage = "The Service Principal Application Id for accessing Azure Data Lake.")]
67+
public Guid ApplicationId { get; set; }
68+
6469
#endregion
6570

6671
public override void ExecuteCmdlet()
@@ -82,6 +87,7 @@ public override void ExecuteCmdlet()
8287
}
8388

8489
Config.ObjectId = ObjectId;
90+
Config.ApplicationId = ApplicationId;
8591
Config.AADTenantId = AadTenantId;
8692
Config.CertificatePassword = CertificatePassword;
8793

src/HDInsight/HDInsight/ManagementCommands/NewAzureHDInsightClusterCommand.cs

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public AzureHDInsightConfig Config
130130
HiveMetastore = HiveMetastore,
131131
OozieMetastore = OozieMetastore,
132132
ObjectId = ObjectId,
133+
ApplicationId = ApplicationId,
133134
AADTenantId = AadTenantId,
134135
CertificateFileContents = CertificateFileContents,
135136
CertificateFilePath = CertificateFilePath,
@@ -185,6 +186,7 @@ var storageAccount in
185186
CertificateFilePath = value.CertificateFilePath;
186187
AadTenantId = value.AADTenantId;
187188
ObjectId = value.ObjectId;
189+
ApplicationId = value.ApplicationId;
188190
CertificatePassword = value.CertificatePassword;
189191
SecurityProfile = value.SecurityProfile;
190192
DisksPerWorkerNode = value.DisksPerWorkerNode;
@@ -332,6 +334,9 @@ public DateTime RdpAccessExpiry
332334
[Parameter(HelpMessage = "Gets or sets the Service Principal Object Id for accessing Azure Data Lake.")]
333335
public Guid ObjectId { get; set; }
334336

337+
[Parameter(HelpMessage = "Gets or sets the Service Principal Application Id for accessing Azure Data Lake.")]
338+
public Guid ApplicationId { get; set; }
339+
335340
[Parameter(HelpMessage = "Gets or sets the Service Principal Certificate file path for accessing Azure Data Lake.",
336341
ParameterSetName = CertificateFilePathSet)]
337342
public string CertificateFilePath { get; set; }
@@ -434,7 +439,7 @@ var storageAccount in
434439
CertificateFileContents = File.ReadAllBytes(CertificateFilePath);
435440
}
436441
var servicePrincipal = new Management.HDInsight.Models.ServicePrincipal(
437-
GetApplicationId(), GetTenantId(AadTenantId), CertificateFileContents,
442+
GetApplicationId(ApplicationId), GetTenantId(AadTenantId), CertificateFileContents,
438443
CertificatePassword);
439444

440445
parameters.Principal = servicePrincipal;
@@ -504,20 +509,34 @@ private Guid GetTenantId(Guid tenantId)
504509
return new Guid(tenantIdStr);
505510
}
506511

507-
//Get ApplicationId for the given ObjectId.
508-
private Guid GetApplicationId()
512+
//Get ApplicationId of Service Principal if user doesn't provide this parameter
513+
private Guid GetApplicationId(Guid applicationId)
509514
{
515+
if (applicationId != Guid.Empty)
516+
{
517+
return applicationId;
518+
}
519+
510520
GraphRbacManagementClient graphClient = AzureSession.Instance.ClientFactory.CreateArmClient<GraphRbacManagementClient>(
511521
DefaultProfile.DefaultContext, AzureEnvironment.Endpoint.Graph);
512522

513523
graphClient.TenantID = DefaultProfile.DefaultContext.Tenant.Id.ToString();
514524

515-
Microsoft.Azure.Graph.RBAC.Version1_6.Models.ServicePrincipal sp = graphClient.ServicePrincipals.Get(ObjectId.ToString());
525+
Microsoft.Azure.Graph.RBAC.Version1_6.Models.ServicePrincipal sp=null;
526+
try
527+
{
528+
sp = graphClient.ServicePrincipals.Get(ObjectId.ToString());
529+
}
530+
catch(Microsoft.Azure.Graph.RBAC.Version1_6.Models.GraphErrorException e)
531+
{
532+
string errorMessage = e.Message + ". Please specify Application Id explicitly by providing ApplicationId parameter and retry.";
533+
throw new Microsoft.Azure.Graph.RBAC.Version1_6.Models.GraphErrorException(errorMessage);
534+
}
516535

517-
var applicationId = Guid.Empty;
518-
Guid.TryParse(sp.AppId, out applicationId);
519-
Debug.Assert(applicationId != Guid.Empty);
520-
return applicationId;
536+
var spApplicationId = Guid.Empty;
537+
Guid.TryParse(sp.AppId, out spApplicationId);
538+
Debug.Assert(spApplicationId != Guid.Empty);
539+
return spApplicationId;
521540
}
522541
}
523542
}

src/HDInsight/HDInsight/ManagementCommands/NewAzureHDInsightClusterConfigCommand.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ public Guid ObjectId
113113
set { _config.ObjectId = value; }
114114
}
115115

116+
[Parameter(HelpMessage = "Gets or sets the Service Principal Application Id for accessing Azure Data Lake.")]
117+
public Guid ApplicationId
118+
{
119+
get { return _config.ApplicationId; }
120+
set { _config.ApplicationId = value; }
121+
}
122+
116123
[Parameter(HelpMessage = "Gets or sets the Service Principal Certificate file contents for accessing Azure Data Lake.")]
117124
public byte[] CertificateFileContents
118125
{

src/HDInsight/HDInsight/Models/Management/AzureHDInsightConfig.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ public class AzureHDInsightConfig
9292
/// </summary>
9393
public Guid ObjectId { get; set; }
9494

95+
/// <summary>
96+
/// Gets Application id of the service principal.
97+
/// </summary>
98+
public Guid ApplicationId { get; set; }
99+
95100
/// <summary>
96101
/// Gets the file path of the client certificate file contents associated with the service principal.
97102
/// </summary>

0 commit comments

Comments
 (0)