Skip to content

Commit

Permalink
Merge pull request #1 from Azure/master
Browse files Browse the repository at this point in the history
Master merge
  • Loading branch information
sotaneja authored Jul 22, 2020
2 parents f31052f + 1c2ee74 commit 2f2afa0
Show file tree
Hide file tree
Showing 551 changed files with 13,378 additions and 12,903 deletions.
8 changes: 4 additions & 4 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageReference Update="Castle.Core" Version="4.4.0" />
<PackageReference Update="FluentAssertions" Version="5.10.3" />
<PackageReference Update="FsCheck.Xunit" Version="2.14.0" />
<PackageReference Update="Microsoft.Azure.Amqp" Version="2.4.4" />
<PackageReference Update="Microsoft.Azure.Amqp" Version="2.4.5" />
<PackageReference Update="Microsoft.Azure.Batch" Version="11.0.0" />
<PackageReference Update="Microsoft.Azure.Devices.Client" Version="[1.29.0-preview-004]" />
<PackageReference Update="Microsoft.Azure.Devices" Version="[1.27.0-preview-004]" />
Expand Down Expand Up @@ -60,8 +60,8 @@
<PackageReference Update="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.2" />
<PackageReference Update="Microsoft.CodeAnalysis" Version="2.3.0" />
<PackageReference Update="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="4.5.1" />
<PackageReference Update="Microsoft.Identity.Client" Version="4.10.0" />
<PackageReference Update="Microsoft.Identity.Client.Extensions.Msal" Version="2.8.0-preview" />
<PackageReference Update="Microsoft.Identity.Client" Version="4.16.1" />
<PackageReference Update="Microsoft.Identity.Client.Extensions.Msal" Version="2.12.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.1.0" />
<PackageReference Update="Microsoft.NETCore.Platforms" Version="2.2.1" />
<PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
Expand Down Expand Up @@ -129,7 +129,7 @@
<PackageReference Update="System.Text.Json" Version="4.6.0" />

<!-- Build time packages -->
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20200602.2" />
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20200721.2" />
<PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0" />
<PackageReference Update="Microsoft.DotNet.GenAPI" Version="5.0.0-beta.19552.1" />

