Edit

Share via


Set-AzVMChefExtension

Adds a Chef extension to a virtual machine.

Syntax

Linux

Set-AzVMChefExtension
    [-ResourceGroupName] <String>
    [-VMName] <String>
    [[-TypeHandlerVersion] <String>]
    [[-Location] <String>]
    [[-Name] <String>]
    [[-AutoUpgradeMinorVersion] <Boolean>]
    -ValidationPem <String>
    [-ClientRb <String>]
    [-BootstrapOptions <String>]
    [-JsonAttribute <String>]
    [-ChefDaemonInterval <String>]
    [-Daemon <String>]
    [-Secret <String>]
    [-SecretFile <String>]
    [-RunList <String>]
    [-ChefServerUrl <String>]
    [-ValidationClientName <String>]
    [-OrganizationName <String>]
    [-BootstrapVersion <String>]
    [-Linux]
    [-NoWait]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Windows

Set-AzVMChefExtension
    [-ResourceGroupName] <String>
    [-VMName] <String>
    [[-TypeHandlerVersion] <String>]
    [[-Location] <String>]
    [[-Name] <String>]
    [[-AutoUpgradeMinorVersion] <Boolean>]
    -ValidationPem <String>
    [-ClientRb <String>]
    [-BootstrapOptions <String>]
    [-JsonAttribute <String>]
    [-ChefDaemonInterval <String>]
    [-Daemon <String>]
    [-Secret <String>]
    [-SecretFile <String>]
    [-RunList <String>]
    [-ChefServerUrl <String>]
    [-ValidationClientName <String>]
    [-OrganizationName <String>]
    [-BootstrapVersion <String>]
    [-Windows]
    [-NoWait]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-AzVMChefExtension cmdlet adds the Chef extension to the virtual machine.

Examples

Example 1: Add a Chef extension to a Windows virtual machine

Set-AzVMChefExtension -ResourceGroupName "ResourceGroup001" -VMName "WindowsVM001" -ValidationPem "C:\my-org-validator.pem" -ClientRb "C:\client.rb" -RunList "Apache" -Daemon "service" -SecretFile "C:\my_encrypted_data_bag_secret" -Windows

This command adds a Chef extension to a Windows virtual machine named WindowsVM001. When the virtual machine starts, Chef bootstraps the virtual machine to run Apache.

Example 2: Add a Chef extension to a Linux virtual machine

Set-AzVMChefExtension -ResourceGroupName "ResourceGroup002" -VMName "LinuxVM001" -ValidationPem "C:\my-org-validator.pem" -ClientRb "C:\client.rb" -RunList "Apache" -Secret "my_secret" -Linux

This command adds a Chef extension to a Linux virtual machine named LinuxVM001. When the virtual machine starts, Chef bootstraps the virtual machine to run Apache.

Example 3: Add a Chef extension to a Windows virtual machine with bootstrap options

Set-AzVMChefExtension -ResourceGroupName "ResourceGroup003" -VMName "WindowsVM002" -ValidationPem C:\my-org-validator.pem -ClientRb C:\client.rb -BootstrapOptions '{"chef_node_name":"your_node_name","chef_server_url":"https://api.opscode.com/organizations/some-org", "validation_client_name":"some-org-validator"}' -RunList "Apache" -Windows

This command adds the Chef extension to a Windows virtual machine named WindowsVM002. When the virtual machine starts, Chef bootstraps the virtual machine to run Apache. After bootstrapping, the virtual machine refers to the BootstrapOptions specified in JSON format.

Parameters

-AutoUpgradeMinorVersion

The Set-AzVMChefExtension cmdlet adds the Chef extension to the virtual machine.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:10
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-BootstrapOptions

Specifies configuration settings in the client_rb option.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-BootstrapVersion

Specifies the version of the bootstrap configuration.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ChefDaemonInterval

Specifies the frequency (in minutes) at which the chef-service runs. If in case you don't want the chef-service to be installed on the Azure VM then set value as 0 in this field.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ChefServiceInterval

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ChefServerUrl

Specifies the Chef server link, as a URL.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ClientRb

Specifies the full path of the Chef client.rb.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Daemon

Configures the chef-client service for unattended execution. The node platform should be Windows. Allowed options: 'none','service' and 'task'. none - Currently prevents the chef-client service from being configured as a service. service - Configures the chef-client to run automatically in the background as a service. task - Configures the chef-client to run automatically in the background as a scheduled task.

Parameter properties

Type:String
Default value:None
Accepted values:none, service, task
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JsonAttribute

A JSON string to be added to the first run of chef-client. e.g. -JsonAttribute '{"foo" : "bar"}'

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Linux

Indicates that this cmdlet creates a Windows virtual machine.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Linux
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Location

Specifies the location of the virtual machine.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:7
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Specifies the name of the Chef extension.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ExtensionName

Parameter sets

(All)
Position:8
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-NoWait

Starts the operation and returns immediately, before the operation is completed. In order to determine if the operation has successfully been completed, use some other mechanism.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OrganizationName

Specifies the organization name of the Chef extension.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceGroupName

Specifies the name of the resource group that contains the virtual machine.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-RunList

Specifies the Chef node run list.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Secret

The encryption key used to encrypt and decrypt the data bag item values.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SecretFile

The path to the file that contains the encryption key used to encrypt and decrypt the data bag item values.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TypeHandlerVersion

Specifies the version of the extension to use for this virtual machine.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:HandlerVersion, Version

Parameter sets

(All)
Position:9
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ValidationClientName

The Set-AzVMChefExtension cmdlet adds the Chef extension to the virtual machine.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ValidationPem

Specifies the Chef validator .pem file path

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-VMName

Specifies the name of a virtual machine. This cmdlet adds the Chef extension for the virtual machine that this parameter specifies.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ResourceName

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Windows

Indicates that this cmdlet creates a Windows virtual machine.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Windows
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

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

Inputs

String

Boolean

Outputs

PSAzureOperationResponse