Skip to content

Commit 183c44b

Browse files
idear1203Dongwei Wang
andauthored
[Synapse] - updated the New/Set-AzEnvironment for Synapse endpoint (Azure#11632)
* [Synapse] - updated the New/Set-AzEnvironment for Synapse endpoint * Update changelog Co-authored-by: Dongwei Wang <[email protected]>
1 parent 0851435 commit 183c44b

File tree

8 files changed

+162
-9
lines changed

8 files changed

+162
-9
lines changed

src/Accounts/Accounts.Test/EnvironmentCmdletTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ public void CanCreateEnvironmentWithAllProperties()
382382
AzureOperationalInsightsEndpoint = "https://AzureOperationalInsights",
383383
AzureAttestationServiceEndpointResourceId = "AzureAttestationServiceEndpointResourceId",
384384
AzureAttestationServiceEndpointSuffix = "https://AzureAttestationService",
385+
AzureSynapseAnalyticsEndpointResourceId = "AzureSynapseAnalyticsEndpointResourceId",
386+
AzureSynapseAnalyticsEndpointSuffix = "https://AzureSynapseAnalytics",
385387
};
386388

387389
var dict = new Dictionary<string, object>();
@@ -407,6 +409,8 @@ public void CanCreateEnvironmentWithAllProperties()
407409
dict["AzureOperationalInsightsEndpoint"] = "https://AzureOperationalInsights";
408410
dict["AzureAttestationServiceEndpointResourceId"] = "AzureAttestationServiceEndpointResourceId";
409411
dict["AzureAttestationServiceEndpointSuffix"] = "https://AzureAttestationService";
412+
dict["AzureSynapseAnalyticsEndpointResourceId"] = "AzureSynapseAnalyticsEndpointResourceId";
413+
dict["AzureSynapseAnalyticsEndpointSuffix"] = "https://AzureSynapseAnalytics";
410414
cmdlet.SetBoundParameters(dict);
411415

412416
cmdlet.InvokeBeginProcessing();
@@ -436,6 +440,8 @@ public void CanCreateEnvironmentWithAllProperties()
436440
Assert.Equal(cmdlet.AzureOperationalInsightsEndpoint, actual.AzureOperationalInsightsEndpoint);
437441
Assert.Equal(cmdlet.AzureAttestationServiceEndpointResourceId, actual.AzureAttestationServiceEndpointResourceId);
438442
Assert.Equal(cmdlet.AzureAttestationServiceEndpointSuffix, actual.AzureAttestationServiceEndpointSuffix);
443+
Assert.Equal(cmdlet.AzureSynapseAnalyticsEndpointResourceId, actual.AzureSynapseAnalyticsEndpointResourceId);
444+
Assert.Equal(cmdlet.AzureSynapseAnalyticsEndpointSuffix, actual.AzureSynapseAnalyticsEndpointSuffix);
439445
commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny<PSAzureEnvironment>()), Times.Once());
440446
IAzureEnvironment env = AzureRmProfileProvider.Instance.Profile.GetEnvironment("KaTaL");
441447
Assert.Equal(env.Name, cmdlet.Name);

src/Accounts/Accounts/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020
## Upcoming Release
2121
* Removed alias of `Resolve-AzError`
22+
* Updated Add-AzEnvironment and Set-AzEnvironment to accept parameters AzureSynapseAnalyticsEndpointResourceId and AzureSynapseAnalyticsEndpointSuffix
2223

2324
## Version 1.7.5
2425
* Updated Azure PowerShell survey URL in `Resolve-AzError` [#11507]

src/Accounts/Accounts/Environment/AddAzureRMEnvironment.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ public string DataLakeAudience
175175
HelpMessage = "The resource identifier of the Azure Attestation service that is the recipient of the requested token.")]
176176
public string AzureAttestationServiceEndpointResourceId { get; set; }
177177

178+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
179+
HelpMessage = "Dns suffix of Azure Synapse Analytics.")]
180+
public string AzureSynapseAnalyticsEndpointSuffix { get; set; }
181+
182+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
183+
HelpMessage = "The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token.")]
184+
public string AzureSynapseAnalyticsEndpointResourceId { get; set; }
178185

179186
protected override void BeginProcessing()
180187
{
@@ -329,6 +336,10 @@ public override void ExecuteCmdlet()
329336
nameof(AzureAttestationServiceEndpointSuffix));
330337
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureAttestationServiceEndpointResourceId,
331338
nameof(AzureAttestationServiceEndpointResourceId));
339+
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointSuffix,
340+
nameof(AzureSynapseAnalyticsEndpointSuffix));
341+
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointResourceId,
342+
nameof(AzureSynapseAnalyticsEndpointResourceId));
332343
WriteObject(new PSAzureEnvironment(profileClient.AddOrSetEnvironment(newEnvironment)));
333344
}
334345
});

