Skip to content

Commit 9378fa1

Browse files
authored
Merge branch 'master' into erich/fix-file-permission
2 parents 3df55ab + 3406185 commit 9378fa1

File tree

101 files changed

+14465
-4461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+14465
-4461
lines changed

.azure-pipelines/release-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ jobs:
104104
displayName: Run Smoke Test
105105
inputs:
106106
filePath: 'tools/Test/SmokeTest/ScriptsCaller.ps1'
107-
arguments: '-RequiredPsVersion $(PSVersion) -Script "./tools/Test/SmokeTest/RmCoreSmokeTests.ps1 $(SubscriptionId)"'
107+
arguments: '-RequiredPsVersion $(PSVersion) -Script "./tools/Test/SmokeTest/RmCoreSmokeTests.ps1 "'
108108

109109
- task: PowerShell@2
110110
displayName: 'Run Smoke Test Reversely'
111111
inputs:
112112
filePath: 'tools/Test/SmokeTest/ScriptsCaller.ps1'
113-
arguments: '-RequiredPsVersion $(PSVersion) -Script "./tools/Test/SmokeTest/RmCoreSmokeTests.ps1 $(SubscriptionId) -Reverse"'
113+
arguments: '-RequiredPsVersion $(PSVersion) -Script "./tools/Test/SmokeTest/RmCoreSmokeTests.ps1 -Reverse"'
114114

115115
- task: PowerShell@2
116116
displayName: Clean Az Modules
@@ -128,13 +128,13 @@ jobs:
128128
displayName: Run Smoke Test
129129
inputs:
130130
filePath: 'tools/Test/SmokeTest/ScriptsCaller.ps1'
131-
arguments: '-RequiredPsVersion $(PSVersion) -Script "./tools/Test/SmokeTest/RmCoreSmokeTests.ps1 $(SubscriptionId) "'
131+
arguments: '-RequiredPsVersion $(PSVersion) -Script "./tools/Test/SmokeTest/RmCoreSmokeTests.ps1 "'
132132

133133
- task: PowerShell@2
134134
displayName: 'Run Smoke Test Reversely'
135135
inputs:
136136
filePath: 'tools/Test/SmokeTest/ScriptsCaller.ps1'
137-
arguments: '-RequiredPsVersion $(PSVersion) -Script "./tools/Test/SmokeTest/RmCoreSmokeTests.ps1 $(SubscriptionId) -Reverse "'
137+
arguments: '-RequiredPsVersion $(PSVersion) -Script "./tools/Test/SmokeTest/RmCoreSmokeTests.ps1 -Reverse "'
138138

139139
- task: PowerShell@2
140140
displayName: Clean Az Modules

.github/ISSUE_TEMPLATE/az-module-bug-report.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ assignees: ''
4646

4747
## Debug output
4848

49-
<!-- Set $DebugPreference='Continue' before running the repro and paste the resulting debug stream in the below code block -->
49+
<!-- Set $DebugPreference='Continue' before running the repro and paste the resulting debug stream in the below code block
50+
ATTENTION: Be sure to remove any sensitive information that may be in the logs -->
5051

5152
```
5253
5354
```
5455

5556
## Error output
5657

57-
<!-- Please run Resolve-AzError and paste the output in the below code block -->
58+
<!-- Please run Resolve-AzError and paste the output in the below code block
59+
ATTENTION: Be sure to remove any sensitive information that may be in the logs -->
5860

5961
```
6062

.github/ISSUE_TEMPLATE/azurerm-module-bug-report.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@ assignees: ''
3737

3838
## Debug output
3939

40-
<!-- Set $DebugPreference='Continue' before running the repro and paste the resulting debug stream in the below code block -->
40+
<!-- Set $DebugPreference='Continue' before running the repro and paste the resulting debug stream in the below code block
41+
ATTENTION: Be sure to remove any sensitive information that may be in the logs -->
4142

4243
```
4344
4445
```
4546

4647
## Error output
4748

48-
<!-- Please run Resolve-AzureRmError and paste the output in the below code block -->
49+
<!-- Please run Resolve-AzureRmError and paste the output in the below code block
50+
ATTENTION: Be sure to remove any sensitive information that may be in the logs -->
4951

5052
```
5153

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
* Fixed an issue that error happens if user profile path is inaccessible
22+
* Added parameter "ContainerRegistryEndpointSuffix" to: `Add-AzEnvironment`, `Set-AzEnvironment`
2223
* Supported interrupting login by hitting <kbd>CTRL</kbd>+<kbd>C</kbd>
2324
* Fixed an issue causing `Connect-AzAccount -KeyVaultAccessToken` not working [#13127]
2425
* Fixed null reference and method case insensitive in `Invoke-AzRestMethod`

src/Accounts/Accounts/Environment/AddAzureRMEnvironment.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ public string DataLakeAudience
196196
HelpMessage = "Dns suffix of Azure Synapse Analytics.")]
197197
public string AzureSynapseAnalyticsEndpointSuffix { get; set; }
198198

