Hi @Akash Sharma
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
That metric collection is turned on for your Azure Arc-enabled SQL managed instance. In the Azure portal, view the diagnostic settings of your instance. If not already configured, you must configure it so that the metrics are sent to Azure Monitor.
Using the API may not be the right fit for Azure Arc resources because Azure Arc is managed slightly differently. You'll want to double check the API endpoint and make sure it supports Azure Arc-enabled SQL MI. The method may be a valid resource provider Microsoft.HybridCompute, and the version of the API may need to be updated.
Make sure your account has the proper permissions to access metrics. Your Azure Arc-enabled SQL MI will require at least the Monitoring Reader role, or higher, at the resource group or subscription level to monitor metrics.
To collect metrics, the Azure Monitor agent needs to be installed and running on your Azure Arc-enabled SQL MI. It’s worth checking that the agent is installed and working properly.
If the API still doesn’t work, you may want to let the Azure CLI or PowerShell try to pull the metrics. Sometimes these tools can give you detailed error messages that help you figure out what’s going on.
The version of the API you are using (2017-09-01-preview) may not properly support Azure Arc-enabled SQL MIs. It might be worth checking if there is a version of the API specifically designed for Azure Arc.
If you still have trouble after this step, I suggest you contact Microsoft support. They can help you with specific issues related to Azure Arc-enabled resources.
If you have any concerns, please go through this link: -
https://learn.microsoft.com/en-us/cli/azure/monitor/metrics?view=azure-cli-latest
https://learn.microsoft.com/en-us/azure/azure-monitor/roles-permissions-security
If you have any further queries, do let us know
If the answer is helpful, please click "Accept Answer" and "Upvote it"