Azure Functions memory / consumption unit usage
The simple answer to your question is "yes".
Use the Azure Monitor Metrics REST API to get FunctionExecutionUnits and FunctionExecutionCount metrics.
This sample call:az monitor metrics list --resource /subscriptions/<subid>/resourceGroups/pbconsumptionexample/providers/Microsoft.Web/sites/pbconsumptionexample --metric FunctionExecutionUnits,FunctionExecutionCount --aggregation Total --interval PT1M
yields the following sample output shows 153600 MB-milliseconds, or .15 GB-ms:
"name": {
"additionalProperties": {},
"localizedValue": "Function Execution Units",
"value": "FunctionExecutionUnits"
},
"resourceGroup": "pbconsumptionexample",
"timeseries": [
{
"additionalProperties": {},
"data": [
{
"additionalProperties": {},
"average": null,
"count": null,
"maximum": null,
"minimum": null,
"timeStamp": "2018-04-13T23:40:00+00:00",
"total": 153600.0
}
],
"metadatavalues": []
}
],
Here's an explanation of how:
https://github.com/Azure/Azure-Functions/wiki/Consumption-Plan-Cost-Billing-FAQ#how-can-i-access-execution-count-and-gb-seconds-programmatically
For greater context:
https://github.com/Azure/Azure-Functions/wiki/Consumption-Plan-Cost-Billing-FAQ
You can use the Monitor -> Metrics
view in the Azure Portal:
For more information on this topic see this functions cost/billing FAQ.