Azure / azure-libraries-for-net

Azure libraries for .Net
MIT License
379 stars 192 forks source link

[BUG] Unable to delete NSG when flow logging is enabled #987

Open JadedATB opened 4 years ago

JadedATB commented 4 years ago

Describe the bug Fluent API fails when trying to delete an NSG when flow logging has been enabled.

Exception or Stack Trace Getting a CloudException with the message:

Resource /subscriptions/******/resourceGroups/NetworkWatcherRG/providers/Microsoft.Network/networkWatchers/NetworkWatcher_southcentralus/FlowLogs/Microsoft.NetworkRg-UnitTest-AutomatedDeployment-NSGNsg-DMZ referenced by resource /subscriptions/*****/resourceGroups/Rg-UnitTest-AutomatedDeployment-NSG/providers/Microsoft.Network/networkSecurityGroups/Nsg-DMZ was not found. Please make sure that the referenced resource exists, and that both resources are in the same region.

The resource string is malformed - missing a few '/'s between segments.

To Reproduce Enable flow logging on an NSG. Attempt to delete it.

Code Snippet

            await az.NetworkSecurityGroups.DeleteByIdsAsync(idList);

Expected behavior The network security groups should be deleted.

Setup (please complete the following information):

yaohaizh commented 4 years ago

Thanks for reporting this. We will route it to investigate.