Skip to content

Commit 6d44d10

Browse files
author
Dragos Avadanei
committed
Merge remote-tracking branch 'refs/remotes/Azure/preview' into feature/updates4aug
2 parents b892bcc + dd1009a commit 6d44d10

File tree

149 files changed

+1090714
-43316
lines changed

Some content is hidden

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

149 files changed

+1090714
-43316
lines changed

setup/azurecmdfiles.wxi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,6 +2228,9 @@
22282228
<Component Id="cmp1460DC2324E946B9F5F76360ED57C0FE" Guid="*">
22292229
<File Id="fil63597DE31C6B3211017C4B4EAD93F683" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Profile\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
22302230
</Component>
2231+
<Component Id="cmp95697C7A2E29A43F7195D799D68E138B" Guid="*">
2232+
<File Id="fil53FA53B6DEFBC23592C3C2A82969E769" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Profile\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll" />
2233+
</Component>
22312234
<Component Id="cmp3BEF3C9459257F053CAAC956B7CFA10D" Guid="*">
22322235
<File Id="fil830F7BE66C1E1324FCE632956432C2C7" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Profile\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll" />
22332236
</Component>
@@ -6063,6 +6066,7 @@
60636066
<ComponentRef Id="cmpE2AF801EDF4F7F1C347F9D7052313074" />
60646067
<ComponentRef Id="cmp6004E0F8B6FA21BF5CAE3CFCA2CA9E67" />
60656068
<ComponentRef Id="cmp1460DC2324E946B9F5F76360ED57C0FE" />
6069+
<ComponentRef Id="cmp95697C7A2E29A43F7195D799D68E138B" />
60666070
<ComponentRef Id="cmp3BEF3C9459257F053CAAC956B7CFA10D" />
60676071
<ComponentRef Id="cmpB7D392D58F12D947C1D915326ABA98EA" />
60686072
<ComponentRef Id="cmp61D87C757ACDE206CC79A5B19CE403B2" />

src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMCmdlet.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,19 @@ protected override void Dispose(bool disposing)
311311
protected override void BeginProcessing()
312312
{
313313
AzureSession.Instance.ClientFactory.RemoveHandler(typeof(RPRegistrationDelegatingHandler));
314-
AzureSession.Instance.ClientFactory.AddHandler(new RPRegistrationDelegatingHandler(
315-
() => new ResourceManagementClient(
316-
DefaultContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager),
317-
AzureSession.Instance.AuthenticationFactory.GetServiceClientCredentials(DefaultContext, AzureEnvironment.Endpoint.ResourceManager)),
318-
s => DebugMessages.Enqueue(s)));
314+
if (DefaultContext != null && DefaultContext.Subscription != null)
315+
{
316+
AzureSession.Instance.ClientFactory.AddHandler(new RPRegistrationDelegatingHandler(
317+
() =>
318+
{
319+
var client = new ResourceManagementClient(
320+
DefaultContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager),
321+
AzureSession.Instance.AuthenticationFactory.GetServiceClientCredentials(DefaultContext, AzureEnvironment.Endpoint.ResourceManager));
322+
client.SubscriptionId = DefaultContext.Subscription.Id;
323+
return client;
324+
},
325+
s => DebugMessages.Enqueue(s)));
326+
}
319327

320328
base.BeginProcessing();
321329
}

src/ResourceManager/Common/Commands.ResourceManager.Common/Utilities/ResourceManagementClientExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ public static List<GenericResource> FilterResources(this IResourceManagementClie
5656
}
5757
}
5858

59+
foreach (var resource in resources)
60+
{
61+
var identifier = new ResourceIdentifier(resource.Id);
62+
resource.ResourceGroupName = identifier.ResourceGroupName;
63+
}
64+
5965
return resources;
6066
}
6167
}

