Skip to content

Latest commit

 

History

History
239 lines (180 loc) · 7.35 KB

Set-AzureRMVMSqlServerExtension.md

File metadata and controls

239 lines (180 loc) · 7.35 KB
external help file Module Name ms.assetid online version schema
Microsoft.Azure.Commands.Compute.dll-Help.xml
AzureRM.Compute
C650E465-7CDE-47F8-B85A-8FA3E1756FAF
2.0.0

Set-AzureRmVMSqlServerExtension

SYNOPSIS

Sets the Azure SQL Server extension on a virtual machine.

SYNTAX

Set-AzureRmVMSqlServerExtension [[-Version] <String>] [-ResourceGroupName] <String> [-VMName] <String>
 [[-Name] <String>] [[-AutoPatchingSettings] <AutoPatchingSettings>]
 [[-AutoBackupSettings] <AutoBackupSettings>] [[-KeyVaultCredentialSettings] <KeyVaultCredentialSettings>]
 [[-Location] <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]

DESCRIPTION

The Set-AzureRmVMSqlServerExtension cmdlet sets the AzureSQL Server extension on a virtual machine.

EXAMPLES

Example 1: Set automatic patching settings on a virtual machine

PS C:\> $AutoPatchingConfig = New-AzureVMSqlServerAutoPatchingConfig -Enable -DayOfWeek "Thursday" -MaintenanceWindowStartingHour 11 -MaintenanceWindowDuration 120 -PatchCategory "Important"
PS C:\> Get-AzureRmVM -ServiceName "Service02" -Name "VirtualMachine11" | Set-AzureRmVMSqlServerExtension -AutoPatchingSettings $AutoPatchingConfig | Update-AzureRmVM

The first command creates a configuration object by using the New-AzureVMSqlServerAutoPatchingConfig cmdlet. The command stores the configuration in the $AutoPatchingConfig variable. The second command gets the virtual machine named VirtualMachine11 on the service named Service02 by using the Get-AzureRmVM cmdlet. The command passes that object to the current cmdlet by using the pipeline operator. The current cmdlet sets the automatic patching settings in $AutoPatchingConfig for the virtual machine. The command passes the virtual machine to the Update-AzureRmVM cmdlet.

Example 2: Set automatic backup settings on a virtual machine

PS C:\> $AutoBackupConfig = New-AzureVMSqlServerAutoBackupConfig -Enable -RetentionPeriod 10 -StorageUri $StorageUrl -StorageKey $StorageAccountKeySecure
PS C:\> Get-AzureRmVM -ServiceName "Service02" -Name "VirtualMachine11" | Set-AzureRmVMSqlServerExtension -AutoBackupSettings $AutoBackupConfig | Update-AzureRmVM

The first command creates a configuration object by using the New-AzureVMSqlServerAutoBackupConfig cmdlet. The command stores the configuration in the $AutoBackupConfig variable. The second command gets the virtual machine named VirtualMachine11 on the service named Service02, and then passes it to the current cmdlet. The current cmdlet sets the automatic backup settings in $AutoBackupConfig for the virtual machine. The command passes the virtual machine to the Update-AzureRmVM cmdlet.

Example 3: Disable a SQL Server extension on a virtual machine

PS C:\> Get-AzureRmVM -ServiceName "Service03" -Name "VirtualMachine08" | Set-AzureRmVMSqlServerExtension -Disable

This command gets a virtual machine named VirtualMachine08 on Service03, and then passes it to the current cmdlet. The command disables SQL Server virtual machine extension on that virtual machine.

Example 4: Uninstall a SQL Server extension on a specific virtual machine

PS C:\> Get-AzureRmVM -ServiceName "Service03" -Name "VirtualMachine08" | Set-AzureRmVMSqlServerExtension -Uninstall

This command gets a virtual machine named VirtualMachine08 on Service03, and then passes it to the current cmdlet. The command uninstalls a SQL Server virtual machine extension on that virtual machine.

PARAMETERS

-AutoBackupSettings

Specifies the automatic SQL Server backup settings. To create an AutoBackupSettings object , use the New-AzureVMSqlServerAutoBackupConfig cmdlet.

Type: Microsoft.Azure.Commands.Compute.AutoBackupSettings
Parameter Sets: (All)
Aliases:

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

-AutoPatchingSettings

Specifies the automatic SQL Server patching settings. To create an AutoPatchingSettings object , use the New-AzureVMSqlServerAutoPatchingConfig cmdlet.

Type: Microsoft.Azure.Commands.Compute.AutoPatchingSettings
Parameter Sets: (All)
Aliases:

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

-DefaultProfile

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

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

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

-KeyVaultCredentialSettings

Type: Microsoft.Azure.Commands.Compute.KeyVaultCredentialSettings
Parameter Sets: (All)
Aliases:

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

-Location

Specifies the location of the virtual machine.

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

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

-Name

Specifies the name of the SQL Server the extension.

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

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

-ResourceGroupName

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

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

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

-Version

Specifies the version of the SQL Server extension.

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

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

-VMName

Specifies the name of the virtual machine on which this cmdlet sets the SQL Server extension.

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

Required: True
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
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 (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

System.String

Microsoft.Azure.Commands.Compute.AutoPatchingSettings

Microsoft.Azure.Commands.Compute.AutoBackupSettings

Microsoft.Azure.Commands.Compute.KeyVaultCredentialSettings

OUTPUTS

Microsoft.Azure.Commands.Compute.Models.PSAzureOperationResponse

NOTES

RELATED LINKS

Get-AzureRmVM

Get-AzureRmVMSqlServerExtension

New-AzureVMSqlServerAutoPatchingConfig

New-AzureVMSqlServerAutoBackupConfig

Remove-AzureRmVMSqlServerExtension

Update-AzureRmVM