Skip to content

Commit

Permalink
Merge branch 'master' into DiskAccess
Browse files Browse the repository at this point in the history
  • Loading branch information
msJinLei authored Sep 3, 2020
2 parents bbced38 + 17cd174 commit e12dcb6
Show file tree
Hide file tree
Showing 149 changed files with 158,679 additions and 213,906 deletions.
1 change: 1 addition & 0 deletions src/Accounts/Accounts/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Formatted the breaking change messages
* Updated Azure.Core to 1.4.1

## Version 1.9.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,14 @@ public void TestInvokeAzVmPatchAssessment()
{
TestRunner.RunTestScript("Test-InvokeAzVmPatchAssessment");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestPatchStatusGetAzVMinstanceview()
{
TestRunner.RunTestScript("Test-PatchStatusGetAzVMinstanceview");
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,47 @@ function Test-InvokeAzVmPatchAssessment
# Cleanup
Clean-ResourceGroup $rgname
}
}


<#
.SYNOPSIS
Test PatchStatus in Get-Azvm instance view
#>
function Test-PatchStatusGetAzVMinstanceview
{
# Setup
$rgname = Get-ComputeTestResourceName

try
{
# Common
$loc = Get-ComputeVMLocation;
$loc = $loc.Replace(' ', '');

New-AzResourceGroup -Name $rgname -Location $loc -Force;

# VM Profile & Hardware
$vmsize = Get-AvailableSku $loc "virtualMachine"
$vmname = 'vm' + $rgname;

$username = "admin01"
$password = Get-PasswordForVM | ConvertTo-SecureString -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
[string]$domainNameLabel = "$vmname-$vmname".tolower();

$x = New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel
$patchResult = invoke-azvmpatchAssessment -resourcegroupname $rgname -vmname $vmname

$vm = Get-AzVM -ResourceGroupName $rgname -Name $vmname -Status;

Assert-NotNull $vm.PatchStatus;
Assert-NotNull $vm.PatchStatus.availablePatchSummary;
Assert-AreEqual "Succeeded" $vm.PatchStatus.availablePatchSummary.status;
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* New cmdlets for new resource type: DiskAccess 'Get-AzDiskAccess', 'New-AzDiskAccess' , 'Get-AzDiskAccess'
* Added optional parameters '-DiskAccessId' and '-NetworkAccessPolicy' to New-AzSnapshotConfig
* Added optional parameters '-DiskAccessId' and '-NetworkAccessPolicy' to New-AzDiskConfig
* Added 'PatchStatus'Property to VirtualMachine Instance View
* Added ``VMHealth`` property to the virtual machine's instance view, which is the returned object when ``Get-AzVm`` is invoked with ``-Status``
* Added 'AssignedHost' field to Get-AzVM and Get-AzVmss's instance views. The field shows the resource id of the virtual machine instance
* Added optional parameter '-SupportAutomaticPlacement' to New-AzHostGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public partial class PSVirtualMachineInstanceView
public IList<VirtualMachineExtensionInstanceView> Extensions { get; set; }
public BootDiagnosticsInstanceView BootDiagnostics { get; set; }
public IList<InstanceViewStatus> Statuses { get; set; }
public VirtualMachinePatchStatus PatchStatus { get; set; }
public VirtualMachineHealthStatus VmHealth { get; set; }

}
Expand Down
2 changes: 2 additions & 0 deletions src/Compute/Compute/Models/PSVirtualMachineInstanceView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class PSVirtualMachineInstanceView
public IList<InstanceViewStatus> Statuses { get; set; }

public MaintenanceRedeployStatus MaintenanceRedeployStatus { get; set; }
public VirtualMachinePatchStatus PatchStatus { get; set; }
public VirtualMachineHealthStatus VMHealth { get; set; }
}

