Secure Secrets: A beginner's guide to creating and securing Azure Key Vaults
Tags: azure, security, cloud, tutorial
Published: 2023-05-11 21:37:04

Azure Key Vault is a Microsoft Azure cloud-based service that allows you to securely store and manage keys, certificates, and secrets. It also allows you to securely control key and secret access permissions and access logging.

The number of days to retain deleted items in an Azure Key Vault can be configured by the user within a range of minimum to maximum values. The minimum retention period for deleted items in an Azure Key Vault is 7 day and the maximum retention period for deleted items in an Azure Key Vault is 90 days.  

Once the retention period has expired, deleted items will be purged from the Key Vault and cannot be recovered. Therefore, it's important to carefully consider the retention period setting and ensure it aligns with your specific needs and compliance requirements.


In this blog post, we will walk you through the step-by-step process of creating an Azure Key Vault.

Log in to the Azure Portal using this [link](https://azure.microsoft.com/en-gb/free/) 

Search for "**_Key Vault_**" in the search bar.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s07zaoeaod6crev2kk58.png)

Click on "**_Key Vault_**" from the results and then click on the "Create" button.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dxbibybu8nkybzunbd5e.png)

Create a New Resource Group

After selecting subscription, create a new resource group. Click on "**_create new_**" and give it a name

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rwy969dyu8xx245spu1c.png)

Fill in the details for the "**_Key Vault name_**". We have named our Key vault "confidentialthings"


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vkzbmx0vaul8i2gc65w3.png)

Select the amount of days to retain deleted vault (7 - 90 days) and then click on "_**Review + create**_" 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z9d0t2q9d2h5rvrkzicc.png)

Click on "**_Create_**" to create the Key Vault

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h717jk3aw696zipc14fj.png)

Click on the "**_Go to resource_**" button 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fp64dzcky728awc6uygz.png)

## Create a Key

To create a Key, navigate to the Key Vault you just created, and click on the "Keys" tab

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x01zfcjw2ws9gxiv9b59.png)

Click on the "**_Generate/Import_**" button to create a new key, and fill in the details, such as the name, key type, and size

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f03a7djufa7r1rs72v4s.png)

Click on "**_Create_**" to create the Key

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3b9sbdzrzckv00381v5c.png)

## Create a Secret

To create a Secret, navigate to the Key Vault you just created, and click on the "**_Secrets_**" tab. Click on the "Generate/Import" button to create a new secret

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/haytscgijbfw7pgixo0a.png)

Fill in the details, such as the name, value, and content type. Click on "**_Create_**" to create the Secret

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2gzck8djrkn2nt9mvx98.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9aa5mo4e3n0jtzgytss1.png)


Once you've completed these steps, you should have a new Azure Key Vault, Key, and Secret. You can now use these resources to securely store and manage keys, certificates, and secrets for your Azure applications and services.