204052 - Failed to Delete an NSG Rule
Uploading...Agent error code #204052 indicates that az network nsg rule delete failed while revoking a grant. Access that should have been withdrawn may still be in place.
Common causes include:
Steps to Resolve
Confirm Whether the Rule Is Still There
kk- rule holding the address from the failed revoke
Treat a rule that is still present as live access until it is gone
Remove the Rule by Hand if It Remains
sudo -u knocknoc az network nsg rule delete \
--resource-group <resource-group> --nsg-name <nsg-name> --name <rule-name>
Confirm the Delete Permission
A custom role granting securityRules/write without securityRules/delete produces exactly this pattern: grants succeed and revokes fail. Network Contributor covers both.
Check for a Resource Lock
A Delete or ReadOnly lock on the NSG or its resource group prevents removal while still allowing some reads. Open the resource group > Locks to check.
Check It Clears on a Later Attempt
A failed revoke is retried automatically. If this code keeps appearing for the same address, remove the rule by hand rather than waiting.