src/Accounts/Accounts/Environment/SetAzureRMEnvironment.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ public string DataLakeAudience
176176
HelpMessage = "The resource identifier of the Azure Attestation service that is the recipient of the requested token.")]
177177
public string AzureAttestationServiceEndpointResourceId { get; set; }
178178

179+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
180+
HelpMessage = "Dns suffix of Azure Synapse Analytics.")]
181+
public string AzureSynapseAnalyticsEndpointSuffix { get; set; }
182+
183+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
184+
HelpMessage = "The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token.")]
185+
public string AzureSynapseAnalyticsEndpointResourceId { get; set; }
186+
179187
protected override void BeginProcessing()
180188
{
181189
// do not call begin processing there is no context needed for this cmdlet
@@ -329,6 +337,10 @@ public override void ExecuteCmdlet()
329337
nameof(AzureAttestationServiceEndpointSuffix));
330338
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureAttestationServiceEndpointResourceId,
331339
nameof(AzureAttestationServiceEndpointResourceId));
340+
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointSuffix,
341+
nameof(AzureSynapseAnalyticsEndpointSuffix));
342+
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointResourceId,
343+
nameof(AzureSynapseAnalyticsEndpointResourceId));
332344
WriteObject(new PSAzureEnvironment(profileClient.AddOrSetEnvironment(newEnvironment)));
333345
}
334346
});

