Internal server error when deploying ARM Template









up vote
0
down vote

favorite












I am deploying an arm template that contains the following resources



Microsoft.Storage/storageAccount
Microsoft.Sql/servers
Microsoft.Sql/servers/auditPolicies


Now everything worked until I started changing the values for the auditPolicies object. Here are the steps I took until the InternalServerError occurred.



  1. Added the auditState property and set its value to Disabled. Deployment Successful.

  2. Changed the auditState property to Enabled. Deployment failed. Error states that the storageAccountName is required.

  3. Added storageAccountName and set its value to the name of the storage account. Deployment failed. Error states that storageAccountKey.

  4. Added storageAccountKey and set its value to key1 of the storage account's keys object. Deployment failed. Internal Server Error - "An Error has occurred while saving Auditing settings, please try again later". Additionally, the errors cause the deployment to run indefinitely. Though I am not concerned about that aspect.

The following is the complete template.




"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",

"parameters":
"app-name-prefix":
"type": "string",
"minLength": 1
,
"app-locations":
"type": "array",
"minLength": 1
,
"app-friendly-names":
"type": "array",
"minLength": 1
,
"db-user-admin-username":
"type": "securestring"
,
"db-user-admin-password":
"type": "securestring"
,
"database-audit-enabled":
"defaultValue": "Enabled",
"allowedValues": [
"Enabled",
"Disabled"
],
"type": "string"
,
"storage-kind":
"defaultValue": "BlobStorage",
"allowedValues": [
"StorageV2",
"BlobStorage"
],
"type": "string"
,
"storage-sku":
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_ZRS",
"Standard_GRS",
"Standard_RAGRS",
"Premium_LRS"
],
"type": "string"

,
"variables":
"db-service-name": "[concat(parameters('app-name-prefix'), '-database-service-')]",
"storage-name": "[concat(toLower(parameters('app-name-prefix')), 'auditstorage')]"
,
"resources": [

"name": "[concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()])]",
"type": "Microsoft.Storage/storageAccounts",
"sku":
"name": "[parameters('storage-sku')]"
,
"kind": "[parameters('storage-kind')]",
"apiVersion": "2018-02-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"copy":
"count": "[length(parameters('app-locations'))]",
"name": "storageCopy"
,
"properties":
"supportsHttpsTrafficOnly": true,
"accessTier": "Hot",
"encryption":
"services":
"blob":
"enabled": true
,
"file":
"enabled": true

,
"keySource": "Microsoft.Storage"


,

"type": "Microsoft.Sql/servers",
"name": "[concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()])]",
"apiVersion": "2014-04-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"copy":
"name": "databaseServiceCopy",
"count": "[length(parameters('app-locations'))]"
,
"properties":
"administratorLogin": "[parameters('db-user-admin-username')]",
"administratorLoginPassword": "[parameters('db-user-admin-password')]",
"version": "12.0"
,
"resources": [

"type": "auditingPolicies",
"name": "Default",
"apiVersion": "2014-04-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"properties":
"auditingState": "[parameters('database-audit-enabled')]",
"storageAccountName": "[concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()])]",
"storageAccountKey": "[listKeys(concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').keys[0].value]"
,
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()]))]",
"storageCopy"
]

]

]



What am I missing that will help resolve this issue? What do I need to do to stop this internal server error?




I have added the complete template as was requested by @Pete










share|improve this question























  • Could you rip out the parameters and paste the actual values so that I can recreate the error?
    – Pete
    Nov 13 at 11:23










  • @pete there are no special values that would be revealed by supplying them. all are strings, except the auditingState value which is a boolean. ListKeys pulls the value out of my storage account and that value is meant to stay secret by design. but in essence it is an alphanumeric string. Additionally, before the properties were added to the auditing Policy object, this script works
    – Itanex
    Nov 13 at 18:36











  • Sure - but I just want to copy and paste the template to recreate the problem, I don't want to parse the functions out. It was 1:00am and I was too tired.
    – Pete
    Nov 13 at 21:12










  • @pete I updated the question with the details you requested. I had left them out for brevity. Though I have also come to the proper solution for my situation.
    – Itanex
    Nov 14 at 23:16














up vote
0
down vote

favorite












I am deploying an arm template that contains the following resources



Microsoft.Storage/storageAccount
Microsoft.Sql/servers
Microsoft.Sql/servers/auditPolicies


