azurepowershellazure-virtual-machineazure-cli

How can i cancel an export in Azure using az cli?


I have a snapshot and i want to run "Cancel Export" using az cli instead of clicking in Azure.

How can i do this using az cli cmdlets ?


Solution

  • I created one VM snapshot and enabled its export that created SAS URL with Cancel Export button as below:

    enter image description here

    To cancel the export of snapshot using Azure CLI, you can make use of below command:

    az snapshot revoke-access --name <snapshot_name> --resource-group <rg_name>
    

    Response:

    enter image description here

    When I checked the same in Portal by refreshing the page, snapshot export cancelled successfully and displayed this page:

    enter image description here

    Reference: az snapshot | Microsoft