- Disk RP to
2023-01-02
- Added new property class
DiskImageFileFormat
toGrantAccessData
class
- Added new property class
- Enable the model factory feature for model mocking, more information can be found here.
- Added new properties
ComputerName
,OSName
,OSVersion
andHyperVGeneration
toVirtualMachineScaleSetVmInstanceView
class - Added new value
StandardSsdLrs
toImageStorageAccountType
- Compute RP to
2023-03-01
(AvailabilitySets, VirtualMachines, VirtualMachineScaleSets, etc)- Added new method
Reapply
forVirtualMachineScaleSet
class. - Added new method
ListAvailabeSizes
forDedicatedHost
class. - Added new parameter
expand
forVirtualMachine
List methods. - Added new parameter
hibernate
forVirtualMachineScaleSet
deallocate methods. - Added new parameters
PriorityMixPolicy
andSpotRestorePolicy
forVirtualMachineScaleSet
update methods. - Added new property
BypassPlatformSafetyChecksOnUserSchedule
forVirtualMachine
class. - Added new property
SecurityPostureReference
toVirtualMachineScaleSet
class. - Added new properties
OutputBlobManagedIdentity
andErrorBlobManagedIdentity
toRunCommand
class. - Added new properties
RestorePointEncryption
,SourceDiskRestorePoint
,HyperVGeneration
andWriteAcceleratorEnabled
forRestorePoint
class.
- Added new method
- Class
VirtualMachineScaleSetNetworkConfiguration
andVirtualMachineScaleSetIPConfiguration
no longer have the propertyId
- Upgraded dependent
Azure.Core
to 1.32.0. - Upgraded dependent
Azure.ResourceManager
to 1.6.0.
Bumps the api-version
- Compute RP to
2022-11-01
(AvailabilitySets, VirtualMachines, VirtualMachineScaleSets, etc) - Disk RP to
2022-07-02
(ManagedDisks, Snapshots, etc) - Gallery RP to
2022-03-03
(Galleries, CommunityGalleries, etc) - CloudService RP to
2022-09-04
(CloudServices, etc)
- Upgraded dependent
Azure.Core
to1.28.0
. - Upgraded dependent
Azure.ResourceManager
to1.4.0
.
- Fixes a bug that exceptions are thrown during serialization when constructor
VirtualMachineScaleSetExtensionData(string name)
is called
This release is the first stable release of the Compute Management client library.
- Added Update methods in resource classes.
Polishing since last public beta release:
- Prepended
Compute
/VirtualMachine
prefix to all single / simple model names. - Corrected the format of all
Guid
type properties / parameters. - Corrected the format of all
ResourceIdentifier
type properties / parameters. - Corrected the format of all
ResouceType
type properties / parameters. - Corrected the format of all
ETag
type properties / parameters. - Corrected the format of all
AzureLocation
type properties / parameters. - Corrected the format of all binary type properties / parameters.
- Corrected all acronyms that not follow .Net Naming Guidelines.
- Corrected enumeration name by following Naming Enumerations Rule.
- Corrected the suffix of
DateTimeOffset
properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units.
- Optimized the name of some models and functions.
- Correct inherits
- Base type of
VirtualMachineScaleSetVmExtensionData
changed toAzure.ResourceManager.Models.ResourceData
. - Base type of
GalleryApplicationPatch
changed toAzure.ResourceManager.Models.ResourceData
. - Base type of
GalleryImagePatch
changed toAzure.ResourceManager.Models.ResourceData
. - Base type of
GalleryPatch
changed toAzure.ResourceManager.Models.ResourceData
. - Base type of
GalleryPatch
changed toAzure.ResourceManager.Models.ResourceData
. - Type
GalleryUpdateResourceData
was removed. - Base type of
VirtualMachineScaleSetExtensionPatch
changed toAzure.ResourceManager.Models.ResourceData
. - Base type of
VirtualMachineScaleSetVmExtensionPatch
changed toAzure.ResourceManager.Models.ResourceData
. - Type
ApiError
renamed toComputeApiError
. - Type
ApiErrorBase
renamed toComputeApiErrorBase
. - Type
DeleteOption
renamed toComputeDeleteOption
. - Type
UsageName
renamed toComputeUsageName
. - Type
UsageUnit
renamed toComputeUsageUnit
. - Type
UserArtifactManage
renamed toUserArtifactManagement
.
- Base type of
- Method
CloudServiceCollection.CreateOrUpdate
andCloudServiceCollection.CreateOrUpdateAsync
now required the parameterdata
.
- Upgraded dependent
Azure.ResourceManager
to 1.2.0 - Upgraded dependent
Azure.Core
to 1.25.0
- Rename plenty of classes and property names according to the architecture board's review.
- Updated API version of compute RP to
2022-03-01
. - Updated API version of disk RP to
2022-03-02
. - Updated API version of gallery RP to
2022-01-03
.
- Simplify
type
property names. - Normalized the body parameter type names for PUT / POST / PATCH operations if it is only used as input.
- Upgrade dependency to Azure.ResourceManager 1.0.0
- Now all the resource classes would have a
Resource
suffix (if it previously does not have one). - Renamed some models to more comprehensive names.
bool waitForCompletion
parameter in all long running operations were changed toWaitUntil waitUntil
.- Removed
GetIfExists
methods from all the resource classes. - All properties of the type
object
were changed toBinaryData
.
- waitForCompletion is now a required parameter and moved to the first parameter in LRO operations.
- Removed GetAllAsGenericResources in [Resource]Collections.
- Added Resource constructor to use ArmClient for ClientContext information and removed previous constructors with parameters.
- Couple of renamings.
- Added
CreateResourceIdentifier
for each resource class - Class
OSFamilyCollection
andOSVersionCollection
now implement theIEnumerable<T>
andIAsyncEnumerable<T>
- Class
VirtualMachineExtensionImageCollection
now implements theIEnumerable<T>
- Renamed
CheckIfExists
toExists
for each resource collection class - Renamed
Get{Resource}ByName
toGet{Resource}AsGenericResources
inSubscriptionExtensions
- Constructor of
OSFamilyCollection
,OSVersionCollection
no longer acceptlocation
as their first parameter - Constructor of
VirtualMachineExtensionImageCollection
no longer acceptslocation
andpublisher
as its first two parameters - Method
GetOSFamilies
andGetOSVersions
inSubscriptionExtensions
now accept an extra parameterlocation
- Method
GetVirtualMachineExtensionImages
inSubscriptionExtensions
now accepts two extra parameterslocation
andpublisher
- Fixed comments for
FirstPageFunc
of each pageable resource class
- Unified the identification rule of detecting resources, therefore some resources might become non-resources, and vice versa.
- Fixed problematic internal parameter invocation from the context
Id
property to the correspondingRestOperations
.
- Renamed [Resource]Container to [Resource]Collection and added the IEnumerable and IAsyncEnumerable interfaces to them making it easier to iterate over the list in the simple case.
- Added ArmClient extension methods to support start from the middle scenario.
This package follows the new Azure SDK guidelines, and provides many core capabilities:
- Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET.
- Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing.
- HTTP pipeline with custom policies.
- Better error-handling.
- Support uniform telemetry across all languages.
This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our Azure SDK for .NET GitHub repo.
NOTE: For more information about unified authentication, please refer to Microsoft Azure Identity documentation for .NET.
The package name has been changed from Microsoft.Azure.Management.Compute
to Azure.ResourceManager.Compute
New design of track 2 initial commit.
Example: Create a VM:
Before upgrade:
You need the following using statements:
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Azure.Management.Compute;
using Microsoft.Azure.Management.Compute.Models;
using Microsoft.Azure.Management.Network;
using Microsoft.Azure.Management.Network.Models;
using Microsoft.Azure.Management.ResourceManager;
using Microsoft.Azure.Management.ResourceManager.Fluent;
using Microsoft.Azure.Management.ResourceManager.Models;
using IPVersion = Microsoft.Azure.Management.Network.Models.IPVersion;
using ResourceManagementClient = Microsoft.Azure.Management.ResourceManager.ResourceManagementClient;
using Sku = Microsoft.Azure.Management.Compute.Models.Sku;
using SubResource = Microsoft.Azure.Management.Compute.Models.SubResource;
The code looks like:
var credentials = new TokenCredentials("YOUR ACCESS TOKEN");;
var resourceClient = new ResourceManagementClient(credentials);
var networkClient = new NetworkManagementClient(credentials);
var computeClient = new ComputeManagementClient(credentials);
resourceClient.SubscriptionId = subscriptionId;
networkClient.SubscriptionId = subscriptionId;
computeClient.SubscriptionId = subscriptionId;
var location = "westus";
// Create Resource Group
await resourceClient.ResourceGroups.CreateOrUpdateAsync(resourceGroupName, new ResourceGroup(location));
// Create Availability Set
var availabilitySet = new AvailabilitySet(location)
{
PlatformUpdateDomainCount = 5,
PlatformFaultDomainCount = 2,
Sku = new Sku("Aligned"),
};
availabilitySet = await computeClient.AvailabilitySets
.CreateOrUpdateAsync(resourceGroupName, vmName + "_aSet", availabilitySet);
// Create IP Address
var ipAddress = new PublicIPAddress()
{
PublicIPAddressVersion = IPVersion.IPv4,
PublicIPAllocationMethod = IPAllocationMethod.Dynamic,
Location = location,
};
ipAddress = await networkClient
.PublicIPAddresses.BeginCreateOrUpdateAsync(resourceGroupName, vmName + "_ip", ipAddress);
// Create VNet
var vnet = new VirtualNetwork()
{
Location = location,
AddressSpace = new AddressSpace() { AddressPrefixes = new List<string>() { "10.0.0.0/16" } },
Subnets = new List<Subnet>()
{
new Subnet()
{
Name = "mySubnet",
AddressPrefix = "10.0.0.0/24",
}
},
};
vnet = await networkClient.VirtualNetworks
.BeginCreateOrUpdateAsync(resourceGroupName, vmName + "_vent", vnet);
// Create Network interface
var nic = new NetworkInterface()
{
Location = location,
IpConfigurations = new List<NetworkInterfaceIPConfiguration>()
{
new NetworkInterfaceIPConfiguration()
{
Name = "Primary",
Primary = true,
Subnet = new Subnet() { Id = vnet.Subnets.First().Id },
PrivateIPAllocationMethod = IPAllocationMethod.Dynamic,
PublicIPAddress = new PublicIPAddress() { Id = ipAddress.Id }
}
}
};
nic = await networkClient.NetworkInterfaces
.BeginCreateOrUpdateAsync(resourceGroupName, vmName + "_nic", nic);
var vm = new VirtualMachine(location)
{
NetworkProfile = new NetworkProfile { NetworkInterfaces = new[] { new NetworkInterfaceReference() { Id = nic.Id } } },
AvailabilitySet = new SubResource { Id = availabilitySet.Id },
OsProfile = new OSProfile
{
ComputerName = "testVM",
AdminUsername = "azureUser",
AdminPassword = "azure12345QWE!",
LinuxConfiguration = new LinuxConfiguration { DisablePasswordAuthentication = false, ProvisionVMAgent = true }
},
StorageProfile = new StorageProfile()
{
ImageReference = new ImageReference()
{
Offer = "UbuntuServer",
Publisher = "Canonical",
Sku = "18.04-LTS",
Version = "latest"
},
DataDisks = new List<DataDisk>()
},
HardwareProfile = new HardwareProfile() { VmSize = VirtualMachineSizeTypes.StandardB1ms },
};
await computeClient.VirtualMachines.BeginCreateOrUpdateAsync(resourceGroupName, vmName, vm);
After upgrade:
You need the following using statements:
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Network;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.Core;
using System;
using System.Linq;
The code looks like:
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
AzureLocation location = AzureLocation.WestUS;
// Create ResourceGroupResource
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
ArmOperation<ResourceGroupResource> rgOperation = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, "myResourceGroup", new ResourceGroupData(location));
ResourceGroupResource resourceGroup = rgOperation.Value;
// Create AvailabilitySet
AvailabilitySetData availabilitySetData = new AvailabilitySetData(location)
{
PlatformUpdateDomainCount = 5,
PlatformFaultDomainCount = 2,
Sku = new ComputeSku() { Name = "Aligned" }
};
ArmOperation<AvailabilitySetResource> asetOperation = await resourceGroup.GetAvailabilitySets().CreateOrUpdateAsync(WaitUntil.Completed, "myAvailabilitySet", availabilitySetData);
AvailabilitySetResource availabilitySet = asetOperation.Value;
// Create VNet
VirtualNetworkData vnetData = new VirtualNetworkData()
{
Location = location,
Subnets =
{
new SubnetData()
{
Name = "mySubnet",
AddressPrefix = "10.0.0.0/24",
}
},
AddressPrefixes =
{
"10.0.0.0/16"
}
};
ArmOperation<VirtualNetworkResource> vnetOperation = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(WaitUntil.Completed, "myVirtualNetwork", vnetData);
VirtualNetworkResource vnet = vnetOperation.Value;
// Create Network interface
NetworkInterfaceData nicData = new NetworkInterfaceData()
{
Location = location,
IPConfigurations =
{
new NetworkInterfaceIPConfigurationData()
{
Name = "Primary",
Primary = true,
Subnet = new SubnetData() { Id = vnet.Data.Subnets.First().Id },
PrivateIPAllocationMethod = NetworkIPAllocationMethod.Dynamic,
}
}
};
ArmOperation<NetworkInterfaceResource> nicOperation = await resourceGroup.GetNetworkInterfaces().CreateOrUpdateAsync(WaitUntil.Completed, "myNetworkInterface", nicData);
NetworkInterfaceResource nic = nicOperation.Value;
VirtualMachineData vmData = new VirtualMachineData(location)
{
AvailabilitySet = new WritableSubResource() { Id = availabilitySet.Id },
NetworkProfile = new VirtualMachineNetworkProfile
{
NetworkInterfaces = { new VirtualMachineNetworkInterfaceReference() { Id = nic.Id } }
},
OSProfile = new VirtualMachineOSProfile()
{
ComputerName = "testVM",
AdminUsername = "username",
AdminPassword = "(YourPassword)",
LinuxConfiguration = new LinuxConfiguration { DisablePasswordAuthentication = false, ProvisionVmAgent = true }
},
StorageProfile = new VirtualMachineStorageProfile()
{
ImageReference = new ImageReference()
{
Offer = "UbuntuServer",
Publisher = "Canonical",
Sku = "18.04-LTS",
Version = "latest"
}
},
HardwareProfile = new VirtualMachineHardwareProfile() { VmSize = VirtualMachineSizeType.StandardB1Ms },
};
ArmOperation<VirtualMachineResource> vmOperation = await resourceGroup.GetVirtualMachines().CreateOrUpdateAsync(WaitUntil.Completed, "myVirtualMachine", vmData);
VirtualMachineResource vm = vmOperation.Value;
Example: Create a Virtual Machine Extension
Before upgrade:
var vmExtension = new VirtualMachineExtension
{
Location = "westus",
Tags = new Dictionary<string, string>() { { "extensionTag1", "1" }, { "extensionTag2", "2" } },
Publisher = "Microsoft.Compute",
VirtualMachineExtensionType = "VMAccessAgent",
TypeHandlerVersion = "2.0",
AutoUpgradeMinorVersion = true,
ForceUpdateTag = "RerunExtension",
Settings = "{}",
ProtectedSettings = "{}"
};
typeof(Resource).GetRuntimeProperty("Name").SetValue(vmExtension, "vmext01");
typeof(Resource).GetRuntimeProperty("Type").SetValue(vmExtension, "Microsoft.Compute/virtualMachines/extensions");
After upgrade:
var vmExtension = new VirtualMachineExtensionData(AzureLocation.WestUS)
{
Tags = { { "extensionTag1", "1" }, { "extensionTag2", "2" } },
Publisher = "Microsoft.Compute",
ExtensionType = "VMAccessAgent",
TypeHandlerVersion = "2.0",
AutoUpgradeMinorVersion = true,
ForceUpdateTag = "RerunExtension",
Settings = BinaryData.FromObjectAsJson(new { }),
ProtectedSettings = BinaryData.FromObjectAsJson(new { })
};