Now everything worked until I started changing the values for the auditPolicies object. Here are the steps I took until the InternalServerError occurred.



  1. Added the auditState property and set its value to Disabled. Deployment Successful.

  2. Changed the auditState property to Enabled. Deployment failed. Error states that the storageAccountName is required.

  3. Added storageAccountName and set its value to the name of the storage account. Deployment failed. Error states that storageAccountKey.

  4. Added storageAccountKey and set its value to key1 of the storage account's keys object. Deployment failed. Internal Server Error - "An Error has occurred while saving Auditing settings, please try again later". Additionally, the errors cause the deployment to run indefinitely. Though I am not concerned about that aspect.

The following is the complete template.




"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",

"parameters":
"app-name-prefix":
"type": "string",
"minLength": 1
,
"app-locations":
"type": "array",
"minLength": 1
,
"app-friendly-names":
"type": "array",
"minLength": 1
,
"db-user-admin-username":
"type": "securestring"
,
"db-user-admin-password":
"type": "securestring"
,
"database-audit-enabled":
"defaultValue": "Enabled",
"allowedValues": [
"Enabled",
"Disabled"
],
"type": "string"
,
"storage-kind":
"defaultValue": "BlobStorage",
"allowedValues": [
"StorageV2",
"BlobStorage"
],
"type": "string"
,
"storage-sku":
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_ZRS",
"Standard_GRS",
"Standard_RAGRS",
"Premium_LRS"
],
"type": "string"

,
"variables":
"db-service-name": "[concat(parameters('app-name-prefix'), '-database-service-')]",
"storage-name": "[concat(toLower(parameters('app-name-prefix')), 'auditstorage')]"
,
"resources": [

"name": "[concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()])]",
"type": "Microsoft.Storage/storageAccounts",
"sku":
"name": "[parameters('storage-sku')]"
,
"kind": "[parameters('storage-kind')]",
"apiVersion": "2018-02-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"copy":
"count": "[length(parameters('app-locations'))]",
"name": "storageCopy"
,
"properties":
"supportsHttpsTrafficOnly": true,
"accessTier": "Hot",
"encryption":
"services":
"blob":
"enabled": true
,
"file":
"enabled": true

,
"keySource": "Microsoft.Storage"


,

"type": "Microsoft.Sql/servers",
"name": "[concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()])]",
"apiVersion": "2014-04-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"copy":
"name": "databaseServiceCopy",
"count": "[length(parameters('app-locations'))]"
,
"properties":
"administratorLogin": "[parameters('db-user-admin-username')]",
"administratorLoginPassword": "[parameters('db-user-admin-password')]",
"version": "12.0"
,
"resources": [

"type": "auditingPolicies",
"name": "Default",
"apiVersion": "2014-04-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"properties":
"auditingState": "[parameters('database-audit-enabled')]",
"storageAccountName": "[concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()])]",
"storageAccountKey": "[listKeys(concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').keys[0].value]"
,
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()]))]",
"storageCopy"
]

]

]



What am I missing that will help resolve this issue? What do I need to do to stop this internal server error?




I have added the complete template as was requested by @Pete










share|improve this question























  • Could you rip out the parameters and paste the actual values so that I can recreate the error?
    – Pete
    Nov 13 at 11:23










  • @pete there are no special values that would be revealed by supplying them. all are strings, except the auditingState value which is a boolean. ListKeys pulls the value out of my storage account and that value is meant to stay secret by design. but in essence it is an alphanumeric string. Additionally, before the properties were added to the auditing Policy object, this script works
    – Itanex
    Nov 13 at 18:36











  • Sure - but I just want to copy and paste the template to recreate the problem, I don't want to parse the functions out. It was 1:00am and I was too tired.
    – Pete
    Nov 13 at 21:12










  • @pete I updated the question with the details you requested. I had left them out for brevity. Though I have also come to the proper solution for my situation.
    – Itanex
    Nov 14 at 23:16












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am deploying an arm template that contains the following resources



Microsoft.Storage/storageAccount
Microsoft.Sql/servers
Microsoft.Sql/servers/auditPolicies


