Using Console
Using CLI
<your-key-vault-name>
with the name of your key vault, <your-key-name>
with the name of the identified key and <your-expiration-time>
with the desired expiration time for the key in the format YYYY-MM-DDTHH:MM:SSZ
.Using Python
AZURE_CLIENT_ID
, AZURE_CLIENT_SECRET
, and AZURE_TENANT_ID
.
ServicePrincipalCredentials
class. Then, we set the subscription ID and resource group name. Next, we create the ResourceManagementClient
and KeyVaultManagementClient
objects. Finally, we get the key vaults in the resource group and set the expiration time for each key using the set_secret
method of the KeyVaultManagementClient
object.Note: This code sets the expiration time for the keys to one year from the current date. You can modify this value as per your requirement.