Fixed. Had to re-apply global admin to fix.
Azure - Failed to delete public IP address The client 'XXX@XXXX.com' with object id XYZ does not have authorization to perform action 'Microsoft.Network/publicIPAddresses/delete' over scope 'XYZ'
User is global administrator.
Cannot delete resources in the tenancy. Any idea why?
Failed to delete public IP address 'XYZ'. Error: The client 'Tech.XYZ@xyz .com' with object id 'XYZ' does not have authorization to perform action 'Microsoft.Network/publicIPAddresses/delete' over scope 'XYZ' or the scope is invalid. If access was recently granted, please refresh your credentials.
3 additional answers
Sort by: Most helpful
-
suvasara-MSFT 10,046 Reputation points
2020-06-09T18:14:13.81+00:00 Greetings,
It seems the account you been trying to delete the IP from, doesn’t have enough permission to perform this operation.
To perform such operation, you need to be at least a network contributor on the subscription level or on the needed resource level.
If you’re already using Custom RBAC Roles, then you need to make sure that your custom Role has the below operations within the Action section from within the Custom Role:
Action Name
Microsoft.Network/publicIPAddresses/read Read a public IP address
Microsoft.Network/publicIPAddresses/write Create or update a public IP address
Microsoft.Network/publicIPAddresses/delete Delete a public IP address
Microsoft.Network/publicIPAddresses/join/action Associate a public IP address to a resource
Reference doc for more insights.
----------
Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.
-
Tech Support 96 Reputation points
2020-06-09T18:28:10.873+00:00 Thankyou for the reply.
The user is question is a Global admin... Hence the confusion.
-
Manu Philip 18,671 Reputation points MVP
2020-06-09T18:54:21.817+00:00 Hello,
Could you please try from PowerShell?
- Connect Azure tenant
- Execute the following cmdltes to find the networking profile. In this example, I assumes it is associated with a VM instance.
$vm = Get-AzVM -name myVM -ResourceGroupName myResourceGroup $vm.NetworkProfile
The output will show you the network ID Substitute it in the following cmdlet and disassociate the Public IP
$nic = Get-AzNetworkInterface -Name myVMVMNicID -ResourceGroup myResourceGroup $nic.IpConfigurations.publicipaddress.id = $null Set-AzNetworkInterface -NetworkInterface $nic
Finally, try to remove it as follows:
Remove-AzPublicIpAddress <ID>
Please mark as "Accept the answer" if the above steps helps you. Others with similar issues can also follow the solution as per your suggestion
Regards,
Manu