Now everything worked until I started changing the values for the auditPolicies object. Here are the steps I took until the InternalServerError occurred.



  1. Added the auditState property and set its value to Disabled. Deployment Successful.

  2. Changed the auditState property to Enabled. Deployment failed. Error states that the storageAccountName is required.

  3. Added storageAccountName and set its value to the name of the storage account. Deployment failed. Error states that storageAccountKey.

  4. Added storageAccountKey and set its value to key1 of the storage account's keys object. Deployment failed. Internal Server Error - "An Error has occurred while saving Auditing settings, please try again later". Additionally, the errors cause the deployment to run indefinitely. Though I am not concerned about that aspect.

The following is the complete template.




"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",

"parameters":
"app-name-prefix":
"type": "string",
"minLength": 1
,
"app-locations":
"type": "array",
"minLength": 1
,
"app-friendly-names":
"type": "array",
"minLength": 1
,
"db-user-admin-username":
"type": "securestring"
,
"db-user-admin-password":
"type": "securestring"
,
"database-audit-enabled":
"defaultValue": "Enabled",
"allowedValues": [
"Enabled",
"Disabled"
],
"type": "string"
,
"storage-kind":
"defaultValue": "BlobStorage",
"allowedValues": [
"StorageV2",
"BlobStorage"
],
"type": "string"
,
"storage-sku":
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_ZRS",
"Standard_GRS",
"Standard_RAGRS",
"Premium_LRS"
],
"type": "string"

,
"variables":
"db-service-name": "[concat(parameters('app-name-prefix'), '-database-service-')]",
"storage-name": "[concat(toLower(parameters('app-name-prefix')), 'auditstorage')]"
,
"resources": [

"name": "[concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()])]",
"type": "Microsoft.Storage/storageAccounts",
"sku":
"name": "[parameters('storage-sku')]"
,
"kind": "[parameters('storage-kind')]",
"apiVersion": "2018-02-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"copy":
"count": "[length(parameters('app-locations'))]",
"name": "storageCopy"
,
"properties":
"supportsHttpsTrafficOnly": true,
"accessTier": "Hot",
"encryption":
"services":
"blob":
"enabled": true
,
"file":
"enabled": true

,
"keySource": "Microsoft.Storage"


,

"type": "Microsoft.Sql/servers",
"name": "[concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()])]",
"apiVersion": "2014-04-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"copy":
"name": "databaseServiceCopy",
"count": "[length(parameters('app-locations'))]"
,
"properties":
"administratorLogin": "[parameters('db-user-admin-username')]",
"administratorLoginPassword": "[parameters('db-user-admin-password')]",
"version": "12.0"
,
"resources": [

"type": "auditingPolicies",
"name": "Default",
"apiVersion": "2014-04-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"properties":
"auditingState": "[parameters('database-audit-enabled')]",
"storageAccountName": "[concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()])]",
"storageAccountKey": "[listKeys(concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').keys[0].value]"
,
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()]))]",
"storageCopy"
]

]

]



What am I missing that will help resolve this issue? What do I need to do to stop this internal server error?




I have added the complete template as was requested by @Pete










share|improve this question















I am deploying an arm template that contains the following resources



Microsoft.Storage/storageAccount
Microsoft.Sql/servers
Microsoft.Sql/servers/auditPolicies


Now everything worked until I started changing the values for the auditPolicies object. Here are the steps I took until the InternalServerError occurred.



  1. Added the auditState property and set its value to Disabled. Deployment Successful.

  2. Changed the auditState property to Enabled. Deployment failed. Error states that the storageAccountName is required.

  3. Added storageAccountName and set its value to the name of the storage account. Deployment failed. Error states that storageAccountKey.

  4. Added storageAccountKey and set its value to key1 of the storage account's keys object. Deployment failed. Internal Server Error - "An Error has occurred while saving Auditing settings, please try again later". Additionally, the errors cause the deployment to run indefinitely. Though I am not concerned about that aspect.

The following is the complete template.




"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",

"parameters":
"app-name-prefix":
"type": "string",
"minLength": 1
,
"app-locations":
"type": "array",
"minLength": 1
,
"app-friendly-names":
"type": "array",
"minLength": 1
,
"db-user-admin-username":
"type": "securestring"
,
"db-user-admin-password":
"type": "securestring"
,
"database-audit-enabled":
"defaultValue": "Enabled",
"allowedValues": [
"Enabled",
"Disabled"
],
"type": "string"
,
"storage-kind":
"defaultValue": "BlobStorage",
"allowedValues": [
"StorageV2",
"BlobStorage"
],
"type": "string"
,
"storage-sku":
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_ZRS",
"Standard_GRS",
"Standard_RAGRS",
"Premium_LRS"
],
"type": "string"

