Cannot create diagnostic settings for a subscription
See original GitHub issueDescribe the bug When trying to create diagnostic settings for a subscription, the command fails. Error seem to indicate that a resource group is required, but since its a subscription this cannot be provided.
$ az monitor diagnostic-settings create --name "Event logs" --resource "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
usage: az monitor diagnostic-settings create [-h] [--verbose] [--debug] [--output {json,jsonc,table,tsv,yaml,none}] [--query JMESPATH]
[--subscription _SUBSCRIPTION] --name NAME --resource RESOURCE_URI [--logs LOGS]
[--metrics METRICS] [--event-hub EVENT_HUB] [--event-hub-rule EVENT_HUB_RULE]
[--storage-account STORAGE_ACCOUNT] [--workspace WORKSPACE] [--resource-namespace NAMESPACE]
[--resource-parent PARENT] [--resource-type RESOURCE_TYPE]
[--resource-group RESOURCE_GROUP_NAME]
az monitor diagnostic-settings create: error: 'resource_group'
To Reproduce Run the following command:
az monitor diagnostic-settings create --name "Event logs" --resource "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Additional parameters does not alter the outcome.
Expected behavior Expected a diagnostic setting to be created for the subscription.
Environment summary Tested on both MacOS and Windows.
MacOS: macOS-10.15.3-x86_64-i386-64bit Python 3.8.1 Shell: bash azure-cli 2.0.79
Ubuntu (WSL): Linux-4.4.0-17134-Microsoft-x86_64-with-debian-buster-sid Python 3.6.5 Shell: bash azure-cli 2.0.81
Additional context Ran into the issue when trying to send activity logs from a subscription to an event hub.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Diagnostic Settings in Azure require subscription
You need to create diagnostic setting to send the Activity log to a Log Analytics workspace. You can send the Activity log from...
Read more >Configure Diagnostic Settings For Azure Subscription
Follow the steps to configure the diagnostics for an Azure subscription. Step 1: Log in to Azure Portal. Step 2: Navigate to Subscriptions...
Read more >Enable Subscription Activity Log Diagnostic Settings
Ensure that Azure Monitor Activity Logs for your subscription are exported to an appropriate data store using diagnostic settings.
Read more >Subscriptions filter in AAD and Azure portal are not in sync
As you may be aware, you can enable Azure AD Diagnostic Settings to send the logs to either an ... Start here to...
Read more >Finding Diagnostic Settings Configuration for Azure ...
In this article, we will share with you how to find the diagnostic settings configuration for all Azure resources in your subscription with ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
add to S167.
https://medium.com/@sondhi.nishant/azure-activity-logs-eventhub-using-arm-template-295147558cfd