src/ResourceManager/Compute/Commands.Compute/Common/DiagnosticsHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ public static string GetConfigValueFromPrivateConfig(string configurationPath, s
532532
/// 1. The one get from StorageContext parameter
533533
/// 2. The one parsed from the diagnostics configuration file
534534
/// </summary>
535-
public static string InitializeStorageAccountName(AzureStorageContext storageContext = null, string configurationPath = null)
535+
public static string InitializeStorageAccountName(IStorageContext storageContext = null, string configurationPath = null)
536536
{
537537
string storageAccountName = null;
538538
var configFileType = GetConfigFileType(configurationPath);
@@ -594,7 +594,7 @@ public static string InitializeStorageAccountKey(IStorageManagementClient storag
594594
/// 4. The one get from current Azure Environment
595595
/// </summary>
596596
public static string InitializeStorageAccountEndpoint(string storageAccountName, string storageAccountKey, IStorageManagementClient storageClient,
597-
AzureStorageContext storageContext = null, string configurationPath = null, IAzureContext defaultContext = null)
597+
IStorageContext storageContext = null, string configurationPath = null, IAzureContext defaultContext = null)
598598
{
599599
string storageAccountEndpoint = null;
600600
StorageAccount storageAccount = null;
@@ -653,7 +653,7 @@ private static AzureStorageContext CreateStorageContext(Uri blobEndpoint, Uri qu
653653
return new AzureStorageContext(cloudStorageAccount);
654654
}
655655

656-
private static string GetEndpointFromStorageContext(AzureStorageContext context)
656+
private static string GetEndpointFromStorageContext(IStorageContext context)
657657
{
658658
var scheme = context.BlobEndPoint.StartsWith("https://", StringComparison.OrdinalIgnoreCase) ? "https://" : "http://";
659659
return scheme + context.EndPointSuffix;

src/ResourceManager/Compute/Commands.Compute/Extension/Diagnostics/SetAzureRmVMDiagnosticsExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public string DiagnosticsConfigurationPath
9898
ValueFromPipelineByPropertyName = true,
9999
HelpMessage = "The storage connection context.")]
100100
[ValidateNotNullOrEmpty]
101-
public AzureStorageContext StorageContext { get; set; }
101+
public IStorageContext StorageContext { get; set; }
102102

103103
[Parameter(
104104
Mandatory = false,

src/ResourceManager/Compute/Commands.Compute/Extension/SqlServer/NewAzureVMSqlServerAutoBackupConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public class NewAzureVMSqlServerAutoBackupConfigCommand : AzureRMCmdlet
8787
ValueFromPipelineByPropertyName = true,
8888
HelpMessage = "The storage connection context")]
8989
[ValidateNotNullOrEmpty]
90-
public AzureStorageContext StorageContext
90+
public IStorageContext StorageContext
9191
{
9292
get;
9393
set;

src/ResourceManager/DataLakeStore/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Fix for issue: https://github.com/Azure/azure-powershell/issues/4323
2122

2223
## Version 4.2.1
2324

src/ResourceManager/DataLakeStore/Commands.DataLakeStore/Models/DataLakeStoreClient.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,6 @@ public DataLakeStoreAccount CreateAccount(
114114

115115
var toReturn = _client.Account.Create(resourceGroupName, accountName, parameters);
116116

117-
// enable the key vault for the user so they don't have to run an additional command.
118-
if (encryptionType.HasValue && encryptionType.Value == EncryptionConfigType.UserManaged)
119-
{
120-
this.EnableKeyVault(resourceGroupName, accountName);
121-
}
122-
123117
return toReturn;
124118
}
125119

@@ -158,12 +152,6 @@ public DataLakeStoreAccount UpdateAccount(
158152

159153
var toReturn = _client.Account.Update(resourceGroupName, accountName, parameters);
160154

161-
// auto enable the key vault for the user if they updated it.
162-
if (userConfig != null)
163-
{
164-
this.EnableKeyVault(resourceGroupName, accountName);
165-
}
166-
167155
return toReturn;
168156
}
169157

src/ResourceManager/Network/AzureRM.Network.psd1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ CmdletsToExport = 'Add-AzureRmApplicationGatewayAuthenticationCertificate',
300300
'Get-AzureRmVirtualNetworkGatewayAdvertisedRoute',
301301
'Get-AzureRmVirtualNetworkGatewayLearnedRoute',
302302
'Get-AzureRmNetworkUsage',
303-
'Get-AzureRmVirtualNetworkUsageList',
304-
'Get-AzureRmVirtualNetworkPrivateAccessService'
303+
'Get-AzureRmVirtualNetworkUsageList'
305304

306305
# Variables to export from this module
307306
# VariablesToExport = @()

src/ResourceManager/Network/ChangeLog.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,10 @@
2424
- PeerAddressType
2525
* Remove-AzureRmExpressRouteCircuitPeeringConfig: Added IPv6 support. New optional parameter added
2626
- PeerAddressType
27-
28-
* Added support for private access services to Virtual Network Subnets
29-
- Updated Add-AzureRmVirtualSubnetConfig: Added optional parameter -PrivateAccessService
30-
- Updated New-AzureRmVirtualSubnetConfig: Added optional parameter -PrivateAccessService
31-
- Updated Set-AzureRmVirtualSubnetConfig: Added optional parameter -PrivateAccessService
32-
* Added cmdlet to list private access services available in the location
33-
- Get-AzureRmVirtualNetworkPrivateAccessService
27+
* Marked parameter -ProbeEnabled as obsolete
28+
- Add-AzureRmApplicationGatewayBackendHttpSettings
29+
- New-AzureRmApplicationGatewayBackendHttpSettings
30+
- Set-AzureRmApplicationGatewayBackendHttpSettings
3431

3532
## Version 4.2.1
3633

src/ResourceManager/Network/Commands.Network.Test/Commands.Network.Test.csproj

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@
179179
<Compile Include="Properties\AssemblyInfo.cs" />
180180
<Compile Include="NetworkResourcesController.cs" />
181181
<Compile Include="ScenarioTests\ApplicationGatewayTests.cs" />
182-
<Compile Include="ScenarioTests\AvailablePrivateAccessServiceTests.cs" />
183182
<Compile Include="ScenarioTests\MultiIpConfigOnNicTests.cs" />
184183
<Compile Include="ScenarioTests\ExpressRouteServiceProviderTests.cs" />
185184
<Compile Include="ScenarioTests\NetworkInterfaceTests.cs" />
@@ -211,9 +210,6 @@
211210
<None Include="ScenarioTests\ApplicationGatewayTests.ps1">
212211
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
213212
</None>
214-
<None Include="ScenarioTests\AvailablePrivateAccessServiceTests.ps1">
215-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
216-
</None>
217213
<None Include="ScenarioTests\Data\ApplicationGatewayAuthCert.cer">
218214
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
219215
</None>
@@ -280,9 +276,6 @@
280276
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.ApplicationGatewayTests\TestAvailableWafRuleSets.json">
281277
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
282278
</None>
283-
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.AvailablePrivateAccessServiceTests\TestAvailablePrivateAccessServicesList.json">
284-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
285-
</None>
286279
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.ExpressRouteCircuitTests\TestExpressRouteBgpServiceCommunitiesGet.json">
287280
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
288281
</None>
@@ -517,9 +510,6 @@
517510
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.VirtualNetworkTests\TestVirtualNetworkSubnetCRUD.json">
518511
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
519512
</None>
520-
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.VirtualNetworkTests\TestVirtualNetworkSubnetPrivateAccess.json">
521-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
522-
</None>
523513
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.VirtualNetworkTests\TestVirtualNetworkUsage.json">
524514
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
525515
</None>
@@ -563,4 +553,4 @@
563553
</ItemGroup>
564554
<ItemGroup />
565555
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
566-
</Project>
556+
</Project>

src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/ApplicationGatewayTests.ps1

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ function Test-ApplicationGatewayCRUD
8787
$nic01Name = Get-ResourceName
8888
$nic02Name = Get-ResourceName
8989
$authCertName = Get-ResourceName
90-
$probeHttpsName = Get-ResourceName
90+
$probe01Name = Get-ResourceName
91+
$probe02Name = Get-ResourceName
9192

9293
try
9394
{
@@ -104,7 +105,6 @@ function Test-ApplicationGatewayCRUD
104105

105106
# Create public ip
106107
$publicip = New-AzureRmPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic
107-
#$publicip = Get-AzureRmPublicIpAddress -ResourceGroupName $rgname -name $publicIpName
108108

109109
# create 2 nics to add to backend
110110
$nic01 = New-AzureRmNetworkInterface -Name $nic01Name -ResourceGroupName $rgname -Location $location -Subnet $nicSubnet
@@ -125,18 +125,33 @@ function Test-ApplicationGatewayCRUD
125125

126126
$authCertFilePath = $basedir + "\ScenarioTests\Data\ApplicationGatewayAuthCert.cer"
127127
$authcert01 = New-AzureRmApplicationGatewayAuthenticationCertificate -Name $authCertName -CertificateFile $authCertFilePath
128-
$probeHttps = New-AzureRmApplicationGatewayProbeConfig -Name $probeHttpsName -Protocol Https -HostName "probe.com" -Path "/path/path.htm" -Interval 89 -Timeout 88 -UnhealthyThreshold 8
128+
129+
# Create match with undefined statuscode list
130+
$match1 = New-AzureRmApplicationGatewayProbeHealthResponseMatch -Body "helloworld"
131+
Assert-Null $match1.StatusCodes
132+
133+
$probe01 = New-AzureRmApplicationGatewayProbeConfig -Name $probe01Name -Match $match1 -Protocol Http -HostName "probe.com" -Path "/path/path.htm" -Interval 89 -Timeout 88 -UnhealthyThreshold 8
129134

130135
$connectionDraining01 = New-AzureRmApplicationGatewayConnectionDraining -Enabled $True -DrainTimeoutInSec 42
131-
$poolSetting01 = New-AzureRmApplicationGatewayBackendHttpSettings -Name $poolSetting01Name -Port 80 -Protocol Http -CookieBasedAffinity Disabled -ConnectionDraining $connectionDraining01
136+
$poolSetting01 = New-AzureRmApplicationGatewayBackendHttpSettings -Name $poolSetting01Name -Port 80 -Protocol Http -Probe $probe01 -CookieBasedAffinity Disabled -ConnectionDraining $connectionDraining01
132137
Assert-NotNull $poolSetting01.connectionDraining
133138
Assert-AreEqual $True $poolSetting01.connectionDraining.Enabled
134139
Assert-AreEqual 42 $poolSetting01.connectionDraining.DrainTimeoutInSec
140+
Assert-NotNull $poolSetting01.Probe
135141

136-
$poolSetting02 = New-AzureRmApplicationGatewayBackendHttpSettings -Name $poolSetting02Name -Port 443 -Protocol Https -Probe $probeHttps -CookieBasedAffinity Enabled -AuthenticationCertificates $authcert01
142+
# Create match with empty statuscode list
143+
$match2 = New-AzureRmApplicationGatewayProbeHealthResponseMatch -Body "helloworld" -StatusCode "200"
144+
Assert-NotNull $match2.StatusCodes
145+
$match2.StatusCodes.RemoveAt(0)
146+
Assert-AreEqual 0 $match2.StatusCodes.Count
147+
148+
$probe02 = New-AzureRmApplicationGatewayProbeConfig -Name $probe02Name -Match $match2 -Protocol Https -HostName "probe.com" -Path "/path/path.htm" -Interval 89 -Timeout 88 -UnhealthyThreshold 8
149+
150+
$poolSetting02 = New-AzureRmApplicationGatewayBackendHttpSettings -Name $poolSetting02Name -Probe $probe02 -Port 443 -Protocol Https -CookieBasedAffinity Enabled -AuthenticationCertificates $authcert01
137151
Assert-Null $poolSetting02.connectionDraining
152+
Assert-NotNull $poolSetting02.Probe
138153

139-
#Test setting and removing connectiondraining
154+
# Test setting and removing connectiondraining
140155
Set-AzureRmApplicationGatewayConnectionDraining -BackendHttpSettings $poolSetting02 -Enabled $False -DrainTimeoutInSec 3600
141156
$connectionDraining02 = Get-AzureRmApplicationGatewayConnectionDraining -BackendHttpSettings $poolSetting02
142157
Assert-NotNull $connectionDraining02
@@ -160,7 +175,7 @@ function Test-ApplicationGatewayCRUD
160175
$firewallConfig = New-AzureRmApplicationGatewayWebApplicationFirewallConfiguration -Enabled $true -FirewallMode Prevention -RuleSetType "OWASP" -RuleSetVersion "2.2.9" -DisabledRuleGroups $disabledRuleGroup1,$disabledRuleGroup2
161176

162177
# Create Application Gateway
163-
$appgw = New-AzureRmApplicationGateway -Name $appgwName -ResourceGroupName $rgname -Location $location -Probes $probeHttps -BackendAddressPools $pool, $nicPool -BackendHttpSettingsCollection $poolSetting01,$poolSetting02 -FrontendIpConfigurations $fipconfig01, $fipconfig02  -GatewayIpConfigurations $gipconfig -FrontendPorts $fp01, $fp02 -HttpListeners $listener01, $listener02 -RequestRoutingRules $rule01, $rule02 -Sku $sku -SslPolicy $sslPolicy -AuthenticationCertificates $authcert01 -WebApplicationFirewallConfiguration $firewallConfig
178+
$appgw = New-AzureRmApplicationGateway -Name $appgwName -ResourceGroupName $rgname -Location $location -Probes $probe01, $probe02 -BackendAddressPools $pool, $nicPool -BackendHttpSettingsCollection $poolSetting01,$poolSetting02 -FrontendIpConfigurations $fipconfig01, $fipconfig02  -GatewayIpConfigurations $gipconfig -FrontendPorts $fp01, $fp02 -HttpListeners $listener01, $listener02 -RequestRoutingRules $rule01, $rule02 -Sku $sku -SslPolicy $sslPolicy -AuthenticationCertificates $authcert01 -WebApplicationFirewallConfiguration $firewallConfig
164179

165180
# Get Application Gateway
166181
$getgw = Get-AzureRmApplicationGateway -Name $appgwName -ResourceGroupName $rgname
@@ -170,6 +185,21 @@ function Test-ApplicationGatewayCRUD
170185
Compare-ConnectionDraining $poolSetting02 $getgw.BackendHttpSettingsCollection[1]
171186
Compare-WebApplicationFirewallConfiguration $firewallConfig $getgw.WebApplicationFirewallConfiguration
172187

188+
# Check probes
189+
Assert-NotNull $getgw.Probes
190+
Assert-AreEqual 2 $getgw.Probes.Count
191+
192+
# Check that statuscode of probe[0] is still null
193+
Assert-NotNull $getgw.Probes[0]
194+
Assert-NotNull $getgw.Probes[0].Match
195+
Assert-Null $getgw.Probes[0].Match.StatusCodes
196+
197+
# Check that statuscode of probe[1] is still an emtpy list
198+
Assert-NotNull $getgw.Probes[1]
199+
Assert-NotNull $getgw.Probes[1].Match
200+
Assert-NotNull $getgw.Probes[1].Match.StatusCodes
201+
Assert-AreEqual 0 $getgw.Probes[1].Match.StatusCodes.Count
202+
173203
# Get Application Gateway backend health with expanded resource
174204
$backendHealth = Get-AzureRmApplicationGatewayBackendHealth -Name $appgwName -ResourceGroupName $rgname -ExpandResource "backendhealth/applicationgatewayresource"
175205
Assert-NotNull $backendHealth.BackendAddressPools[0].BackendAddressPool.Name
@@ -357,7 +387,7 @@ function Test-ApplicationGatewayCRUD2
357387
$pool = New-AzureRmApplicationGatewayBackendAddressPool -Name $poolName -BackendIPAddresses www.microsoft.com, www.bing.com
358388
$match = New-AzureRmApplicationGatewayProbeHealthResponseMatch -Body "helloworld" -StatusCode "200-300","404"
359389
$probeHttp = New-AzureRmApplicationGatewayProbeConfig -Name $probeHttpName -Protocol Http -HostName "probe.com" -Path "/path/path.htm" -Interval 89 -Timeout 88 -UnhealthyThreshold 8 -Match $match
360-
$poolSetting01 = New-AzureRmApplicationGatewayBackendHttpSettings -Name $poolSetting01Name -Port 80 -Protocol Http -Probe $probeHttp -CookieBasedAffinity Enabled -ProbeEnabled -PickHostNameFromBackendAddress
390+
$poolSetting01 = New-AzureRmApplicationGatewayBackendHttpSettings -Name $poolSetting01Name -Port 80 -Protocol Http -Probe $probeHttp -CookieBasedAffinity Enabled -PickHostNameFromBackendAddress
361391

362392
# rule part
363393
$redirect01 = New-AzureRmApplicationGatewayRedirectConfiguration -Name $redirect01Name -RedirectType Permanent -TargetListener $listener01

src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/AvailablePrivateAccessServiceTests.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)