,
"variables":
"db-service-name": "[concat(parameters('app-name-prefix'), '-database-service-')]",
"storage-name": "[concat(toLower(parameters('app-name-prefix')), 'auditstorage')]"
,
"resources": [

"name": "[concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()])]",
"type": "Microsoft.Storage/storageAccounts",
"sku":
"name": "[parameters('storage-sku')]"
,
"kind": "[parameters('storage-kind')]",
"apiVersion": "2018-02-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"copy":
"count": "[length(parameters('app-locations'))]",
"name": "storageCopy"
,
"properties":
"supportsHttpsTrafficOnly": true,
"accessTier": "Hot",
"encryption":
"services":
"blob":
"enabled": true
,
"file":
"enabled": true

,
"keySource": "Microsoft.Storage"


,

"type": "Microsoft.Sql/servers",
"name": "[concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()])]",
"apiVersion": "2014-04-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"copy":
"name": "databaseServiceCopy",
"count": "[length(parameters('app-locations'))]"
,
"properties":
"administratorLogin": "[parameters('db-user-admin-username')]",
"administratorLoginPassword": "[parameters('db-user-admin-password')]",
"version": "12.0"
,
"resources": [

"type": "auditingPolicies",
"name": "Default",
"apiVersion": "2014-04-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"properties":
"auditingState": "[parameters('database-audit-enabled')]",
"storageAccountName": "[concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()])]",
"storageAccountKey": "[listKeys(concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').keys[0].value]"
,
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()]))]",
"storageCopy"
]

]

]



What am I missing that will help resolve this issue? What do I need to do to stop this internal server error?




I have added the complete template as was requested by @Pete







azure-resource-manager






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 at 23:15

























asked Nov 9 at 18:25









Itanex

869921




869921











  • Could you rip out the parameters and paste the actual values so that I can recreate the error?
    – Pete
    Nov 13 at 11:23










  • @pete there are no special values that would be revealed by supplying them. all are strings, except the auditingState value which is a boolean. ListKeys pulls the value out of my storage account and that value is meant to stay secret by design. but in essence it is an alphanumeric string. Additionally, before the properties were added to the auditing Policy object, this script works
    – Itanex
    Nov 13 at 18:36











  • Sure - but I just want to copy and paste the template to recreate the problem, I don't want to parse the functions out. It was 1:00am and I was too tired.
    – Pete
    Nov 13 at 21:12










  • @pete I updated the question with the details you requested. I had left them out for brevity. Though I have also come to the proper solution for my situation.
    – Itanex
    Nov 14 at 23:16
















  • Could you rip out the parameters and paste the actual values so that I can recreate the error?
    – Pete
    Nov 13 at 11:23










  • @pete there are no special values that would be revealed by supplying them. all are strings, except the auditingState value which is a boolean. ListKeys pulls the value out of my storage account and that value is meant to stay secret by design. but in essence it is an alphanumeric string. Additionally, before the properties were added to the auditing Policy object, this script works
    – Itanex
    Nov 13 at 18:36











  • Sure - but I just want to copy and paste the template to recreate the problem, I don't want to parse the functions out. It was 1:00am and I was too tired.
    – Pete
    Nov 13 at 21:12










  • @pete I updated the question with the details you requested. I had left them out for brevity. Though I have also come to the proper solution for my situation.
    – Itanex
    Nov 14 at 23:16















Could you rip out the parameters and paste the actual values so that I can recreate the error?
– Pete
Nov 13 at 11:23




Could you rip out the parameters and paste the actual values so that I can recreate the error?
– Pete
Nov 13 at 11:23












@pete there are no special values that would be revealed by supplying them. all are strings, except the auditingState value which is a boolean. ListKeys pulls the value out of my storage account and that value is meant to stay secret by design. but in essence it is an alphanumeric string. Additionally, before the properties were added to the auditing Policy object, this script works
– Itanex
Nov 13 at 18:36





@pete there are no special values that would be revealed by supplying them. all are strings, except the auditingState value which is a boolean. ListKeys pulls the value out of my storage account and that value is meant to stay secret by design. but in essence it is an alphanumeric string. Additionally, before the properties were added to the auditing Policy object, this script works
– Itanex
Nov 13 at 18:36













