Update activation and expiry date of key in AKV using ARM template

Anonymous
2024-08-22T06:29:08.69+00:00

Hi,

I need to update activation and expiry date of key in AKV using ARM template.

Is there ARM equivalent of HTTP Call https://learn.microsoft.com/en-us/rest/api/keyvault/keys/update-key/update-key?view=rest-keyvault-keys-7.4&tabs=HTTP#examples ?

I checked with ARM template here :

https://learn.microsoft.com/en-us/azure/key-vault/keys/quick-create-template?tabs=CLI

but it gave me below error:

"details": [ { "code": "BadRequest", "message": "{\r\n "error": {\r\n "code": "KeyCreationParametersDidNotMatchExistingKey",\r\n "message": "[KeyCreationParametersDidNotMatchExistingKey (BadRequest)] The key 'test11' already exists, but the specified key creation parameters did not match that of the existing key (The existing key has a not before date of '1724302688', which doesn't match the given not before date '1724371200'.). This API can only be used for creating the first version of a new key (no subsequent versions can be created, and existing keys cannot be updated)."\r\n }\r\n}" } ] }

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,454 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Deepanshu katara 16,945 Reputation points MVP Moderator
    2024-08-22T07:14:23.11+00:00

    Hello , Welcome to MS Q&A

    Azure Key Vault using an ARM template is not possible. According to the documentation, it's only possible to create new keys via ARM template, and it isn't possible to update existing keys or create new versions of existing keys. If the key already exists, then the existing key is retrieved from storage and used (no write operations will occur). To update the activation and expiry date of a key, you can use the Azure portal, Azure PowerShell, Azure CLI, or REST API.


    References:

    Please let me know if any questions

    kindly accept answer if it helps

    Thanks

    Deepanshu

    0 comments No comments

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.