src/Accounts/Accounts/help/Add-AzEnvironment.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Add-AzEnvironment [-Name] <String> [[-PublishSettingsFileUrl] <String>] [[-Servi
2626
[[-BatchEndpointResourceId] <String>] [[-AzureOperationalInsightsEndpointResourceId] <String>]
2727
[[-AzureOperationalInsightsEndpoint] <String>] [-AzureAnalysisServicesEndpointSuffix <String>]
2828
[-AzureAnalysisServicesEndpointResourceId <String>] [-AzureAttestationServiceEndpointSuffix <String>]
29-
[-AzureAttestationServiceEndpointResourceId <String>] [-Scope <ContextModificationScope>]
29+
[-AzureAttestationServiceEndpointResourceId <String>] [-AzureSynapseAnalyticsEndpointSuffix <String>]
30+
[-AzureSynapseAnalyticsEndpointResourceId <String>] [-Scope <ContextModificationScope>]
3031
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
3132
```
3233

@@ -38,6 +39,7 @@ Add-AzEnvironment [-Name] <String> [[-StorageEndpoint] <String>] [-ARMEndpoint]
3839
[[-AzureOperationalInsightsEndpointResourceId] <String>] [[-AzureOperationalInsightsEndpoint] <String>]
3940
[-AzureAnalysisServicesEndpointSuffix <String>] [-AzureAnalysisServicesEndpointResourceId <String>]
4041
[-AzureAttestationServiceEndpointSuffix <String>] [-AzureAttestationServiceEndpointResourceId <String>]
42+
[-AzureSynapseAnalyticsEndpointSuffix <String>] [-AzureSynapseAnalyticsEndpointResourceId <String>]
4143
[-Scope <ContextModificationScope>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
4244
[<CommonParameters>]
4345
```
@@ -91,6 +93,8 @@ AzureOperationalInsightsEndpoint :
9193
AzureAnalysisServicesEndpointSuffix :
9294
AzureAttestationServiceEndpointSuffix :
9395
AzureAttestationServiceEndpointResourceId :
96+
AzureSynapseAnalyticsEndpointSuffix :
97+
AzureSynapseAnalyticsEndpointResourceId :
9498
VersionProfiles : {}
9599
ExtendedProperties : {}
96100
BatchEndpointResourceId :
@@ -310,6 +314,36 @@ Accept pipeline input: True (ByPropertyName)
310314
Accept wildcard characters: False
311315
```
312316
317+
### -AzureSynapseAnalyticsEndpointResourceId
318+
The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token.
319+
320+
```yaml
321+
Type: System.String
322+
Parameter Sets: (All)
323+
Aliases:
324+
325+
Required: False
326+
Position: Named
327+
Default value: None
328+
Accept pipeline input: False
329+
Accept wildcard characters: False
330+
```
331+
332+
### -AzureSynapseAnalyticsEndpointSuffix
333+
Dns suffix of Azure Synapse Analytics.
334+
335+
```yaml
336+
Type: System.String
337+
Parameter Sets: (All)
338+
Aliases:
339+
340+
Required: False
341+
Position: Named
342+
Default value: None
343+
Accept pipeline input: False
344+
Accept wildcard characters: False
345+
```
346+
313347
### -BatchEndpointResourceId
314348
The resource identifier of the Azure Batch service that is the recipient of the requested token
315349

src/Accounts/Accounts/help/Set-AzEnvironment.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Set-AzEnvironment [-Name] <String> [[-PublishSettingsFileUrl] <String>] [[-Servi
2626
[[-BatchEndpointResourceId] <String>] [[-AzureOperationalInsightsEndpointResourceId] <String>]
2727
[[-AzureOperationalInsightsEndpoint] <String>] [-AzureAnalysisServicesEndpointSuffix <String>]
2828
[-AzureAnalysisServicesEndpointResourceId <String>] [-AzureAttestationServiceEndpointSuffix <String>]
29-
[-AzureAttestationServiceEndpointResourceId <String>] [-Scope <ContextModificationScope>]
29+
[-AzureAttestationServiceEndpointResourceId <String>] [-AzureSynapseAnalyticsEndpointSuffix <String>]
30+
[-AzureSynapseAnalyticsEndpointResourceId <String>] [-Scope <ContextModificationScope>]
3031
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
3132
```
3233

@@ -38,6 +39,7 @@ Set-AzEnvironment [-Name] <String> [[-StorageEndpoint] <String>] [-ARMEndpoint]
3839
[[-AzureOperationalInsightsEndpointResourceId] <String>] [[-AzureOperationalInsightsEndpoint] <String>]
3940
[-AzureAnalysisServicesEndpointSuffix <String>] [-AzureAnalysisServicesEndpointResourceId <String>]
4041
[-AzureAttestationServiceEndpointSuffix <String>] [-AzureAttestationServiceEndpointResourceId <String>]
42+
[-AzureSynapseAnalyticsEndpointSuffix <String>] [-AzureSynapseAnalyticsEndpointResourceId <String>]
4143
[-Scope <ContextModificationScope>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
4244
[<CommonParameters>]
4345
```
@@ -88,6 +90,8 @@ AzureOperationalInsightsEndpoint :
8890
AzureOperationalInsightsEndpointResourceId :
8991
AzureAttestationServiceEndpointSuffix :
9092
AzureAttestationServiceEndpointResourceId :
93+
AzureSynapseAnalyticsEndpointSuffix :
94+
AzureSynapseAnalyticsEndpointResourceId :
9195
```
9296

9397
In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment.
@@ -303,6 +307,36 @@ Accept pipeline input: True (ByPropertyName)
303307
Accept wildcard characters: False
304308
```
305309
310+
### -AzureSynapseAnalyticsEndpointResourceId
311+
The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token.
312+
313+
```yaml
314+
Type: System.String
315+
Parameter Sets: (All)
316+
Aliases:
317+
318+
Required: False
319+
Position: Named
320+
Default value: None
321+
Accept pipeline input: False
322+
Accept wildcard characters: False
323+
```
324+
325+
### -AzureSynapseAnalyticsEndpointSuffix
326+
Dns suffix of Azure Synapse Analytics.
327+
328+
```yaml
329+
Type: System.String
330+
Parameter Sets: (All)
331+
Aliases:
332+
333+
Required: False
334+
Position: Named
335+
Default value: None
336+
Accept pipeline input: False
337+
Accept wildcard characters: False
338+
```
339+
306340
### -BatchEndpointResourceId
307341
The resource identifier of the Azure Batch service that is the recipient of the requested token
308342

src/Accounts/Authentication.ResourceManager/Models/PSAzureEnvironment.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ public PSAzureEnvironment(PSObject other)
114114
AzureAttestationServiceEndpointResourceId =
115115
other.GetProperty<string>(nameof(AzureAttestationServiceEndpointResourceId));
116116
AzureAttestationServiceEndpointSuffix = other.GetProperty<string>(nameof(AzureAttestationServiceEndpointSuffix));
117+
AzureSynapseAnalyticsEndpointResourceId =
118+
other.GetProperty<string>(nameof(AzureSynapseAnalyticsEndpointResourceId));
119+
AzureSynapseAnalyticsEndpointSuffix = other.GetProperty<string>(nameof(AzureSynapseAnalyticsEndpointSuffix));
117120
VersionProfiles.Populate(nameof(VersionProfiles), other);
118121
this.PopulateExtensions(other);
119122
}
@@ -324,6 +327,36 @@ public string AzureAttestationServiceEndpointResourceId
324327
}
325328
}
326329

330+
/// <summary>
331+
/// The domain name suffix for Azure Synapse Analyticss
332+
/// </summary>
333+
public string AzureSynapseAnalyticsEndpointSuffix
334+
{
335+
get
336+
{
337+
return this.GetEndpoint(AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointSuffix);
338+
}
339+
set
340+
{
341+
this.SetEndpoint(AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointSuffix, value);
342+
}
343+
}
344+
345+
/// <summary>
346+
/// Gets or sets the resource Id to use for contacting the Synapse Analyticss endpoint
347+
/// </summary>
348+
public string AzureSynapseAnalyticsEndpointResourceId
349+
{
350+
get
351+
{
352+
return this.GetEndpoint(AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointResourceId);
353+
}
354+
set
355+
{
356+
this.SetEndpoint(AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointResourceId, value);
357+
}
358+
}
359+
327360
public IList<string> VersionProfiles { get; } = new List<string>();
328361

329362
public IDictionary<string, string> ExtendedProperties { get; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);

0 commit comments

Comments
 (0)