Sure - but I just want to copy and paste the template to recreate the problem, I don't want to parse the functions out. It was 1:00am and I was too tired.
– Pete
Nov 13 at 21:12




Sure - but I just want to copy and paste the template to recreate the problem, I don't want to parse the functions out. It was 1:00am and I was too tired.
– Pete
Nov 13 at 21:12












@pete I updated the question with the details you requested. I had left them out for brevity. Though I have also come to the proper solution for my situation.
– Itanex
Nov 14 at 23:16




@pete I updated the question with the details you requested. I had left them out for brevity. Though I have also come to the proper solution for my situation.
– Itanex
Nov 14 at 23:16












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










I have found the answer after connecting with Azure Support.



The resource type: Microsoft.Sql/servers/auditingPolicies is no longer supported and in the next few weeks Azure Resource Manager will no longer support this completely.



This resource type refers directly to table auditing, which has been reported as being deprecated for blob auditing. Though the documentation at this time does not directly report it. The docs will be updated in the coming days after this post, by the owners.



To enable the auditing you need to use the Microsoft.Sql/servers/auditingSettings object. The documentation on this is coming and until it does you will be directed to documentation for the database version of this resource type Microsoft.Sql/servers/databases/auditingSettings.



Auditing settings work much like the Auto-Tuning advisors. You can set either server or database level settings. The server settings will be inherited by the database if the database has not been configured directly.



This is a sample of the auditingSettings object that I use instead of the auditingPolicies object above. It is nested just the same.




"apiVersion": "2017-03-01-preview",
"type": "auditingSettings",
"name": "DefaultAuditingSettings",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()]))]",
"storageCopy"
],
"properties":
"state": "Enabled",
"storageEndpoint": "[reference(concat('Microsoft.Storage/storageAccounts', '/', variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').primaryEndpoints.blob]",
"storageAccountAccessKey": "[listKeys(concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').keys[0].value]",
"storageAccountSubscriptionId": "[subscription().subscriptionId]",
"isStorageSecondaryKeyInUse": false,
"retentionDays": "30"







