When trying to use BeginAttachDetachDataDisks(Using GO SDK), I'm getting the following error: The subscription is not enabled for using the attach detach data disks API. I have the attachDisk & detachDisk permission added for the subscription.

Rajat Jain 5 Reputation points
2024-04-04T17:03:43.7033333+00:00

When trying to use BeginAttachDetachDataDisks, I'm getting the following error: "The subscription is not enabled for using the attach detach data disks API". I have the attachDisk & detachDisk permission added for the subscription. I'm able to do the same through CLI. The POST command seems to be the same in both the case. Is there any special permission required at the subscription level to do this? The attachDisk and detachDisk permission that exists for the subscription is under Microsoft.ClassicCompute (Microsoft.ClassicCompute/virtualMachines/attachDisk/action)

I did not find any similar permission under Microsoft.Compute. Is that the difference?

How do I fix it?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,137 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.
572 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,501 questions
{count} votes

1 answer

Sort by: Most helpful
  1. kobulloc-MSFT 23,491 Reputation points Microsoft Employee
    2024-04-04T19:01:29.7566667+00:00

    Hello, @Rajat Jain !

    Why am I getting a The subscription is not enabled for using the attach detach data disks API error when trying to use BeginAttachDetachDataDisks (Using GO SDK)?


    Edit: We are actively investigating this issue and will update this thread as we learn more.


    Others have reported this as well and it appears to be an issue on our end. Please email the following to AzCommunity@microsoft.com and we'll get back to you promptly:

    • Subject: "Attn: kobulloc - API error for detach data disks"
    • Email body: Your Subscription ID
    • Email body: A link to this thread so we can validate and expedite the request

    If you don't receive a response within 24 hours, please reply to the thread so we can investigate.


    I hope this has been helpful! Your feedback is important so please take a moment to accept answers.

    If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!

    User's image

    0 comments No comments