none
Enable Soft delete using ARM Template RRS feed

All replies

  • You can find the ARM Template reference to enable soft delete on key vault.

    From the document:

    "enableSoftDelete" is an optional boolean property to specify whether the 'soft delete' functionality is enabled for this key vault. It does not accept false value.
    

    Note: It is also possible to adjust the existing template to allow soft-delete by adding the key-value pair

    "enableSoftDelete": true

    to the properties section of the KeyVault resource. (See guide.)

    Also, if you want to enable it outside the scope of a template deployment it is possible via manipulating the resource through PowerShell:

    $vaultName = "keyVaultName1"
    
    ($resource = Get-AzureRmResource -ResourceId (Get-AzureRmKeyVault -VaultName $vaultName).ResourceId).Properties | Add-Member -MemberType "NoteProperty" -Name "enableSoftDelete" -Value "true"
    
    Set-AzureRmResource -resourceid $resource.ResourceId -Properties $resource.Properties


    Please take a moment to "Mark as Answer" and/or "Vote as Helpful" wherever applicable. Thanks!



    Tuesday, July 9, 2019 11:10 PM
    Moderator
  • Hi Marilee,

    I am trying to achieve the same using ARM template but it keeps giving the error of SKU is invalid by using the above reference template link as it keeps trying to creating a new one.

    can you please tell me how this can be done using ARM template on existing keyvault. The template I am using is this but it keeps throwing sku error

    {
        "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {},
        "resources": [
            {
                "type": "Microsoft.KeyVault/vaults",
                "apiVersion": "2018-02-14",
                "name": "[parameters('vault_name')]",,
                "location": "[resourcegroup().location]",
                "properties": {
                    "enableSoftDelete": true
                }
            }
        ]
    }

    Wednesday, July 10, 2019 5:16 AM
  • any updates
    Wednesday, July 17, 2019 10:32 AM
  • Sorry for the late reply! What's the error you received? If you provide some detail I can check with the author of that template.


    Please take a moment to "Mark as Answer" and/or "Vote as Helpful" wherever applicable. Thanks!

    Wednesday, July 17, 2019 10:46 PM
    Moderator
  • Feel free to reach me at AzCommunity@microsoft.com if that's easier. 

    Please take a moment to "Mark as Answer" and/or "Vote as Helpful" wherever applicable. Thanks!

    Wednesday, July 17, 2019 10:46 PM
    Moderator
  • I am checking in to see if you were able to resolve the issue. If you are still facingt his problem, can you share the complete error?
    Tuesday, July 23, 2019 9:01 AM
    Moderator
  • I'm following up on this, please remember to mark one of the responses as answer if your question has been answered. If not please let us know if there are anymore questions. Thanks
    Friday, July 26, 2019 10:51 PM
    Moderator