share|improve this answer




















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53231398%2finternal-server-error-when-deploying-arm-template%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    I have found the answer after connecting with Azure Support.



    The resource type: Microsoft.Sql/servers/auditingPolicies is no longer supported and in the next few weeks Azure Resource Manager will no longer support this completely.



    This resource type refers directly to table auditing, which has been reported as being deprecated for blob auditing. Though the documentation at this time does not directly report it. The docs will be updated in the coming days after this post, by the owners.



    To enable the auditing you need to use the Microsoft.Sql/servers/auditingSettings object. The documentation on this is coming and until it does you will be directed to documentation for the database version of this resource type Microsoft.Sql/servers/databases/auditingSettings.



    Auditing settings work much like the Auto-Tuning advisors. You can set either server or database level settings. The server settings will be inherited by the database if the database has not been configured directly.



    This is a sample of the auditingSettings object that I use instead of the auditingPolicies object above. It is nested just the same.




    "apiVersion": "2017-03-01-preview",
    "type": "auditingSettings",
    "name": "DefaultAuditingSettings",
    "dependsOn": [
    "[resourceId('Microsoft.Sql/servers', concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()]))]",
    "storageCopy"
    ],
    "properties":
    "state": "Enabled",
    "storageEndpoint": "[reference(concat('Microsoft.Storage/storageAccounts', '/', variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').primaryEndpoints.blob]",
    "storageAccountAccessKey": "[listKeys(concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').keys[0].value]",
    "storageAccountSubscriptionId": "[subscription().subscriptionId]",
    "isStorageSecondaryKeyInUse": false,
    "retentionDays": "30"







    share|improve this answer
























      up vote
      0
      down vote



      accepted










      I have found the answer after connecting with Azure Support.



      The resource type: Microsoft.Sql/servers/auditingPolicies is no longer supported and in the next few weeks Azure Resource Manager will no longer support this completely.



      This resource type refers directly to table auditing, which has been reported as being deprecated for blob auditing. Though the documentation at this time does not directly report it. The docs will be updated in the coming days after this post, by the owners.



      To enable the auditing you need to use the Microsoft.Sql/servers/auditingSettings object. The documentation on this is coming and until it does you will be directed to documentation for the database version of this resource type Microsoft.Sql/servers/databases/auditingSettings.



      Auditing settings work much like the Auto-Tuning advisors. You can set either server or database level settings. The server settings will be inherited by the database if the database has not been configured directly.



      This is a sample of the auditingSettings object that I use instead of the auditingPolicies object above. It is nested just the same.




      "apiVersion": "2017-03-01-preview",
      "type": "auditingSettings",
      "name": "DefaultAuditingSettings",
      "dependsOn": [
      "[resourceId('Microsoft.Sql/servers', concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()]))]",
      "storageCopy"
      ],
      "properties":
      "state": "Enabled",
      "storageEndpoint": "[reference(concat('Microsoft.Storage/storageAccounts', '/', variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').primaryEndpoints.blob]",
      "storageAccountAccessKey": "[listKeys(concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').keys[0].value]",
      "storageAccountSubscriptionId": "[subscription().subscriptionId]",
      "isStorageSecondaryKeyInUse": false,
      "retentionDays": "30"







      share|improve this answer






















        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        I have found the answer after connecting with Azure Support.



        The resource type: Microsoft.Sql/servers/auditingPolicies is no longer supported and in the next few weeks Azure Resource Manager will no longer support this completely.



        This resource type refers directly to table auditing, which has been reported as being deprecated for blob auditing. Though the documentation at this time does not directly report it. The docs will be updated in the coming days after this post, by the owners.



        To enable the auditing you need to use the Microsoft.Sql/servers/auditingSettings object. The documentation on this is coming and until it does you will be directed to documentation for the database version of this resource type Microsoft.Sql/servers/databases/auditingSettings.



        Auditing settings work much like the Auto-Tuning advisors. You can set either server or database level settings. The server settings will be inherited by the database if the database has not been configured directly.



        This is a sample of the auditingSettings object that I use instead of the auditingPolicies object above. It is nested just the same.




        "apiVersion": "2017-03-01-preview",
        "type": "auditingSettings",
        "name": "DefaultAuditingSettings",
        "dependsOn": [
        "[resourceId('Microsoft.Sql/servers', concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()]))]",
        "storageCopy"
        ],
        "properties":
        "state": "Enabled",
        "storageEndpoint": "[reference(concat('Microsoft.Storage/storageAccounts', '/', variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').primaryEndpoints.blob]",
        "storageAccountAccessKey": "[listKeys(concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').keys[0].value]",
        "storageAccountSubscriptionId": "[subscription().subscriptionId]",
        "isStorageSecondaryKeyInUse": false,
        "retentionDays": "30"







        share|improve this answer












        I have found the answer after connecting with Azure Support.



        The resource type: Microsoft.Sql/servers/auditingPolicies is no longer supported and in the next few weeks Azure Resource Manager will no longer support this completely.



        This resource type refers directly to table auditing, which has been reported as being deprecated for blob auditing. Though the documentation at this time does not directly report it. The docs will be updated in the coming days after this post, by the owners.



        To enable the auditing you need to use the Microsoft.Sql/servers/auditingSettings object. The documentation on this is coming and until it does you will be directed to documentation for the database version of this resource type Microsoft.Sql/servers/databases/auditingSettings.



        Auditing settings work much like the Auto-Tuning advisors. You can set either server or database level settings. The server settings will be inherited by the database if the database has not been configured directly.



        This is a sample of the auditingSettings object that I use instead of the auditingPolicies object above. It is nested just the same.




        "apiVersion": "2017-03-01-preview",
        "type": "auditingSettings",
        "name": "DefaultAuditingSettings",
        "dependsOn": [
        "[resourceId('Microsoft.Sql/servers', concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()]))]",
        "storageCopy"
        ],
        "properties":
        "state": "Enabled",
        "storageEndpoint": "[reference(concat('Microsoft.Storage/storageAccounts', '/', variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').primaryEndpoints.blob]",
        "storageAccountAccessKey": "[listKeys(concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').keys[0].value]",
        "storageAccountSubscriptionId": "[subscription().subscriptionId]",
        "isStorageSecondaryKeyInUse": false,
        "retentionDays": "30"








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 14 at 22:40









        Itanex

        869921




        869921



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53231398%2finternal-server-error-when-deploying-arm-template%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

            Syphilis

            Darth Vader #20