Azure / Azure/azure-rest-api-specs

Compute gallery image delete return 409 error

Open
#11,559 8 comments 0 reactions 1 assignee Assigned to @snaheth View on GitHub
ARM Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

We have a compute image, a gallery, a gallery image, and a gallery image version resources. Then we start to delete them.

**1. Delete gallery image version:**
DELETE /subscriptions/.../resourceGroups/acctestRG-201105153850262730/providers/Microsoft.Compute/galleries/acctestsig201105153850262730/images/acctestimg201105153850262730/versions/1234567890.1234567890.1234567890?api-version=2019-12-01 HTTP/1.1

Response:
HTTP/2.0 202 Accepted
Azure-Asyncoperation: https://management.azure.com/subscriptions/.../providers/Microsoft.Compute/locations/westeurope/capsOperations/4bb6cded-9eca-4292-a330-4e5e7807ed7f?api-version=2019-12-01
Cache-Control: no-cache
**Date: Thu, 05 Nov 2020 08:24:49 GMT**
Expires: -1
Location: https://management.azure.com/subscriptions/.../providers/Microsoft.Compute/locations/westeurope/capsOperations/4bb6cded-9eca-4292-a330-4e5e7807ed7f?monitor=true&api-version=2019-12-01
Pragma: no-cache
Retry-After: 60
Server: Microsoft-HTTPAPI/2.0
Server: Microsoft-HTTPAPI/2.0
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: e359a466-e283-5cb0-2e87-907fdaaef911
X-Ms-Ratelimit-Remaining-Resource: Microsoft.Compute/DeleteGalleryImageVersion3Min;149,Microsoft.Compute/DeleteGalleryImageVersion30Min;999
X-Ms-Ratelimit-Remaining-Subscription-Deletes: 14997
X-Ms-Request-Id: 4bb6cded-9eca-4292-a330-4e5e7807ed7f
X-Ms-Routing-Request-Id: SOUTHEASTASIA:20201105T082449Z:11a2ec45-51ff-4cd2-8eb0-ff4003054c3d
X-Ms-Served-By: 64061c4a-8d7f-49b0-8597-01e5ba8fa233_132327983772912773,64061c4a-8d7f-49b0-8597-01e5ba8fa233_132327983772912773
Content-Length: 0

**2. Polling version delete succeed:**
GET /subscriptions/.../providers/Microsoft.Compute/locations/westeurope/capsOperations/4bb6cded-9eca-4292-a330-4e5e7807ed7f?api-version=2019-12-01 HTTP/1.1

Response:
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
**Date: Thu, 05 Nov 2020 08:26:50 GMT**
Expires: -1
Pragma: no-cache
Server: Microsoft-HTTPAPI/2.0
Server: Microsoft-HTTPAPI/2.0
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: e359a466-e283-5cb0-2e87-907fdaaef911
X-Ms-Ratelimit-Remaining-Resource: Microsoft.Compute/GetOperationStatus3Min;1196,Microsoft.Compute/GetOperationStatus30Min;4148
X-Ms-Ratelimit-Remaining-Subscription-Reads: 11957
X-Ms-Request-Id: 0fe8f426-92b9-4150-a8e3-41fd77c044e6
X-Ms-Routing-Request-Id: SOUTHEASTASIA:20201105T082650Z:2f2c6cca-0a9d-4c2e-b56c-cf507c58e0c2
X-Ms-Served-By: 64061c4a-8d7f-49b0-8597-01e5ba8fa233_132327983772912773,64061c4a-8d7f-49b0-8597-01e5ba8fa233_132327983772912773

{
"startTime": "2020-11-05T08:24:49.3573933+00:00",
"endTime": "2020-11-05T08:26:20.5457831+00:00",
"status": "Succeeded",
"name": "4bb6cded-9eca-4292-a330-4e5e7807ed7f"
}

**3. Delete gallery image:**
DELETE /subscriptions/.../resourceGroups/acctestRG-201105153850262730/providers/Microsoft.Compute/galleries/acctestsig201105153850262730/images/acctestimg201105153850262730?api-version=2019-12-01 HTTP/1.1

HTTP/2.0 409 Conflict
Content-Length: 114
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
**Date: Thu, 05 Nov 2020 08:26:52 GMT**
Expires: -1
Pragma: no-cache
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: e359a466-e283-5cb0-2e87-907fdaaef911
X-Ms-Failure-Cause: gateway
X-Ms-Request-Id: 633e7bc6-e2ab-4db1-bdb7-b3ceea965b1f
X-Ms-Routing-Request-Id: SOUTHEASTASIA:20201105T082652Z:633e7bc6-e2ab-4db1-bdb7-b3ceea965b1f

{"error":{"code":"CannotDeleteResource","message":"Can not delete resource before nested resources are deleted."}}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.