question

SarjuMulmi-7343 avatar image
0 Votes"
SarjuMulmi-7343 asked SumanthMarigowda-MSFT commented

Error deploying storage account diagnostic setting using ARM template

Hi,
I'm trying to deploy diagnostic settings for Azure storage using ARM templates following https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/resource-manager-diagnostic-settings#diagnostic-setting-for-azure-storage.
Following is the snippet of the resource block:

 {
 "type": "Microsoft.Storage/storageAccounts/blobServices/providers/diagnosticsettings",
                             "apiVersion": "2017-05-01-preview",
                             "name": "[concat(parameters('storageAccountName'),'/default/Microsoft.Insights/', parameters('settingName'))]",
                             "properties": {
                                 "storageAccountId": "[parameters('archiveStorageId')]",
                                 "logs": [
                                     {
                                         "category": "StorageRead",
                                         "enabled": true
                                     },
                                     {
                                         "category": "StorageWrite",
                                         "enabled": true
                                     },
                                     {
                                         "category": "StorageDelete",
                                         "enabled": true
                                     }
                                 ]
  }

However, I'm getting the following error for all storage types:

 The resource type could not be found in the namespace 'Microsoft.Storage' for api version '2017-05-01-preview'




azure-storage-accounts
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@SarjuMulmi-7343 , Just checking in to see if the above answer helped. If this answers your query, do click 200906-screenshot-2021-12-10-121802.png and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

<<Private message note: This is a private message which only you as Original Poster and Microsoft Moderators can view. Please respond directly to this comment to privately share the requested information. For your privacy, please do not share any Personal Identifiable Information (PII) as a public or private comment. All the private messages on the platform will be deleted on periodic basis>>


0 Votes 0 ·

1 Answer

shivapatpi-MSFT avatar image
0 Votes"
shivapatpi-MSFT answered

Hello @SarjuMulmi-7343 ,
I just tried the exact same template mentioned at https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/resource-manager-diagnostic-settings#diagnostic-setting-for-azure-storage.
and it went through successfully.

Please find the attached template & Parameters file

[199767-enablestoragediag.txt]
[2]: /answers/storage/attachments/199878-parameters.txt



Command used:
az group deployment create -g resourcegroupname --template-file .\enablestoragediag.json --parameters .\parameters.json

199854-image.png


[199878-parameters.txt][2]




parameters.txt (619 B)
image.png (27.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.