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)?
Solution (thank you, Andrea Cappelletti!):
https://github.com/Azure/azure-sdk-for-go/issues/22773
Solution
In order to use that specific API you will have to follow these steps to enable it in your subscription:
Prerequisites To register feature you need Contributor or Owner role on subscription. You can register this feature from CLI, first login:
az login
Then select your subscription:az account set --subscription "xxxxxx" ->Please replace xxxx by your Sub. ID
Then enable the API for your subscription:az feature registration create --namespace Microsoft.Compute --name UseNewDataDisksAttachDetachApi
Additionally, you also need to enable a feature called EtagPreview:az feature registration show --name EtagPreview --provider-namespace Microsoft.Compute
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!