Remove-AzureDeployment

Deletes a deployment of a cloud service.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Important

Cloud Services (classic) is now deprecated for new customers and will be retired on August 31st, 2024 for all customers. New deployments should use the new Azure Resource Manager based deployment model Azure Cloud Services (extended support).

Syntax

Remove-AzureDeployment
      [-ServiceName] <String>
      [-Slot] <String>
      [-DeleteVHD]
      [-Force]
      [-Profile <AzureSMProfile>]
      [-InformationAction <ActionPreference>]
      [-InformationVariable <String>]
      [<CommonParameters>]

Description

The Remove-AzureDeployment cmdlet deletes a deployment of an Azure cloud service. To delete a deployment, first suspend it.

Examples

Example 1: Remove a deployment

PS C:\> Remove-AzureDeployment -ServiceName "ContosoService"

This command removes the deployment of the Azure service named ContosoService. Because this command does not specify a slot, it removes the service from the production environment.

Example 2: Remove a deployment and virtual hard disks

PS C:\> Remove-AzureDeployment -ServiceName "ContosoService" -DeleteVHD

This command removes the deployment of the service named ContosoService from the production environment. The command also removes the underlying virtual hard disks.

Parameters

-DeleteVHD

Specifies that this cmdlet removes the deployment and the virtual hard disks (VHDs) from blob storage.

Type:SwitchParameter
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

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

-ServiceName

Specifies the name of the service for which this cmdlet deletes a deployment.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Slot

Specifies the deployment environment from which this cmdlet deletes the deployment. Valid values are: Staging and Production. The default value is Production.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Outputs

ManagementOperationContext