Skip to content

Managed HSM - Diagnostic settings - event hub - AZ cli #24425

@peni19

Description

@peni19

SAS token for event hub requires “manage” to be accepted. Manage should not be required. Please remove this bug!

PS H:__AzureDevOps\AZUR.ManagedHSM\AZUR.ManagedHSM> az monitor diagnostic-settings create --name "_to_event_hub" --resource $keyVaultID --logs '[{""category"": ""AuditEvent"", ""enabled"":true}]' --event-hub /subscriptions//resourceGroups/rt-002/providers/Microsoft.EventHub/namespaces//eventhubs/*********** --event-hub-rule /subscriptions//resourceGroups/-002/providers/Microsoft.EventHub/namespaces/*/authorizationRules/****************
(BadRequest) If a valid EventHub name is not specified in the diagnostic setting, the EventHub authorization rule requires manage|send|listen access, this EventHub authorization rule does not have 'manage'
access.
Code: BadRequest
Message: If a valid EventHub name is not specified in the diagnostic setting, the EventHub authorization rule requires manage|send|listen access, this EventHub authorization rule does not have 'manage' access.

If SAS token has “manage” permissions it works:

PS H:__AzureDevOps\AZUR.ManagedHSM\AZUR.ManagedHSM> az monitor diagnostic-settings create --name "mhsmlogs_to_event_hub" --resource $keyVaultID --logs '[{""category"": ""AuditEvent"", ""enabled"":true}]' --event-hub /subscriptions//resourceGroups/rg-log-mgmt-002/providers/Microsoft.EventHub/namespaces//eventhubs/************* --event-hub-rule /subscriptions//resourcegroups//providers/Microsoft.EventHub/namespaces/evhn-logg-pr-swc-001/eventhubs//authorizationrules/*
(BadRequest) "Resource type 'microsoft.eventhub/namespaces/eventhubs/authorizationrules' is invalid for property 'properties.eventHubAuthorizationRuleId'. Expected types are 'microsoft.servicebus/namespaces/authorizationrules', 'microsoft.eventhub/namespaces/authorizationrules'"
Code: BadRequest
Message: "Resource type 'microsoft.eventhub/namespaces/eventhubs/authorizationrules' is invalid for property 'properties.eventHubAuthorizationRuleId'. Expected types are 'microsoft.servicebus/namespaces/authorizationrules', 'microsoft.eventhub/namespaces/authorizationrules'"

This is the output from “az monitor diagnostic-settings list --resource $keyVaultID”

{
"eventHubAuthorizationRuleId": "/subscriptions//resourceGroups/-002/providers/Microsoft.EventHub/namespaces//authorizationRules/",
"eventHubName": "",
"id": "/subscriptions/******/resourcegroups/-001/providers/microsoft.keyvault/managedhsms/
*********/providers/microsoft.insights/diagnosticSettings/mhsmlogs_to_event_hub",
"identity": null,
"kind": null,
"location": null,
"logAnalyticsDestinationType": null,
"logs": [
{
"category": "AuditEvent",
"categoryGroup": null,
"enabled": true,
"retentionPolicy": null
}
],
"marketplacePartnerId": null,
"metrics": [],
"name": "mhsmlogs_to_event_hub",
"resourceGroup": "****r-001",
"serviceBusRuleId": null,
"storageAccountId": null,
"systemData": null,
"tags": null,
"type": "Microsoft.Insights/diagnosticSettings",
"workspaceId": null
},


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botMonitoraz monitorService AttentionThis issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions