IMPLEMENTING AZURE KEY VAULT
Tags: azure, cloud, tutorial, cloudcomputing
Published: 2024-07-06 01:36:22

Azure Key Vault (AKV) is a cloud-based security service that provides secure storage, management, and deployment of sensitive data, such as:
- Encryption and Cryptographic keys
- Certificates (SSL/TLS, Azure, etc.)
- Secrets (passwords, credentials, etc.)

AKV offers:
- Secure storage in a Hardware Security Module (HSM)
- Centralised management and organisation
- Access control and authentication
- Encryption and decryption services
- Key rotation and revocation
- Auditing and logging
- Integration with Azure services and applications

In this tutorial, I will be demonstrating how to access Azure Key Vault and utilising one of its capabilities to add a secret to the vault.

## **PREREQUISITE**
- Working computer
- Internet connection
- Microsoft Azure account + active subscription

## **PROCEDURE**
### **LOCATE THE AZURE KEY VAULT SERVICE**
Open the Azure portal and type “Key Vault” in the search bar at the top. Click on “Key vaults” under services as seen in the image below.

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

### **CREATE AN AZURE KEY VAULT**
On the Key Vault service webpage that loads, click on the “Create” or “Create key vault” button as you deem fit.

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

You will be directed to the “Basics” page.

The first part of the “Basics” page is the “Project details” section where you are asked to select the subscription and resource group under which you want to create the key Vault.
_PS: In case you want a new resource group, creating a resource group just requires you to provide a name in the input box provided after clicking on “Create new” beneath the “Resource group” input box._
The next section is “Instance details” where you can input a Key Vault name of choice, select a region and pricing tier as required.
Afterwards, click on the “Review + create” button.

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

A page as shown should appear showing the specifications selected and the details of the key vault.
Click on the “Create” button.

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

There will be a pop-up at the top right showing the status of the deployment.

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

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

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

You will be directed to a key vault deployment page which goes through several phases that you might need to be patient for.

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

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

When deployment has been completed, click on “Go to resource”.

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

The key vault resource page loads.

### **ADD ROLE ASSIGNMENTS**
On the resource page, click on “Access control (IAM)” on the side menu.

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

On the page that loads, click on “Add” then, “Add role assignment”

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

The “Role” page loads. Click on a suitable role (in this case, Key Vault Administrator) and then, click on the “Next” button.

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

On “Members” page, click on “Select members”.

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

On the pop-up window, select member by clicking on the user and then the “Select” button.

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

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

Click on “Review + assign” button.
There will be a pop-up at the top right showing the progress.

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

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


### **CREATE SECRET**
Once it is added, navigate to the menu and click on “Objects”, then “Secrets”.

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

On the “Secrets” page, click on “Generate/Import”.

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

On the page that loads, input secret name and value (password), set activation and expiry dates. Click on “Create”.

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

You should have a newly created secret in your azure key vault right about now.

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

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