Expand Down
6 changes: 3 additions & 3 deletions eng/mgmt/mgmtmetadata/compute_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\Azure-sdk\compute-2020-06\sdk
2020-07-01 17:17:32 UTC
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=E:\workdir\github\azure-sdk-for-net\sdk
2020-07-14 19:06:24 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: ab6b4d787190ceb777412ebf79bd57a8dccbec2c
Commit: 00ac1cbffba123ba5e30cb324935100495d0700d
AutoRest information
Requested version: v2
Bootstrapper version: [email protected]
6 changes: 3 additions & 3 deletions eng/mgmt/mgmtmetadata/maintenance_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/maintenance/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=E:\gautamd-ms\azure-sdk-for-net\sdk
2020-04-28 00:17:36 UTC
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/maintenance/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\NetSDK\azure-sdk-for-net\sdk
2020-07-20 19:00:33 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: de43e7fba7da1d2f2212c971d01f790a7afb1ba5
Commit: 99e5561c9cb7fc63ea693a1b6484a58ff8cd8d7e
AutoRest information
Requested version: v2
Bootstrapper version: [email protected]
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Installing AutoRest version: v2
Installing AutoRest version: v2
AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/recoveryservicesbackup/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\Users\prupadhy\Desktop\l\azure-sdk-for-net\sdk
2020-06-11 11:42:55 UTC
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/recoveryservicesbackup/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-07 --csharp-sdks-folder=C:\SwaggerSDK\azure-sdk-for-net\sdk
2020-07-19 16:53:12 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 92e846e0135bce5f13b37330562714ecb9eaa058
Commit: 24773c685796a5242117e316bbefef2755869bd3
AutoRest information
Requested version: v2
Bootstrapper version: [email protected]
4 changes: 2 additions & 2 deletions eng/mgmt/mgmtmetadata/sql_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=.
2020-07-10 15:20:01 UTC
2020-07-15 15:03:48 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 7d2e192d501af0c00e8a13eca5792ab02efcfede
Commit: c831a7922648941648d21cf8b71dd3038d2d9057
AutoRest information
Requested version: v2
Bootstrapper version: [email protected]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
Provides developers with libraries for the updated compute platform under Azure Resource manager to deploy virtual machine, virtual machine extensions and availability set management capabilities. Launch, restart, scale, capture and manage VMs, VM Extensions and more. Note: This client library is for Virtual Machines under Azure Resource Manager.
Development of this library has shifted focus to the Azure Unified SDK. The future development will be focused on "Azure.ResourceManager.Compute" (https://www.nuget.org/packages/Azure.ResourceManager.Compute/). Please see the package changelog for more information.
</Description>
<Version>38.0.0.0</Version>
<Version>38.1.0.0</Version>
<AssemblyName>Microsoft.Azure.Management.Compute</AssemblyName>
<PackageTags>management;virtual machine;compute;</PackageTags>
<PackageReleaseNotes>
<![CDATA[
This is a public release of the Azure Compute SDK. Included with this release are VM model change to add a property related to in-guest VM patching, adding Disallowed property to VirtualMachineImage, adding SecurityProfile for supporting the Host Encryption in VM/VMSS, adding RetrieveBootDiagnosticsData API for VM and VMSS, adding AccessPatches API, adding ExtensionsTimeBudget property to VM and VMSS, updating dedicated host group automatic placement, and adding EncryptionType to DiskEncryptionSetUpdateProperties.
This is a public release of the Azure Compute SDK. Included with this release is the vmHealth property added to the VMInstanceView API.
]]>
</PackageReleaseNotes>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
[assembly: AssemblyTitle("Microsoft Azure Compute Management Library")]
[assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Compute Resources.")]

[assembly: AssemblyVersion("38.0.0.0")]
[assembly: AssemblyFileVersion("38.0.0.0")]
[assembly: AssemblyVersion("38.1.0.0")]
[assembly: AssemblyFileVersion("38.1.0.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Microsoft Azure .NET SDK")]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.Azure.Management.Compute;
using Microsoft.Azure.Management.Compute.Models;
using Microsoft.Azure.Management.ResourceManager;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using Newtonsoft.Json.Linq;
using Xunit;

namespace Compute.Tests
{
public class VMHealthExtensionTests : VMTestBase
{
VirtualMachineExtension GetHealthVMExtension()
{
var vmExtension = new VirtualMachineExtension
{
Location = ComputeManagementTestUtilities.DefaultLocation,
Tags = new Dictionary<string, string>() { { "extensionTag1", "1" }, { "extensionTag2", "2" } },
Publisher = "Microsoft.ManagedServices",
VirtualMachineExtensionType = "ApplicationHealthWindows",
TypeHandlerVersion = "1.0",
AutoUpgradeMinorVersion = true,
ForceUpdateTag = "RerunExtension",
Settings = new JRaw("{ \"port\": 3389, \"protocol\": \"tcp\" }"),
ProtectedSettings = "{}"
};
typeof(Resource).GetRuntimeProperty("Name").SetValue(vmExtension, "vmext01");
typeof(Resource).GetRuntimeProperty("Type").SetValue(vmExtension, "Microsoft.Compute/virtualMachines/extensions");

return vmExtension;
}

[Fact]
public void TestVMHealthExtensionOperations()
{
using (MockContext context = MockContext.Start(this.GetType()))
{
EnsureClientsInitialized(context);

ImageReference imageRef = GetPlatformVMImage(useWindowsImage: true);
// Create resource group
var rgName = ComputeManagementTestUtilities.GenerateName(TestPrefix);
string storageAccountName = ComputeManagementTestUtilities.GenerateName(TestPrefix);
string asName = ComputeManagementTestUtilities.GenerateName("as");
VirtualMachine inputVM;
try
{
// Create VM with storage account
var storageAccountOutput = CreateStorageAccount(rgName, storageAccountName);
var vm = CreateVM(rgName, asName, storageAccountOutput, imageRef, out inputVM);

// Add an extension to the VM
var vmExtension = GetHealthVMExtension();
var response = m_CrpClient.VirtualMachineExtensions.CreateOrUpdate(rgName, vm.Name, vmExtension.Name, vmExtension);
ValidateVMExtension(vmExtension, response);

// Perform a Get operation on the extension
var getVMExtResponse = m_CrpClient.VirtualMachineExtensions.Get(rgName, vm.Name, vmExtension.Name);
ValidateVMExtension(vmExtension, getVMExtResponse);

// Validate Get InstanceView for the extension
var getVMExtInstanceViewResponse = m_CrpClient.VirtualMachineExtensions.Get(rgName, vm.Name, vmExtension.Name, "instanceView");
ValidateVMExtensionInstanceView(getVMExtInstanceViewResponse.InstanceView);

var getVMInstanceViewResponse = m_CrpClient.VirtualMachines.Get(rgName, vm.Name, InstanceViewTypes.InstanceView);
ValidateVMHealthStatusInstanceView(getVMInstanceViewResponse.InstanceView.VmHealth);

// Validate the extension delete API
m_CrpClient.VirtualMachineExtensions.Delete(rgName, vm.Name, vmExtension.Name);
}
finally
{
m_ResourcesClient.ResourceGroups.Delete(rgName);
}
}
}

private void ValidateVMExtension(VirtualMachineExtension vmExtExpected, VirtualMachineExtension vmExtReturned)
{
Assert.NotNull(vmExtReturned);
Assert.True(!string.IsNullOrEmpty(vmExtReturned.ProvisioningState));

Assert.True(vmExtExpected.Publisher == vmExtReturned.Publisher);
Assert.True(vmExtExpected.VirtualMachineExtensionType == vmExtReturned.VirtualMachineExtensionType);
Assert.True(vmExtExpected.AutoUpgradeMinorVersion == vmExtReturned.AutoUpgradeMinorVersion);
Assert.True(vmExtExpected.TypeHandlerVersion == vmExtReturned.TypeHandlerVersion);
}

private void ValidateVMExtensionInstanceView(VirtualMachineExtensionInstanceView vmExtInstanceView)
{
Assert.NotNull(vmExtInstanceView);
ValidateInstanceViewStatus(vmExtInstanceView.Statuses[0]);
}

private void ValidateVMHealthStatusInstanceView(VirtualMachineHealthStatus vmHealthStatus)
{
Assert.NotNull(vmHealthStatus);
ValidateInstanceViewStatus(vmHealthStatus.Status);
}

private void ValidateInstanceViewStatus(InstanceViewStatus instanceViewStatus)
{
Assert.NotNull(instanceViewStatus.DisplayStatus);
Assert.NotNull(instanceViewStatus.Code);
Assert.NotNull(instanceViewStatus.Level);
}
}
}
Loading

0 comments on commit 2f2afa0

Please sign in to comment.