How to connet to azure & delete a disk .please help to share the sample powershell code. Suggest if any special permisions required to Delete a DISK or any NIC card.

2022-09-09T15:24:45.84+00:00

How to connet to azure & delete a disk .please help to share the sample powershell code. Suggest if any special permisions required to Delete a DISK or any NIC card.

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,243 questions
Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
627 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 27,696 Reputation points Microsoft Employee
    2022-09-19T21:08:19.46+00:00
       ## to remove a disk  
       Remove-AzDisk -ResourceGroupName 'ResourceGroup01' -DiskName 'Disk01' -Force;  
         
       ## remove nic  
       Remove-AzNetworkInterface -Name myNIC -ResourceGroupName myResourceGroup -Froce  
    

    As for permissions, having contributor role on the resource group should be sufficient enough unless if there are custom roles in place. For more information, have a look at following docs:

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.