Get-AzureRmProviderOperation not listing Microsoft.EventGrid Operations
Steps to repro the issue :
Using the latest Version of AzureRM cmdlets
Get-Module -Name AzureRM
ModuleType Version Name ExportedCommands
Script 6.7.0 AzureRM
Neither of the below powershell commands are giving Microsoft.EventGrid operation in output:
Get-AzureRmProviderOperation -OperationSearchString Microsoft.EventGrid/*
Get-AzureRmProviderOperation
We can see that the json object has the correct result set when we are hitting the Azure REST API :
GET https://management.azure.com/providers/Microsoft.Authorization/providerOperations?api-version=2018-01-01-preview&$expand=resourceTypes
GET https://management.azure.com/providers/Microsoft.Authorization/providerOperations/Microsoft.EventGrid?api-version=2018-01-01-preview&$expand=resourceTypes
Get-AzureRmProviderOperation -OperationSearchString Microsoft.EventGrid/* -Debug DEBUG: 7:34:34 PM - GetAzureProviderOperationCommand begin processing with ParameterSet '__AllParameterSets'. DEBUG: 7:34:34 PM - using account id '[email protected]'... DEBUG: [Common.Authentication]: Authenticating using Account: '[email protected]', environment: 'AzureCloud', tenant: '72f988bf-86f1-41af-91ab-2d7cd011db47' DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: 1e106c0d-0b55-4527-8ec7-1d9bfcd1d0c7 - AcquireTokenHandlerBase: === Token Acquisition started: Authority: https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/ Resource: https://management.core.windows.net/ ClientId: 1950a258-227b-4e31-a9cf-717495945fc2 CacheType: Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache (3 items) Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: - TokenCache: Deserialized 3 items to token cache.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 08/16/2018 14:04:35: 1e106c0d-0b55-4527-8ec7-1d9bfcd1d0c7 - TokenCache: Looking up cache for a token...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: 1e106c0d-0b55-4527-8ec7-1d9bfcd1d0c7 - TokenCache: An item matching the requested resource was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 08/16/2018 14:04:35: 1e106c0d-0b55-4527-8ec7-1d9bfcd1d0c7 - TokenCache: 28.3926781316667 minutes left until token in cache expires
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: 1e106c0d-0b55-4527-8ec7-1d9bfcd1d0c7 - TokenCache: A matching item (access token or refresh token or both) was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: 1e106c0d-0b55-4527-8ec7-1d9bfcd1d0c7 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned: Access Token Hash: ZzLGjEJWPGokAh6HDYGQENgJs4JsIW/tJkLYx/+N3YU= Refresh Token Hash: K+EBQt4yHbSA3IPXtZH+Uclyp/BvPNJaAr30UY828o4= Expiration Time: 08/16/2018 14:32:59 +00:00 User Hash: QFxS0KC8xE44TYHP6Y61gnJ/O0ZCfOd/4NkHKIoC2z8=
DEBUG: [Common.Authentication]: Authenticating using Account: '[email protected]', environment: 'AzureCloud', tenant: '72f988bf-86f1-41af-91ab-2d7cd011db47' DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: 3d7b3110-4df6-4943-9034-9a42766d3141 - AcquireTokenHandlerBase: === Token Acquisition started: Authority: https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/ Resource: https://management.core.windows.net/ ClientId: 1950a258-227b-4e31-a9cf-717495945fc2 CacheType: Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache (3 items) Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: - TokenCache: Deserialized 3 items to token cache.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 08/16/2018 14:04:35: 3d7b3110-4df6-4943-9034-9a42766d3141 - TokenCache: Looking up cache for a token...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: 3d7b3110-4df6-4943-9034-9a42766d3141 - TokenCache: An item matching the requested resource was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 08/16/2018 14:04:35: 3d7b3110-4df6-4943-9034-9a42766d3141 - TokenCache: 28.3926281533333 minutes left until token in cache expires
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: 3d7b3110-4df6-4943-9034-9a42766d3141 - TokenCache: A matching item (access token or refresh token or both) was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: 3d7b3110-4df6-4943-9034-9a42766d3141 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned: Access Token Hash: ZzLGjEJWPGokAh6HDYGQENgJs4JsIW/tJkLYx/+N3YU= Refresh Token Hash: K+EBQt4yHbSA3IPXtZH+Uclyp/BvPNJaAr30UY828o4= Expiration Time: 08/16/2018 14:32:59 +00:00 User Hash: QFxS0KC8xE44TYHP6Y61gnJ/O0ZCfOd/4NkHKIoC2z8=
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: 58fbdbd9-2a6d-428d-a179-8604798f2ed1 - AcquireTokenHandlerBase: === Token Acquisition started: Authority: https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/ Resource: https://management.core.windows.net/ ClientId: 1950a258-227b-4e31-a9cf-717495945fc2 CacheType: Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache (3 items) Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: - TokenCache: Deserialized 3 items to token cache.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 08/16/2018 14:04:35: 58fbdbd9-2a6d-428d-a179-8604798f2ed1 - TokenCache: Looking up cache for a token...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: 58fbdbd9-2a6d-428d-a179-8604798f2ed1 - TokenCache: An item matching the requested resource was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : DEBUG: 08/16/2018 14:04:35: 58fbdbd9-2a6d-428d-a179-8604798f2ed1 - TokenCache: 28.3925777933333 minutes left until token in cache expires
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: 58fbdbd9-2a6d-428d-a179-8604798f2ed1 - TokenCache: A matching item (access token or refresh token or both) was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : DEBUG: 08/16/2018 14:04:35: 58fbdbd9-2a6d-428d-a179-8604798f2ed1 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned: Access Token Hash: ZzLGjEJWPGokAh6HDYGQENgJs4JsIW/tJkLYx/+N3YU= Refresh Token Hash: K+EBQt4yHbSA3IPXtZH+Uclyp/BvPNJaAr30UY828o4= Expiration Time: 08/16/2018 14:32:59 +00:00 User Hash: QFxS0KC8xE44TYHP6Y61gnJ/O0ZCfOd/4NkHKIoC2z8=
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method: GET
Absolute Uri: https://management.azure.com/providers/Microsoft.Authorization/providerOperations/Microsoft.EventGrid?api-version=2018-01-01-preview&$expand=resourceTypes
Headers: x-ms-client-request-id : 5f62e037-caaf-4599-ad7b-c323797a3239 accept-language : en-US
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code: OK
Headers: Pragma : no-cache x-ms-request-charge : 1 x-ms-request-id : 867da832-0e18-4a25-abe4-e63b58f399a9 X-Content-Type-Options : nosniff Strict-Transport-Security : max-age=31536000; includeSubDomains x-ms-ratelimit-remaining-tenant-reads: 14980 x-ms-correlation-request-id : 5071eb39-c826-48b2-ad28-b3183096651b x-ms-routing-request-id : SOUTHINDIA:20180816T140435Z:5071eb39-c826-48b2-ad28-b3183096651b Cache-Control : no-cache Date : Thu, 16 Aug 2018 14:04:35 GMT Set-Cookie : x-ms-gateway-slice=productionb; path=/; secure; HttpOnly Server : Microsoft-IIS/10.0
Body: { "displayName": "Microsoft Event Grid", "operations": [ { "name": "Microsoft.EventGrid/register/action", "displayName": "Registers the EventGrid Resource Provider", "description": "Registers the eventSubscription for the EventGrid resource provider and enables the creation of Event Grid subscriptions.", "origin": "User,System", "properties": null, "isDataAction": false } ], "resourceTypes": [ { "name": "eventSubscriptions", "displayName": "eventSubscriptions", "operations": [ { "name": "Microsoft.EventGrid/eventSubscriptions/write", "displayName": "Write EventSubscription", "description": "Create or update a eventSubscription", "origin": "User,System", "properties": null, "isDataAction": false }, { "name": "Microsoft.EventGrid/eventSubscriptions/read", "displayName": "Read EventSubscription", "description": "Read a eventSubscription", "origin": "User,System", "properties": null, "isDataAction": false }, { "name": "Microsoft.EventGrid/eventSubscriptions/delete", "displayName": "Delete EventSubscription", "description": "Delete a eventSubscription", "origin": "User,System", "properties": null, "isDataAction": false }, { "name": "Microsoft.EventGrid/eventSubscriptions/getFullUrl/action", "displayName": "Get full url", "description": "Get full url for the event subscription", "origin": "User,System", "properties": null, "isDataAction": false } ] }, { "name": "topics", "displayName": "topics", "operations": [ { "name": "Microsoft.EventGrid/topics/write", "displayName": "Write Topic", "description": "Create or update a topic", "origin": "User,System", "properties": null, "isDataAction": false }, { "name": "Microsoft.EventGrid/topics/read", "displayName": "Read Topic", "description": "Read a topic", "origin": "User,System", "properties": null, "isDataAction": false }, { "name": "Microsoft.EventGrid/topics/delete", "displayName": "Delete Topic", "description": "Delete a topic", "origin": "User,System", "properties": null, "isDataAction": false }, { "name": "Microsoft.EventGrid/topics/listKeys/action", "displayName": "List keys", "description": "List keys for the topic", "origin": "User,System", "properties": null, "isDataAction": false }, { "name": "Microsoft.EventGrid/topics/regenerateKey/action", "displayName": "Regenerate key", "description": "Regenerate key for the topic", "origin": "User,System", "properties": null, "isDataAction": false } ] }, { "name": "topics/providers/Microsoft.Insights/metricDefinitions", "displayName": "Topics Metrics", "operations": [ { "name": "Microsoft.EventGrid/topics/providers/Microsoft.Insights/metricDefinitions/read", "displayName": "Read topic metric definitions", "description": "Gets the available metrics for topics", "origin": "System", "properties": { "serviceSpecification": { "metricSpecifications": [ { "name": "PublishSuccessCount", "displayName": "Published Events", "displayDescription": "Total events published to this topic", "unit": "Count", "aggregationType": "Total", "internalMetricName": "PublishSuccessCount", "fillGapWithZero": true, "isDimensionRequired": false, "resourceIdDimensionNameOverride": null, "sourceMdmAccount": "AzureEventGrid", "sourceMdmNamespace": "ResourceMetrics", "availabilities": [ { "timeGrain": "PT1M", "blobDuration": "P30D" } ], "dimensions": [] }, { "name": "PublishFailCount", "displayName": "Failed Events", "displayDescription": "Total events failed to publish to this topic", "unit": "Count", "aggregationType": "Total", "internalMetricName": "PublishFailCount", "fillGapWithZero": true, "isDimensionRequired": false, "resourceIdDimensionNameOverride": null, "sourceMdmAccount": "AzureEventGrid", "sourceMdmNamespace": "ResourceMetrics", "availabilities": [ { "timeGrain": "PT1M", "blobDuration": "P30D" } ], "dimensions": [ { "name": "ErrorType" }, { "name": "Error" } ] }, { "name": "UnmatchedEventCount", "displayName": "Unmatched Events", "displayDescription": "Total events not matching any of the event subscriptions for this topic", "unit": "Count", "aggregationType": "Total", "internalMetricName": "UnmatchedEventCount", "fillGapWithZero": true, "isDimensionRequired": false, "resourceIdDimensionNameOverride": null, "sourceMdmAccount": "AzureEventGrid", "sourceMdmNamespace": "ResourceMetrics", "availabilities": [ { "timeGrain": "PT1M", "blobDuration": "P30D" } ], "dimensions": [] } ] } }, "isDataAction": false } ] }, { "name": "topics/providers/Microsoft.Insights/diagnosticSettings", "displayName": "Topics Diagnostics", "operations": [ { "name": "Microsoft.EventGrid/topics/providers/Microsoft.Insights/diagnosticSettings/read", "displayName": "Read diagnostic setting", "description": "Gets the diagnostic setting for topics", "origin": "System", "properties": null, "isDataAction": false }, { "name": "Microsoft.EventGrid/topics/providers/Microsoft.Insights/diagnosticSettings/write", "displayName": "Write diagnostic setting", "description": "Creates or updates the diagnostic setting for topics", "origin": "System", "properties": null, "isDataAction": false } ] }, { "name": "eventSubscriptions/providers/Microsoft.Insights/metricDefinitions", "displayName": "EventSubscription Metrics", "operations": [ { "name": "Microsoft.EventGrid/eventSubscriptions/providers/Microsoft.Insights/metricDefinitions/read", "displayName": "Read eventSubscription metric definitions", "description": "Gets the available metrics for eventSubscriptions", "origin": "System", "properties": { "serviceSpecification": { "metricSpecifications": [ { "name": "MatchedEventCount", "displayName": "Matched Events", "displayDescription": "Total events matched to this event subscription", "unit": "Count", "aggregationType": "Total", "internalMetricName": "MatchedEventCount", "fillGapWithZero": true, "isDimensionRequired": false, "resourceIdDimensionNameOverride": null, "sourceMdmAccount": "AzureEventGrid", "sourceMdmNamespace": "ResourceMetrics", "availabilities": [ { "timeGrain": "PT1M", "blobDuration": "P30D" } ], "dimensions": [] }, { "name": "DeliveryAttemptFailCount", "displayName": "Delivery Failed Events", "displayDescription": "Total events failed to deliver to this event subscription", "unit": "Count", "aggregationType": "Total", "internalMetricName": "DeliveryFailCount", "fillGapWithZero": true, "isDimensionRequired": false, "resourceIdDimensionNameOverride": null, "sourceMdmAccount": "AzureEventGrid", "sourceMdmNamespace": "ResourceMetrics", "availabilities": [ { "timeGrain": "PT1M", "blobDuration": "P30D" } ], "dimensions": [ { "name": "Error" }, { "name": "ErrorType" } ] }, { "name": "DeliverySuccessCount", "displayName": "Delivered Events", "displayDescription": "Total events delivered to this event subscription", "unit": "Count", "aggregationType": "Total", "internalMetricName": "DeliverySuccessCount", "fillGapWithZero": true, "isDimensionRequired": false, "resourceIdDimensionNameOverride": null, "sourceMdmAccount": "AzureEventGrid", "sourceMdmNamespace": "ResourceMetrics", "availabilities": [ { "timeGrain": "PT1M", "blobDuration": "P30D" } ], "dimensions": [] }, { "name": "DestinationProcessingDurationInMs", "displayName": "Destination Processing Duration", "displayDescription": "Destination processing duration in milliseconds", "unit": "Milliseconds", "aggregationType": "Average", "internalMetricName": "DestinationProcessingDelay", "fillGapWithZero": true, "isDimensionRequired": false, "resourceIdDimensionNameOverride": null, "sourceMdmAccount": "AzureEventGrid", "sourceMdmNamespace": "ResourceMetrics", "availabilities": [ { "timeGrain": "PT1M", "blobDuration": "P30D" } ], "dimensions": [] }, { "name": "DroppedEventCount", "displayName": "Dropped Events", "displayDescription": "Total dropped events matching to this event subscription", "unit": "Count", "aggregationType": "Total", "internalMetricName": "ExpiredEventCount", "fillGapWithZero": true, "isDimensionRequired": false, "resourceIdDimensionNameOverride": null, "sourceMdmAccount": "AzureEventGrid", "sourceMdmNamespace": "ResourceMetrics", "availabilities": [ { "timeGrain": "PT1M", "blobDuration": "P30D" } ], "dimensions": [] }, { "name": "DeadLetteredCount", "displayName": "Dead Lettered Events", "displayDescription": "Total dead lettered events matching to this event subscription", "unit": "Count", "aggregationType": "Total", "internalMetricName": "DeadLetteredCount", "fillGapWithZero": true, "isDimensionRequired": false, "resourceIdDimensionNameOverride": null, "sourceMdmAccount": "AzureEventGrid", "sourceMdmNamespace": "ResourceMetrics", "availabilities": [ { "timeGrain": "PT1M", "blobDuration": "P30D" } ], "dimensions": [ { "name": "DeadLetterReason" } ] } ] } }, "isDataAction": false } ] }, { "name": "eventSubscriptions/providers/Microsoft.Insights/diagnosticSettings", "displayName": "EventSubscription Diagnostics", "operations": [ { "name": "Microsoft.EventGrid/eventSubscriptions/providers/Microsoft.Insights/diagnosticSettings/read", "displayName": "Read diagnostic setting", "description": "Gets the diagnostic setting for event subscriptions", "origin": "System", "properties": null, "isDataAction": false }, { "name": "Microsoft.EventGrid/eventSubscriptions/providers/Microsoft.Insights/diagnosticSettings/write", "displayName": "Write diagnostic setting", "description": "Creates or updates the diagnostic setting for event subscriptions", "origin": "System", "properties": null, "isDataAction": false } ] }, { "name": "extensionTopics/providers/Microsoft.Insights/metricDefinitions", "displayName": "Topics Metrics", "operations": [ { "name": "Microsoft.EventGrid/extensionTopics/providers/Microsoft.Insights/metricDefinitions/read", "displayName": "Read topic metric definitions", "description": "Gets the available metrics for topics", "origin": "User,System", "properties": { "serviceSpecification": { "metricSpecifications": [ { "name": "PublishSuccessCount", "displayName": "Published Events", "displayDescription": "Total events published to this topic", "unit": "Count", "aggregationType": "Total", "internalMetricName": "PublishSuccessCount", "fillGapWithZero": true, "isDimensionRequired": false, "resourceIdDimensionNameOverride": null, "sourceMdmAccount": "AzureEventGrid", "sourceMdmNamespace": "ResourceMetrics", "availabilities": [ { "timeGrain": "PT1M", "blobDuration": "P30D" } ], "dimensions": [] }, { "name": "PublishFailCount", "displayName": "Failed Events", "displayDescription": "Total events failed to publish to this topic", "unit": "Count", "aggregationType": "Total", "internalMetricName": "PublishFailCount", "fillGapWithZero": true, "isDimensionRequired": false, "resourceIdDimensionNameOverride": null, "sourceMdmAccount": "AzureEventGrid", "sourceMdmNamespace": "ResourceMetrics", "availabilities": [ { "timeGrain": "PT1M", "blobDuration": "P30D" } ], "dimensions": [ { "name": "ErrorType" }, { "name": "Error" } ] }, { "name": "UnmatchedEventCount", "displayName": "Unmatched Events", "displayDescription": "Total events not matching any of the event subscriptions for this topic", "unit": "Count", "aggregationType": "Total", "internalMetricName": "UnmatchedEventCount", "fillGapWithZero": true, "isDimensionRequired": false, "resourceIdDimensionNameOverride": null, "sourceMdmAccount": "AzureEventGrid", "sourceMdmNamespace": "ResourceMetrics", "availabilities": [ { "timeGrain": "PT1M", "blobDuration": "P30D" } ], "dimensions": [] } ] } }, "isDataAction": false } ] }, { "name": "extensionTopics/providers/Microsoft.Insights/diagnosticSettings", "displayName": "Topics Diagnostics", "operations": [ { "name": "Microsoft.EventGrid/extensionTopics/providers/Microsoft.Insights/diagnosticSettings/read", "displayName": "Read diagnostic setting", "description": "Gets the diagnostic setting for topics", "origin": "System", "properties": null, "isDataAction": false }, { "name": "Microsoft.EventGrid/extensionTopics/providers/Microsoft.Insights/diagnosticSettings/write", "displayName": "Write diagnostic setting", "description": "Creates or updates the diagnostic setting for topics", "origin": "System", "properties": null, "isDataAction": false } ] } ], "id": "/providers/Microsoft.Authorization/providerOperations/Microsoft.EventGrid", "type": "Microsoft.Authorization/providerOperations", "name": "Microsoft.EventGrid" }
DEBUG: AzureQoSEvent: CommandName - Get-AzureRmProviderOperation; IsSuccess - True; Duration - 00:00:05.6529697; Exception - ; DEBUG: Finish sending metric. DEBUG: 7:34:40 PM - GetAzureProviderOperationCommand end processing. DEBUG: 7:34:40 PM - GetAzureProviderOperationCommand end processing.
Ask : Why the Get-AzureRmProviderOperation not listing Microsoft.EventGrid Operations correctly whereas the Azure REST API is listing the operation correctly
Please let me know if any other details needed.
This issue is easily reproducible under PSVersion = 5.1.14393.2368 and Azure PowerShell v5.1.2.
Any update on this issue?
@Tiano2017 Can you take a look?
@markcowl PAS team own this cmdlet. do you have contact in their team?
Have created the PR for the fix https://github.com/Azure/azure-powershell/pull/7442
Closing this issue,since a fix is merged for this in https://github.com/Azure/azure-powershell/pull/7442