199+
[Parameter(ParameterSetName = EnvironmentPropertiesParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
200+
HelpMessage = "Suffix of Azure Container Registry.")]
201+
[Parameter(ParameterSetName = MetadataParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
202+
HelpMessage = "Suffix of Azure Container Registry.")]
203+
public string ContainerRegistryEndpointSuffix { get; set; }
204+
199205
[Parameter(ParameterSetName = EnvironmentPropertiesParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
200206
HelpMessage = "The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token.")]
201207
[Parameter(ParameterSetName = MetadataParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
@@ -327,7 +333,8 @@ public override void ExecuteCmdlet()
327333
nameof(StorageEndpoint));
328334
SetEndpointIfBound(newEnvironment, AzureEnvironment.Endpoint.ActiveDirectory,
329335
nameof(ActiveDirectoryEndpoint), true);
330-
336+
SetEndpointIfBound(newEnvironment, AzureEnvironment.Endpoint.ContainerRegistryEndpointSuffix,
337+
nameof(ContainerRegistryEndpointSuffix));
331338
SetEndpointIfBound(newEnvironment,
332339
AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId,
333340
nameof(ActiveDirectoryServiceEndpointResourceId));

src/Accounts/Accounts/Environment/SetAzureRMEnvironment.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ public string DataLakeAudience
176176
HelpMessage = "Dns suffix of Azure Synapse Analytics.")]
177177
public string AzureSynapseAnalyticsEndpointSuffix { get; set; }
178178