Expand Down Expand Up @@ -72,6 +73,7 @@ public static PSVirtualMachineInstanceView ToPSVirtualMachineInstanceView(
OsName = virtualMachineInstanceView.OsName,
OsVersion = virtualMachineInstanceView.OsVersion,
HyperVGeneration = virtualMachineInstanceView.HyperVGeneration,
PatchStatus = virtualMachineInstanceView.PatchStatus,
VMHealth = virtualMachineInstanceView.VmHealth,
AssignedHost = virtualMachineInstanceView.AssignedHost
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,17 @@ function Test-SsisAzure-IntegrationRuntime
$licenseKey = New-Object Microsoft.Azure.Management.DataFactory.Models.SecureString('fakelicensekey')
$setup4 = New-Object Microsoft.Azure.Management.DataFactory.Models.ComponentSetup($componentName2, $licenseKey)

$setups = New-Object System.Collections.ArrayList
$setups.Add($setup1)
$setups.Add($setup2)
# Disable these two setup as it cannot be faked and the other two have already covered the function test
# $setups.Add($setup3)
# $setups.Add($setup4)
# Create setup for Azure PowerShell
$version = '4.5.0'
$setup5 = New-Object Microsoft.Azure.Management.DataFactory.Models.AzPowerShellSetup($version)

$setups = New-Object System.Collections.ArrayList
$setups.Add($setup1)
$setups.Add($setup2)
# Disable these two setup as it cannot be faked and the other two have already covered the function test
# $setups.Add($setup3)
# $setups.Add($setup4)
$setups.Add($setup5)

# Replace following variables with network resource ids
$vnetId = $Env:VnetId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,21 @@ The **Set-AzDataLakeStoreAccount** cmdlet modifies a Data Lake Store account.
## EXAMPLES

### Example 1: Add a tag to an account
```
```powershell
PS C:\>Set-AzDataLakeStoreAccount -Name "ContosoADL" -Tags @{"stage"="production"}
```

This command adds the specified tag to the Data Lake Store account named ContosoADL.

### Example 2

Modifies a Data Lake Store account. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Set-AzDataLakeStoreAccount -FirewallState Enabled -Name 'ContosoADL'
```

## PARAMETERS

### -AllowAzureIpState
Expand Down
11 changes: 10 additions & 1 deletion src/DataLakeStore/DataLakeStore/help/Test-AzDataLakeStoreItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,21 @@ The **Test-AzDataLakeStoreItem** cmdlet tests the existence of a file or folder
## EXAMPLES

### Example 1: Test a file
```
```powershell
PS C:\>Test-AzDataLakeStoreItem -AccountName "ContosoADL" -Path "/MyFiles/Test.csv"
```

This command tests whether the file Test.csv exists in the ContosoADL account.

### Example 2

Tests the existence of a file or folder in Data Lake Store. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Test-AzDataLakeStoreItem -Account 'ContosoADL' -Path '/MyFiles/Test.csv' -PathType Any
```

## PARAMETERS

### -Account
Expand Down
7 changes: 4 additions & 3 deletions src/KeyVault/KeyVault/Models/KeyVaultDataServiceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
using System.Security;
using System.Security.Cryptography.X509Certificates;
using System.Xml;
using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
using Microsoft.Azure.KeyVault;
using Microsoft.Azure.KeyVault.Models;
using Microsoft.Azure.KeyVault.WebKey;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using KeyVaultProperties = Microsoft.Azure.Commands.KeyVault.Properties;

Expand All @@ -41,9 +43,8 @@ public KeyVaultDataServiceClient(IAuthenticationFactory authFactory, IAzureConte
if (context.Environment == null)
throw new ArgumentException(KeyVaultProperties.Resources.InvalidAzureEnvironment);

var credential = new DataServiceCredential(authFactory, context, AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId);
this.keyVaultClient = new KeyVaultClient(credential.OnAuthentication);

ServiceClientCredentials clientCredentials = authFactory.GetServiceClientCredentials(context, AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId);
this.keyVaultClient = AzureSession.Instance.ClientFactory.CreateCustomArmClient<KeyVaultClient>(clientCredentials);

this.vaultUriHelper = new VaultUriHelper(
context.Environment.GetEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix));
Expand Down
6 changes: 5 additions & 1 deletion src/Network/Network.Test/Network.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PsModuleName>Network</PsModuleName>
Expand All @@ -15,12 +15,16 @@
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.5" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.Insights" Version="0.16.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="38.1.0" />
<PackageReference Include="Microsoft.Azure.Management.ContainerInstance" Version="2.0.0" />
<PackageReference Include="Microsoft.Azure.Management.PrivateDns" Version="1.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Redis" Version="4.4.1" />
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.21.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.ManagedServiceIdentity" Version="0.10.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="17.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
26 changes: 26 additions & 0 deletions src/Network/Network.Test/ScenarioTests/ApplicationGatewayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

using System;
using Microsoft.Azure.Commands.Network.Test.ScenarioTests;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;

Expand Down Expand Up @@ -66,6 +68,30 @@ public void TestApplicationGatewayCRUD3()
TestRunner.RunTestScript(string.Format("Test-ApplicationGatewayCRUD3 -baseDir '{0}'", AppDomain.CurrentDomain.BaseDirectory));
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.Owner, NrpTeamAlias.nvadev)]
public void TestKeyVaultIntegrationTest()
{
string environmentConnectionString = Environment.GetEnvironmentVariable("TEST_CSM_ORGID_AUTHENTICATION");
string servicePrincipal = "fakefakefake";
if (!string.IsNullOrEmpty(environmentConnectionString))
{
var connectionInfo = new ConnectionString(Environment.GetEnvironmentVariable("TEST_CSM_ORGID_AUTHENTICATION"));
var mode = connectionInfo.GetValue<string>(ConnectionStringKeys.HttpRecorderModeKey);
if (mode == HttpRecorderMode.Playback.ToString())
{
servicePrincipal = HttpMockServer.GetVariable("spn", "fake");
}
else
{
servicePrincipal = connectionInfo.GetValue<string>(ConnectionStringKeys.ServicePrincipalKey);
HttpMockServer.Variables["spn"] = servicePrincipal;
}
}
TestRunner.RunTestScript(string.Format("Test-KeyVaultIntegrationTest -baseDir '{0}' -spn '{1}'", AppDomain.CurrentDomain.BaseDirectory, servicePrincipal));
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.Owner, NrpTeamAlias.nvadev)]
Expand Down
Loading

0 comments on commit e12dcb6

Please sign in to comment.