Skip to content

Latest commit

 

History

History
161 lines (122 loc) · 4.11 KB

Set-AzVMPlan.md

File metadata and controls

161 lines (122 loc) · 4.11 KB
external help file Module Name ms.assetid online version schema
Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml
Az.Compute
A1EA7D34-A8B4-4FA0-BD8C-3E846715AFBA
2.0.0

Set-AzVMPlan

SYNOPSIS

Sets the Marketplace plan information on a virtual machine.

SYNTAX

Set-AzVMPlan [-VM] <PSVirtualMachine> [-Name] <String> [[-Product] <String>] [[-PromotionCode] <String>]
 [[-Publisher] <String>] [-DefaultProfile <IAzureContextContainer>]
 [<CommonParameters>]

DESCRIPTION

The Set-AzVMPlan cmdlet sets the Azure Marketplace plan information for a virtual machine. Before being able to deploy a Marketplace image through the command-line, programmatic access must be enabled or the virtual machine must be deployed by using the Azure portal.

EXAMPLES

Example 1

New-AzVMConfig -VMName "VirtualMachine07" -VMSize "Standard_B1s" |
    Set-AzVMPlan -Publisher "Canonical" -Product "UbuntuServer" -Name "18.04-LTS"
Name            : VirtualMachine07
HardwareProfile : {VmSize}
Plan            : {Name, Publisher, Product}

PARAMETERS

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Name

Specifies the name of the image from the Marketplace. This is the same value that is returned by the Get-AzVMImageSku cmdlet. For more information about how to find image information, see Find and use Azure Marketplace VM images with Azure PowerShell in the Microsoft Azure documentation.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Product

Specifies the product of the image from the Marketplace. This is the same information as the Offer value of the imageReference element.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-PromotionCode

Specifies a promotion code.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Publisher

Specifies the publisher of the image. You can find this information by using the Get-AzVMImagePublisher cmdlet.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-VM

Specifies the virtual machine object for which to set a Marketplace plan. You can use the Get-AzVM cmdlet to obtain a virtual machine object. You can use the New-AzVMConfig cmdlet to create a virtual machine object.

Type: Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine
Parameter Sets: (All)
Aliases: VMProfile

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine

System.String

OUTPUTS

Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine

NOTES

RELATED LINKS

Get-AzVM

Get-AzVMImagePublisher

Get-AzVMImageSku

New-AzVMConfig