Azure Event Hubs
An Azure real-time data ingestion service.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm trying to execute Get-AzMetric to get Event Hub metrics like Incoming messages but its throwing me the following error -
Get-AzMetric: Exception type: ErrorResponseException, Message: Microsoft.Azure.Management.Monitor.Models.ErrorResponseException: Operation returned an invalid status code 'NotFound'
at Microsoft.Azure.Management.Monitor.MetricsOperations.ListWithHttpMessagesAsync(String resourceUri, ODataQuery`1 odataQuery, String timespan, Nullable`1 interval, String metricnames, String aggregation, Nullable`1 top, String orderby, Nullable`1 resultType, String metricnamespace, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.Management.Monitor.MetricsOperationsExtensions.ListAsync(IMetricsOperations operations, String resourceUri, ODataQuery`1 odataQuery, String timespan, Nullable`1 interval, String metricnames, String aggregation, Nullable`1 top, String orderby, Nullable`1 resultType, String metricnamespace, CancellationToken cancellationToken)
at Microsoft.Azure.Commands.Insights.Metrics.GetAzureRmMetricCommand.ProcessRecordInternal()
at Microsoft.Azure.Commands.Insights.MonitorCmdletBase.ExecuteCmdlet(), Code: Null, Status code:Null, Reason phrase: Null
An Azure real-time data ingestion service.
Hello @Srijita Mallick (ADMSMB161)
Did you verify if the resource actually exists in the RG?
Any permission restrictions to run the PowerShell script or updating the PowerShell module?
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}.Get-AzMetric command has sufficient permissions to access the Event Hub. You may need to grant the account the appropriate permissions using Azure RBAC.Get-AzMetricDefinition command to retrieve a list of available metrics for the Event Hub.I hope this helps! Let me know if you have any other questions.