리소스 그룹을 삭제합니다.
리소스 그룹을 삭제하면 모든 리소스도 삭제됩니다. 리소스 그룹을 삭제하면 모든 템플릿 배포 및 현재 저장된 작업이 삭제됩니다.
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}?api-version=2021-04-01
선택적 매개 변수:
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}?forceDeletionTypes={forceDeletionTypes}&api-version=2021-04-01
URI 매개 변수
Name |
In(다음 안에) |
필수 |
형식 |
Description |
resourceGroupName
|
path |
True
|
string
|
삭제할 리소스 그룹의 이름입니다. 이름은 대소문자를 구분하지 않습니다.
regex 패턴: ^[-\w\._\(\)]+$
|
subscriptionId
|
path |
True
|
string
|
Microsoft Azure 구독 ID입니다.
|
api-version
|
query |
True
|
string
|
이 작업에 사용할 API 버전입니다.
|
forceDeletionTypes
|
query |
|
string
|
강제로 삭제하려는 리소스 종류입니다. 현재 forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets만 지원됩니다.
|
응답
Name |
형식 |
Description |
200 OK
|
|
정상
|
202 Accepted
|
|
수락됨
|
Other Status Codes
|
CloudError
|
작업이 실패한 이유를 설명하는 오류 응답입니다.
|
보안
azure_auth
Azure Active Directory OAuth2 Flow
형식:
oauth2
Flow:
implicit
권한 부여 URL:
https://login.microsoftonline.com/common/oauth2/authorize
범위
Name |
Description |
user_impersonation
|
사용자 계정 가장
|
예제
Force delete all the Virtual Machines and Virtual Machine Scale Sets in a resource group
샘플 요청
DELETE https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group?forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets&api-version=2021-04-01
package armresources_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json
func ExampleResourceGroupsClient_BeginDelete_forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armresources.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewResourceGroupsClient().BeginDelete(ctx, "my-resource-group", &armresources.ResourceGroupsClientBeginDeleteOptions{ForceDeletionTypes: to.Ptr("Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets")})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ResourceManagementClient } = require("@azure/arm-resources");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json
*/
async function forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup() {
const subscriptionId =
process.env["RESOURCES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["RESOURCES_RESOURCE_GROUP"] || "my-resource-group";
const forceDeletionTypes =
"Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets";
const options = { forceDeletionTypes };
const credential = new DefaultAzureCredential();
const client = new ResourceManagementClient(credential, subscriptionId);
const result = await client.resourceGroups.beginDeleteAndWait(resourceGroupName, options);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Force delete all the Virtual Machines in a resource group
샘플 요청
DELETE https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group?forceDeletionTypes=Microsoft.Compute/virtualMachines&api-version=2021-04-01
package armresources_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsInResourceGroup.json
func ExampleResourceGroupsClient_BeginDelete_forceDeleteAllTheVirtualMachinesInAResourceGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armresources.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewResourceGroupsClient().BeginDelete(ctx, "my-resource-group", &armresources.ResourceGroupsClientBeginDeleteOptions{ForceDeletionTypes: to.Ptr("Microsoft.Compute/virtualMachines")})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ResourceManagementClient } = require("@azure/arm-resources");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsInResourceGroup.json
*/
async function forceDeleteAllTheVirtualMachinesInAResourceGroup() {
const subscriptionId =
process.env["RESOURCES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["RESOURCES_RESOURCE_GROUP"] || "my-resource-group";
const forceDeletionTypes = "Microsoft.Compute/virtualMachines";
const options = { forceDeletionTypes };
const credential = new DefaultAzureCredential();
const client = new ResourceManagementClient(credential, subscriptionId);
const result = await client.resourceGroups.beginDeleteAndWait(resourceGroupName, options);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
정의
CloudError
리소스 관리 요청에 대한 오류 응답입니다.
Name |
형식 |
Description |
error
|
ErrorResponse
|
오류 응답
실패한 작업에 대한 오류 세부 정보를 반환하는 모든 Azure Resource Manager API에 대한 일반적인 오류 응답입니다. OData 오류 응답 형식도 따릅니다.
|
ErrorAdditionalInfo
리소스 관리 오류 추가 정보입니다.
Name |
형식 |
Description |
info
|
object
|
추가 정보입니다.
|
type
|
string
|
추가 정보 유형입니다.
|
ErrorResponse
오류 응답
Name |
형식 |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
오류 추가 정보입니다.
|
code
|
string
|
오류 코드입니다.
|
details
|
ErrorResponse[]
|
오류 세부 정보입니다.
|
message
|
string
|
오류 메시지입니다.
|
target
|
string
|
오류 대상입니다.
|