Skip to content

Allow to delete NSG Flow if subnet has been deletedΒ #31506

@VincentVerkr

Description

@VincentVerkr

Describe the bug

If a subnet is deleted and an NSG flow log is linked to it, the flow log cannot be deleted.

Whether via the Azure portal or the Azure CLI

I've tried deleting only the flow log, only the region watcher, deleting the resource group. Nothing works.

Related command

az network watcher flow-log delete --name xxxxxxx --location xxxxxx

Errors

(SubnetNotFoundForFlowLog) Subnet resource /subscriptions/xxxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Network/VirtualNetworks/xxxxxxx/subnets/xxxxxxx passed for the flow log does not exist.
Code: SubnetNotFoundForFlowLog

Message: Subnet resource /subscriptions/xxxxxxxx/resourceGroups/xxxxxx/providers/Microsoft.Network/VirtualNetworks/VirtualNetworks/xxxxxxx/subnets/xxxxxxx passed for the flow log does not exist.

Issue script & Debug output

/

Expected behavior

Allow to delete NSG Flow if subnet has been deleted

Environment Summary

azure-cli 2.73.0

core 2.73.0
telemetry 1.1.0

Extensions:
containerapp 1.1.0b4
rdbms-connect 1.0.7
serviceconnector-passwordless 3.3.1

Dependencies:
msal 1.32.3
azure-mgmt-resource 23.3.0

Python location '/opt/homebrew/Cellar/azure-cli/2.73.0/libexec/bin/python'
Config directory '/Users//.azure'
Extensions directory '/Users/
/.azure/cliextensions'

Python (Darwin) 3.12.10 (main, Apr 8 2025, 11:35:47) [Clang 16.0.0 (clang-1600.0.26.6)]

Legal docs and information: aka.ms/AzureCliLegal

Additional context

No response

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botNetworkaz network vnet/lb/nic/dns/etc...Service AttentionThis issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions