Azure / Azure/azure-rest-api-specs

[Network Function] Traffic Collector DELETE API is broken

Open
#25,152 0 comments 0 reactions 0 assignees View on GitHub
Network Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 37m
Merged PRs (30d)
446

Description

## Swagger Link

https://github.com/Azure/azure-rest-api-specs/blob/d247207c59848d06facf8a7b4f884e356205c15c/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/AzureTrafficCollector.json#L500

## Problem Description

When attempting to delete a Traffic Collector instance and Collector Policy instance via Azure API, the flow failed as illustrated below.

First, delete the Collector Policy instance as below:

```
DELETE https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctest-rg-230729201336796314/providers/Microsoft.NetworkFunction/azureTrafficCollectors/acctest-nfatc-230729201336796314/collectorPolicies/acctest-nfcp-230729201336796314?api-version=2022-11-01
```

which returns a Long Running Request as shown below:

`HTTP/2.0 202 Accepted`

Then send several GET request to get Status:

```
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctest-rg-230729201336796314/providers/Microsoft.NetworkFunction/azureTrafficCollectors/acctest-nfatc-230729201336796314/collectorPolicies/acctest-nfcp-230729201336796314?api-version=2022-11-01
```

which eventually returns `Not Found`(which should mean that the Collector Policy instance has been deleted):

`HTTP/2.0 404 Not Found`

At this time - it should be possible to delete the Traffic Collector instance (as its Collector Policy has already been deleted). Attempting to do so:

```
DELETE https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctest-rg-230729201336796314/providers/Microsoft.NetworkFunction/azureTrafficCollectors/acctest-nfatc-230729201336796314?api-version=2022-11-01
```

which failed with:

```
HTTP/2.0 409 Conflict
{
"error": {
"code": "CannotDeleteResource",
"message": "Cannot delete resource while nested resources exist. Some existing nested resource IDs include: 'Microsoft.NetworkFunction/azureTrafficCollectors/acctest-nfatc-230729201336796314/collectorPolicies/acctest-nfcp-230729201336796314'. Please delete all nested resources before deleting this resource."
}
}
```

It looks like the same issue as https://github.com/Azure/azure-rest-api-specs/issues/18572.
The correlationId is:

`X-Ms-Correlation-Request-Id: bd13eb95-342d-18a4-60dc-6945dbd58fba`

Kindly help confirm this bug.
Thanks.

Contributor guide

Open the contributing guide

Research direction

Start with the Swagger definition in specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/AzureTrafficCollector.json around line 500 and compare the reported behavior with issue 18572. Reproduce the Collector Policy DELETE, polling GET, and Traffic Collector DELETE sequence; done means confirming the service behavior and identifying an actionable API-spec change or resolution.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.