Is there a way to retrieve diagnostic settings for a storage Blob/Queue/Table/File?

SP-777 20 Reputation points
2023-02-22T19:57:21.79+00:00

I was wondering if there is any way to retrieve the diagnostic settings of a storage blob/queue/Table/File using a PowerShell command.

When i use the "Get-AzDiagnosticSetting" i am only able to pull the diagnostic settings of the storage account "spstorageaccountdiag" as shown below but not blob/queue level which are enabled and have diagnostic settings configured.

Also, from portal i can see it as shown below.
User's image

Please let me know.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,424 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,117 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 110.8K Reputation points
    2023-02-22T20:32:25.01+00:00

    Hi,

    You can retrieve the settings for each using the ResourceId. For example:

    $blobSetting = Get-AzDiagnosticSetting -ResourceId /subscriptions/<subscription id>/resourceGroups/DefaultResourceGroup-CUS/providers/Microsoft.Storage/storageAccounts/spstorageaccountdiag/blobServices/default
    $queueSetting = Get-AzDiagnosticSetting -ResourceId /subscriptions/<subscription id>/resourceGroups/DefaultResourceGroup-CUS/providers/Microsoft.Storage/storageAccounts/spstorageaccountdiag/queueServices/default
    $tableSetting = Get-AzDiagnosticSetting -ResourceId /subscriptions/<subscription id>/resourceGroups/DefaultResourceGroup-CUS/providers/Microsoft.Storage/storageAccounts/spstorageaccountdiag/tableServices/default
    $fileSetting = Get-AzDiagnosticSetting -ResourceId /subscriptions/<subscription id>/resourceGroups/DefaultResourceGroup-CUS/providers/Microsoft.Storage/storageAccounts/spstorageaccountdiag/fileServices/default
    
    

    If the above is helpful please click Accept Answer.

    Thanks.

    -TP

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.