question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot create diagnostic settings for a subscription

See original GitHub issue

Describe 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:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found