|
| 1 | +--- |
| 2 | +title: Tutorial - Updating certificate's auto-rotation frequency in Key Vault | Microsoft Docs |
| 3 | +description: Tutorial showing how to update a certificate's auto-rotation frequency in Azure Key Vault using the Azure portal |
| 4 | +services: key-vault |
| 5 | +author: msmbaldwin |
| 6 | +manager: rkarlin |
| 7 | +tags: azure-resource-manager |
| 8 | + |
| 9 | +ms.service: key-vault |
| 10 | +ms.subservice: certificates |
| 11 | +ms.topic: tutorial |
| 12 | +ms.custom: mvc |
| 13 | +ms.date: 04/16/2020 |
| 14 | +ms.author: sebansal |
| 15 | +#Customer intent:As a security admin who is new to Azure, I want to use Key Vault to securely store certificates in Azure |
| 16 | +--- |
| 17 | +# Tutorial: Configuring certificate's auto-rotation in Key Vault |
| 18 | + |
| 19 | +Azure Key Vault lets you easily provision, manage, and deploy digital certificates. They could be public and private SSL/TLS certificates signed by Certificate Authority or a self-signed certificate. Key Vault can also request and renew certificates through partnerships with certificate authorities, providing a robust solution for certificate life cycle management. In this tutorial, you will update certificate's attributes - validity period, auto-rotation frequency, CA. For more information on Key Vault, review the [Overview](../general/overview.md). |
| 20 | + |
| 21 | +The tutorial shows you how to: |
| 22 | + |
| 23 | +> [!div class="checklist"] |
| 24 | +> * Manage a certificate using Azure portal |
| 25 | +> * Add Certificate Authority provider Account |
| 26 | +> * Update certificate's validity period |
| 27 | +> * Update certificate's auto-rotation frequency |
| 28 | +> * Update certificate's attributes using Azure Powershell |
| 29 | +
|
| 30 | + |
| 31 | +Before you begin, read [Key Vault basic concepts](../general/basic-concepts.md). |
| 32 | + |
| 33 | +If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin. |
| 34 | + |
| 35 | +## Sign in to Azure |
| 36 | + |
| 37 | +Sign in to the Azure portal at https://portal.azure.com. |
| 38 | + |
| 39 | +## Create a vault |
| 40 | + |
| 41 | +Create or select your existing Key Vault to perform operations. [(Steps to create a Key vault).](../quick-create-portal.md) In the example, the Vault name is **Example-Vault**. |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +## Create a certificate in Key Vault |
| 46 | + |
| 47 | +Create or import a certificate in the vault. [(Steps to create certificate in Key vault).](../quick-create-portal.md) In this case, we work on certificate called **ExampleCertificate**. |
| 48 | + |
| 49 | +> [!NOTE] |
| 50 | +> In Azure Key Vault, a certificate's life cycle attributes can be updated both at the time of certificate's creation as well as after it has been created. |
| 51 | +## Updating Certificate's life cycle attributes |
| 52 | + |
| 53 | +A certificate created in the Key Vault can be |
| 54 | +- a self-signed certificate |
| 55 | +- a certificate created with a Certificate Authority (CA) that is partnered with Key Vault |
| 56 | +- a certificate with a Certificate Authority that is not partnered with Key Vault |
| 57 | + |
| 58 | +The following Certificate Authorities are currently partnered providers with Key Vault: |
| 59 | +- DigiCert - Key Vault offers OV TLS/SSL certificates with DigiCert. |
| 60 | +- GlobalSign - Key Vault offers OV TLS/SSL certificates with GlobalSign. |
| 61 | + |
| 62 | +Azure Key Vault auto-rotates certificates through partnerships with certificate authorities. Through that established partnership, Key Vault automatically requests and renews certificates. Therefore, **auto-rotation capability is not applicable for certificates created with CAs that are not partnered with Key Vault.** |
| 63 | + |
| 64 | +> [!NOTE] |
| 65 | +> An account admin for a CA provider creates credentials to be used by Key Vault to create, renew, and use TLS/SSL certificates via Key Vault. |
| 66 | + |
| 67 | +> |
| 68 | +
|
| 69 | + |
| 70 | +### Updating Certificate's life cycle attributes at the time of Certificate creation |
| 71 | + |
| 72 | +1. On the Key Vault properties pages, select **Certificates**. |
| 73 | +2. Click on **Generate/Import**. |
| 74 | +3. On the **Create a certificate** screen update the following values: |
| 75 | + |
| 76 | + |
| 77 | + - **Validity Period**: Enter the value (in months). Creating short lived certificates is a recommended security practice. By default validity value of a newly created certificate is 12 months. |
| 78 | + - **Lifetime Action Type**: Select certificate's auto-renewal and alerting action. As per the selection, update 'percentage lifetime' or 'Number of days before expiry'. By default, a certificate's auto-renewal is set at 80% of its lifetime.<br> From the drop down menu, select the option : |
| 79 | + |
| 80 | + | Automatically renew at a given time| Email all contacts at a given time | |
| 81 | + |-----------|------| |
| 82 | + |Selecting this option will TURN ON autorotation | Selecting this option will NOT auto-rotate, it will only alert the contacts| |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | +4. Click on **Create**. |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | +### Updating Life cycle attributes of stored certificate |
| 91 | + |
| 92 | +1. Select the Key Vault. |
| 93 | +2. On the Key Vault properties pages, select **Certificates**. |
| 94 | +3. Select the certificate that you wish to update. In this case, we will work on certificate called **ExampleCertificate**. |
| 95 | +4. Select **Issuance Policy** from the top menu bar. |
| 96 | + |
| 97 | + |
| 98 | +5. On the **Issuance Policy** screen, update the following values: |
| 99 | +- **Validity Period**: Update the value (in months) |
| 100 | +- **Lifetime Action Type**: Select certificate's auto-renewal and alerting action. As per the selection, update the 'percentage lifetime' or 'Number of days before expiry'. |
| 101 | + |
| 102 | + |
| 103 | +6. Click on **Save**. |
| 104 | + |
| 105 | +> [!IMPORTANT] |
| 106 | +> Changing the Lifetime Action Type for a certificate will record modifications for the existing certificates immediately. |
| 107 | +
|
| 108 | + |
| 109 | +### Updating Certificate's attributes using PowerShell |
| 110 | + |
| 111 | +```azurepowershell |
| 112 | +
|
| 113 | +
|
| 114 | +Set-AzureKeyVaultCertificatePolicy -VaultName $vaultName |
| 115 | + -Name $certificateName |
| 116 | + -RenewAtNumberOfDaysBeforeExpiry [276 or appropriate calculated value] |
| 117 | +``` |
| 118 | + |
| 119 | +> [!TIP] |
| 120 | +> To modify renewal policy for a list of certificates, input File.csv containing |
| 121 | +> VaultName,CertName <br/> |
| 122 | +> vault1,Cert1 <br/> |
| 123 | +> vault2,Cert2 |
| 124 | +> |
| 125 | +> ```azurepowershell |
| 126 | +> $file = Import-CSV C:\Users\myfolder\ReadCSVUsingPowershell\File.csv |
| 127 | +> foreach($line in $file) |
| 128 | +> { |
| 129 | +> Set-AzureKeyVaultCertificatePolicy -VaultName $vaultName -Name $certificateName -RenewAtNumberOfDaysBeforeExpiry [276 or appropriate calculated value] |
| 130 | +> } |
| 131 | +> ``` |
| 132 | +> |
| 133 | +Learn more about the parameters [here](https://docs.microsoft.com/cli/azure/keyvault/certificate?view=azure-cli-latest#az-keyvault-certificate-set-attributes) |
| 134 | +
|
| 135 | +## Clean up resources |
| 136 | +
|
| 137 | +Other Key Vault quickstarts and tutorials build upon this quickstart. If you plan to continue on to work with subsequent quickstarts and tutorials, you may wish to leave these resources in place. |
| 138 | +When no longer needed, delete the resource group, which deletes the Key Vault and related resources. To delete the resource group through the portal: |
| 139 | +
|
| 140 | +1. Enter the name of your resource group in the Search box at the top of the portal. When you see the resource group used in this quickstart in the search results, select it. |
| 141 | +2. Select **Delete resource group**. |
| 142 | +3. In the **TYPE THE RESOURCE GROUP NAME:** box type in the name of the resource group and select **Delete**. |
| 143 | +
|
| 144 | +
|
| 145 | +## Next steps |
| 146 | +
|
| 147 | +In this tutorial, you updated a certificate's life-cycle. To learn more about Key Vault and how to integrate it with your applications, continue on to the articles below. |
| 148 | +
|
| 149 | +Read more about [Managing certificate creation in Azure Key Vault](https://docs.microsoft.com/azure/key-vault/certificates/create-certificate-scenarios) |
| 150 | +- Review the [Key Vault Overview](../general/overview.md) |
0 commit comments