179+
[Parameter(ParameterSetName = EnvironmentPropertiesParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
180+
HelpMessage = "Suffix of Azure Container Registry.")]
181+
[Parameter(ParameterSetName = MetadataParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
182+
HelpMessage = "Suffix of Azure Container Registry.")]
183+
public string ContainerRegistryEndpointSuffix { get; set; }
184+
179185
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
180186
HelpMessage = "The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token.")]
181187
public string AzureSynapseAnalyticsEndpointResourceId { get; set; }
@@ -339,6 +345,8 @@ public override void ExecuteCmdlet()
339345
nameof(AzureAttestationServiceEndpointResourceId));
340346
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointSuffix,
341347
nameof(AzureSynapseAnalyticsEndpointSuffix));
348+
SetEndpointIfBound(newEnvironment, AzureEnvironment.Endpoint.ContainerRegistryEndpointSuffix,
349+
nameof(ContainerRegistryEndpointSuffix));
342350
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointResourceId,
343351
nameof(AzureSynapseAnalyticsEndpointResourceId));
344352
WriteObject(new PSAzureEnvironment(profileClient.AddOrSetEnvironment(newEnvironment)));

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

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ Add-AzEnvironment [-Name] <String> [[-PublishSettingsFileUrl] <String>] [[-Servi
2727
[[-AzureOperationalInsightsEndpoint] <String>] [-AzureAnalysisServicesEndpointSuffix <String>]
2828
[-AzureAnalysisServicesEndpointResourceId <String>] [-AzureAttestationServiceEndpointSuffix <String>]
2929
[-AzureAttestationServiceEndpointResourceId <String>] [-AzureSynapseAnalyticsEndpointSuffix <String>]
30-
[-AzureSynapseAnalyticsEndpointResourceId <String>] [-Scope <ContextModificationScope>]
31-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
30+
[-ContainerRegistryEndpointSuffix <String>] [-AzureSynapseAnalyticsEndpointResourceId <String>]
31+
[-Scope <ContextModificationScope>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
32+
[<CommonParameters>]
3233
```
3334

3435
### ARMEndpoint
@@ -39,14 +40,14 @@ Add-AzEnvironment [-Name] <String> [[-StorageEndpoint] <String>] [-ARMEndpoint]
3940
[[-AzureOperationalInsightsEndpointResourceId] <String>] [[-AzureOperationalInsightsEndpoint] <String>]
4041
[-AzureAnalysisServicesEndpointSuffix <String>] [-AzureAnalysisServicesEndpointResourceId <String>]
4142
[-AzureAttestationServiceEndpointSuffix <String>] [-AzureAttestationServiceEndpointResourceId <String>]
42-
[-AzureSynapseAnalyticsEndpointSuffix <String>] [-AzureSynapseAnalyticsEndpointResourceId <String>]
43-
[-Scope <ContextModificationScope>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
44-
[<CommonParameters>]
43+
[-AzureSynapseAnalyticsEndpointSuffix <String>] [-ContainerRegistryEndpointSuffix <String>]
44+
[-AzureSynapseAnalyticsEndpointResourceId <String>] [-Scope <ContextModificationScope>]
45+
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
4546
```
4647

4748
### Discovery
4849
```
49-
Add-AzEnvironment -AutoDiscover [-Uri <Uri>] [-Scope {Process | CurrentUser}]
50+
Add-AzEnvironment [-AutoDiscover] [-Uri <Uri>] [-Scope <ContextModificationScope>]
5051
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
5152
```
5253

@@ -429,6 +430,21 @@ Accept pipeline input: True (ByPropertyName)
429430
Accept wildcard characters: False
430431
```
431432
433+
### -ContainerRegistryEndpointSuffix
434+
Suffix of Azure Container Registry.
435+
436+
```yaml
437+
Type: System.String
438+
Parameter Sets: Name, ARMEndpoint
439+
Aliases:
440+
441+
Required: False
442+
Position: Named
443+
Default value: None
444+
Accept pipeline input: True (ByPropertyName)
445+
Accept wildcard characters: False
446+
```
447+
432448
### -DataLakeAudience
433449
The audience for tokens authenticating with the AD Data Lake services Endpoint.
434450

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

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ Set-AzEnvironment [-Name] <String> [[-PublishSettingsFileUrl] <String>] [[-Servi
2727
[[-AzureOperationalInsightsEndpoint] <String>] [-AzureAnalysisServicesEndpointSuffix <String>]
2828
[-AzureAnalysisServicesEndpointResourceId <String>] [-AzureAttestationServiceEndpointSuffix <String>]
2929
[-AzureAttestationServiceEndpointResourceId <String>] [-AzureSynapseAnalyticsEndpointSuffix <String>]
30-
[-AzureSynapseAnalyticsEndpointResourceId <String>] [-Scope <ContextModificationScope>]
31-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
30+
[-ContainerRegistryEndpointSuffix <String>] [-AzureSynapseAnalyticsEndpointResourceId <String>]
31+
[-Scope <ContextModificationScope>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
32+
[<CommonParameters>]
3233
```
3334

3435
### ARMEndpoint
@@ -39,9 +40,9 @@ Set-AzEnvironment [-Name] <String> [[-StorageEndpoint] <String>] [-ARMEndpoint]
3940
[[-AzureOperationalInsightsEndpointResourceId] <String>] [[-AzureOperationalInsightsEndpoint] <String>]
4041
[-AzureAnalysisServicesEndpointSuffix <String>] [-AzureAnalysisServicesEndpointResourceId <String>]
4142
[-AzureAttestationServiceEndpointSuffix <String>] [-AzureAttestationServiceEndpointResourceId <String>]
42-
[-AzureSynapseAnalyticsEndpointSuffix <String>] [-AzureSynapseAnalyticsEndpointResourceId <String>]
43-
[-Scope <ContextModificationScope>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
44-
[<CommonParameters>]
43+
[-AzureSynapseAnalyticsEndpointSuffix <String>] [-ContainerRegistryEndpointSuffix <String>]
44+
[-AzureSynapseAnalyticsEndpointResourceId <String>] [-Scope <ContextModificationScope>]
45+
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
4546
```
4647

4748
## DESCRIPTION
@@ -187,6 +188,7 @@ Default value: None
187188
Accept pipeline input: False
188189
Accept wildcard characters: False
189190
```
191+
190192
### -AzureAttestationServiceEndpointResourceId
191193
The The resource identifier of the Azure Attestation service that is the recipient of the requested token.
192194
@@ -198,7 +200,7 @@ Aliases:
198200
Required: False
199201
Position: Named
200202
Default value: None
201-
Accept pipeline input: False
203+
Accept pipeline input: True (ByPropertyName)
202204
Accept wildcard characters: False
203205
```
204206
@@ -213,7 +215,7 @@ Aliases:
213215
Required: False
214216
Position: Named
215217
Default value: None
216-
Accept pipeline input: False
218+
Accept pipeline input: True (ByPropertyName)
217219
Accept wildcard characters: False
218220
```
219221
@@ -318,7 +320,7 @@ Aliases:
318320
Required: False
319321
Position: Named
320322
Default value: None
321-
Accept pipeline input: False
323+
Accept pipeline input: True (ByPropertyName)
322324
Accept wildcard characters: False
323325
```
324326
@@ -333,7 +335,7 @@ Aliases:
333335
Required: False
334336
Position: Named
335337
Default value: None
336-
Accept pipeline input: False
338+
Accept pipeline input: True (ByPropertyName)
337339
Accept wildcard characters: False
338340
```
339341
@@ -352,6 +354,21 @@ Accept pipeline input: True (ByPropertyName)
352354
Accept wildcard characters: False
353355
```
354356
357+
### -ContainerRegistryEndpointSuffix
358+
Suffix of Azure Container Registry.
359+
360+
```yaml
361+
Type: System.String
362+
Parameter Sets: (All)
363+
Aliases:
364+
365+
Required: False
366+
Position: Named
367+
Default value: None
368+
Accept pipeline input: True (ByPropertyName)
369+
Accept wildcard characters: False
370+
```
371+
355372
### -DataLakeAudience
356373
The audience for tokens authenticating with the AD Data Lake services Endpoint.
357374
@@ -609,7 +626,7 @@ Accept wildcard characters: False
609626
```
610627
611628
### CommonParameters
612-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
629+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
613630
614631
## INPUTS
615632

src/Accounts/Authentication.ResourceManager/ContextModelExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ public static IAzureEnvironment Merge(this IAzureEnvironment environment1, IAzur
137137
ServiceManagementUrl = environment1.ServiceManagementUrl ?? environment2.ServiceManagementUrl,
138138
SqlDatabaseDnsSuffix = environment1.SqlDatabaseDnsSuffix ?? environment2.SqlDatabaseDnsSuffix,
139139
StorageEndpointSuffix = environment1.StorageEndpointSuffix ?? environment2.StorageEndpointSuffix,
140-
TrafficManagerDnsSuffix = environment1.TrafficManagerDnsSuffix ?? environment2.TrafficManagerDnsSuffix
140+
TrafficManagerDnsSuffix = environment1.TrafficManagerDnsSuffix ?? environment2.TrafficManagerDnsSuffix,
141+
ContainerRegistryEndpointSuffix = environment1.ContainerRegistryEndpointSuffix ?? environment2.ContainerRegistryEndpointSuffix
141142
};
142143

143144
foreach (var property in environment1.ExtendedProperties.Keys.Union(environment2.ExtendedProperties.Keys))

src/Aks/Aks.Test/ScenarioTests/KubernetesTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ public void TestAzureKubernetes()
3131
TestController.NewInstance.RunPowerShellTest(_logger, "Test-NewAzAks");
3232
}
3333

34+
[Fact]
35+
[Trait(Category.AcceptanceType, Category.CheckIn)]
36+
public void TestNewAzureKubernetesByServicePrincipal()
37+
{
38+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-NewAzAksByServicePrincipal");
39+
}
40+
3441
[Fact]
3542
[Trait(Category.AcceptanceType, Category.CheckIn)]
3643
public void TestAzureKubernetesAddons()

src/Aks/Aks.Test/ScenarioTests/KubernetesTests.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,37 @@ function Test-NewAzAks
146146
}
147147
}
148148

149+
function Test-NewAzAksByServicePrincipal
150+
{
151+
# Setup
152+
$resourceGroupName = Get-RandomResourceGroupName
153+
$kubeClusterName = Get-RandomClusterName
154+
$location = "eastus"
155+
156+
$ServicePrincipalId = '618a2a3a-9d44-415a-b0ce-9729253a4ba9'
157+
$Secret = '5E41A57vC_ODdiFb5ji-a9~C~Mp3gKt7D~'
158+
$secStringPassword = ConvertTo-SecureString $Secret -AsPlainText -Force
159+
$credObject = New-Object System.Management.Automation.PSCredential($ServicePrincipalId,$secStringPassword)
160+
161+
try
162+
{
163+
New-AzResourceGroup -Name $resourceGroupName -Location $location
164+
165+
166+
New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName `
167+
-ServicePrincipalIdAndSecret $credObject
168+
$cluster = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName
169+
Assert-AreEqual $ServicePrincipalId $cluster.ServicePrincipalProfile.ClientId
170+
171+
$cluster | Import-AzAksCredential -Force
172+
$cluster | Remove-AzAksCluster -Force
173+
}
174+
finally
175+
{
176+
Remove-AzResourceGroup -Name $resourceGroupName -Force
177+
}
178+
}
179+
149180
function Test-NewAzAksAddons
150181
{
151182
# Setup

0 commit comments

Comments
 (0)