Skip to content

Commit

Permalink
Get-AzVmSize deprecation (Azure#27109)
Browse files Browse the repository at this point in the history
  • Loading branch information
grizzlytheodore authored Mar 7, 2025
1 parent 2b6b156 commit bd36884
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
-->
## Upcoming Release
* Added breaking change message for `Get-AzVMSize`.

## Version 9.1.0
* Added new parameter `EncryptionIdentity` to cmdlet `Set-AzVmssDiskEncryptionExtension`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.Compute.Models;
using Microsoft.Rest.Azure;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System.Collections.Generic;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Compute
{
[GenericBreakingChangeWithVersion("The \"ListVirtualMachineSize\" parameter set will be deprecated as its API: \"Virtual Machine Sizes - List\" is deprecated. For listing available VM sizes by subscription or location, please use instead \"Get-AzComputeResourceSku\". Other parameter sets: \"List Available Sizes for Availability Set\" and \"List Available Sizes for Virtual Machine\" will continue to be supported.", "14.0.0", "10.0.0")]
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "VMSize", DefaultParameterSetName = ListVirtualMachineSizeParamSet)]
[OutputType(typeof(PSVirtualMachineSize))]
public class GetAzureVMSizeCommand : VirtualMachineSizeBaseCmdlet
Expand Down
6 changes: 6 additions & 0 deletions src/Compute/Compute/help/Get-AzVMSize.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ schema: 2.0.0
## SYNOPSIS
Gets available virtual machine sizes.

**Note**: The **List Virtual Machine Size** parameter set will be deprecated in the next major release (14.0.0) as its API: [Virtual Machine Sizes - List](https://learn.microsoft.com/en-us/rest/api/compute/virtual-machine-sizes/list) is deprecated. For listing available VM sizes by subscription or location, please use instead [Get-AzComputeResourceSku](https://learn.microsoft.com/en-us/powershell/module/az.compute/get-azcomputeresourcesku). Other parameter sets: "List Available Sizes for Availability Set" and "List Available Sizes for Virtual Machine" will continue to be supported.

## SYNTAX

### ListVirtualMachineSizeParamSet (Default)
Expand All @@ -34,6 +36,8 @@ Get-AzVMSize [-ResourceGroupName] <String> [-VMName] <String> [-DefaultProfile <
## DESCRIPTION
The **Get-AzVMSize** cmdlet gets available virtual machine sizes.

**Note**: The **List Virtual Machine Size** parameter set will be deprecated in the next major release (14.0.0) as its API: [Virtual Machine Sizes - List](https://learn.microsoft.com/en-us/rest/api/compute/virtual-machine-sizes/list) is deprecated. For listing available VM sizes by subscription or location, please use instead [Get-AzComputeResourceSku](https://learn.microsoft.com/en-us/powershell/module/az.compute/get-azcomputeresourcesku). Other parameter sets: "List Available Sizes for Availability Set" and "List Available Sizes for Virtual Machine" will continue to be supported.

## EXAMPLES

### Example 1: Get virtual machine sizes for a location
Expand All @@ -43,6 +47,8 @@ Get-AzVMSize -Location "Central US"

This command gets the available sizes for virtual machines in the specified location.

**Note**: This parameter set will be deprecated in the next major release.

### Example 2: Get sizes for an availability set
```powershell
Get-AzVMSize -ResourceGroupName "ResourceGroup03" -AvailabilitySetName "AvailabilitySet17"
Expand Down

0 comments on commit bd36884

Please sign in to comment.