I’m attempting to execute a command in GitBash Terminal to create Diagnostics Settings for an Azure Storage account. This command runs successfully when executed directly in Azure CLI.
Steps taken:
Azure Login:
az login
Set Subscription:
az account set –subscription xxxxxxxxxxxxx
Subscription set to [Subscription ID].
Command Used:
az monitor diagnostic-settings create --resource /subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/resource-jumpbox/providers/Microsoft.Storage/storageAccounts/teststorage --name cafsmpso-diagnostics --metrics '[{"category": "AllMetrics","enabled": true}]' --event-hub-rule /subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/eventhub-recsourcegroup/providers/Microsoft.EventHub/namespaces/eventhub/authorizationrules/RootManageSharedAccessKey --event-hub csc-logi-prd-neu-eventhub-ns
Error Encountered:
?[91musage error: –resource ID | –resource NAME –resource-group NAME –resource-type TYPE [–resource-parent PARENT] [–resource-namespace NAMESPACE]?[0m
Please let me know what I am missing here. This is part of a bash script I am writting so should be able to excute the bash script using GitBash Terminal.
This exact command create the diasnostics settings when directly used in Azure CLI
Makabas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.