title: Unable to get Azure monitoring metrics from the REST API
body: <p>I retrieve metric definitions using this:</p>
  
  <pre><code>https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-grp-id}/providers/microsoft.classiccompute/virtualMachines/{vm-id}/providers/microsoft.insights/metricdefinitions?api-version=2015-07-01
  </code></pre>
  
  <p>which returns</p>
  
  <pre><code>{
  "id": "/subscriptions/{subscription-id}/resourceGroups/{res-group-id}/providers/microsoft.classiccompute/virtualMachines/{vm-id}/providers/microsoft.insights/metricdefinitions",
  "value": [
      {
          "resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{res-group-id}/providers/Microsoft.ClassicCompute/virtualMachines/{vm-id}",
          "resourceId": "/subscriptions/{subscription-id}/resourceGroups/{res-group-id}/providers/Microsoft.ClassicCompute/virtualMachines/{vm-id}",
          "name": {
              "value": "\\Memory\\AvailableMemory",
              "localizedValue": "Memory available"
          },
          "startTime": "0001-01-01T00:00:00Z",
          "endTime": "0001-01-01T00:00:00Z",
          "unit": "Bytes",
          "primaryAggregationType": "Average",
          "ResourceUri": "/subscriptions/{subscription-id}/resourceGroups/{res-group-id}/providers/Microsoft.ClassicCompute/virtualMachines/{vm-id}",
          "ResourceId": "/subscriptions/{subscription-id}/resourceGroups/{res-group-id}/providers/Microsoft.ClassicCompute/virtualMachines/{vm-id}",
          "metricAvailabilities": [a11bbc020fdd/resourceGroups/cldy-az-res-grp-test-1/providers/Microsoft.ClassicCompute/virtualMachines/cldy-az-vm-test-1","metricAvailabilities":[{"timeGrain":"PT1H","retention":"P10675199DT2H48M5.4775807S","location":{"tableEndpoint":"https://cldyazresgrptest19563.table.core.windows.net/","tableInfo":[{"tableName":"WADMetricsPT1HP10DV2S20170331",
  </code></pre>
  
  <p>....</p>
  
  <p>But when I attempt to fetch metric "\\Memory\\AvailableMemory" with</p>
  
  <pre><code>https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{res-grp-id}/providers/Microsoft.ClassicCompute/virtualMachines/{vm-id}/providers/microsoft.insights/metrics?api-version=2016-09-01&amp;$filter=%28name.value+eq+%27%5CMemory%5CAvailableMemory%27%29+and+aggregationType+eq+%27Average%27+and+startTime+eq+2017-04-06T10%3A01%3A00Z+and+endTime+eq+2017-04-07T10%3A01%3A00Z+and+timeGrain+eq+duration%27PT1H%27
  </code></pre>
  
  <p>I get an error message:</p>
  
  <pre><code>{"code":"NotFound","message":"Please make sure your provider: Microsoft.ClassicCompute is properly registered with insights and retry"}
  </code></pre>
  
  <p>The filter param in the URL is</p>
  
  <pre><code>(name.value eq '\Memory\AvailableMemory') and aggregationType eq 'Average' and startTime eq 2017-04-06T10:01:00Z and endTime eq 2017-04-07T10:01:00Z and timeGrain eq duration'PT1H' 
  </code></pre>