Share via


Virtual Machines - Delete

Åtgärden för att ta bort en virtuell dator.

DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}?api-version=2024-03-01
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}?forceDeletion={forceDeletion}&api-version=2024-03-01

URI-parametrar

Name I Obligatorisk Typ Description
resourceGroupName
path True

string

Namnet på resursgruppen.

subscriptionId
path True

string

Prenumerationsautentiseringsuppgifter som unikt identifierar Microsoft Azure-prenumeration. Prenumerations-ID:t utgör en del av URI:n för varje tjänstanrop.

vmName
path True

string

Namnet på den virtuella datorn.

api-version
query True

string

Klient-API-version.

forceDeletion
query

boolean

Valfri parameter för att framtvinga borttagning av virtuella datorer.

Svar

Name Typ Description
200 OK

OK

202 Accepted

Har godkänts

204 No Content

Inget innehåll

Other Status Codes

CloudError

Felsvar som beskriver varför åtgärden misslyckades.

Säkerhet

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation personifiera ditt användarkonto

Exempel

Force delete a VM

Sample Request

DELETE https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?forceDeletion=true&api-version=2024-03-01

Sample Response

Location: https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/westus/operations/{operationId}&monitor=true&api-version=2024-03-01

Definitioner

Name Description
ApiError

API-fel.

ApiErrorBase

Api-felbas.

CloudError

Ett felsvar från Beräkningstjänsten.

InnerError

Inre felinformation.

ApiError

API-fel.

Name Typ Description
code

string

Felkoden.

details

ApiErrorBase[]

Api-felinformationen

innererror

InnerError

Api:ets inre fel

message

string

Felmeddelandet.

target

string

Målet för det specifika felet.

ApiErrorBase

Api-felbas.

Name Typ Description
code

string

Felkoden.

message

string

Felmeddelandet.

target

string

Målet för det specifika felet.

CloudError

Ett felsvar från Beräkningstjänsten.

Name Typ Description
error

ApiError

API-fel.

InnerError

Inre felinformation.

Name Typ Description
errordetail

string

Det interna felmeddelandet eller undantagsdumpen.

exceptiontype

string

Undantagstypen.