HOW TO DEPLOY A KEY VAULT WITH KEY, SECRET AND CERTIFICATE ON AZURE
Tags: azure, webdev, beginners, programming
Published: 2023-03-15 11:43:45


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


Azure key vault is a cloud service used to store application secrets in a centralized cloud location in order to securely control access permissions and access loggings. these secrets are application credentials like passwords,Client application secrets,Connection strings,Access keys (Redis Cache, Azure Event Hubs, Azure Cosmos DB),SSH keys.

Key Vault service supports two types of containers: vaults and managed hardware security module(HSM) pools. Vaults support storing software and HSM-backed keys, secrets, and certificates. Managed HSM pools only support HSM-backed keys.

**STEPS TO DEPLOY KEY VAULT ON AZURE**

STEP 1
Login your Microsoft Azure account


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

STEP 2

Search for "key vault"


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

STEP 3

click on create


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


STEP 4

Fill in the boxes. Choose your subscription.
-Create/choose a resource group[mine was the marchworkload].
-Type in a unique keyvault name
-Choose a region of your choice and the pricing tier.
-Soft delete: This feature allows you to recover or permanently delete a key vault and secrets for the duration of the retention period. It is automatically enabled in a key vault.
-Days to retain deleted vaults: helps you choose between 7-90 days to recover your vault if it gets deleted by chance.
-Purge protection: It enforces mandatory retention period and prevents the permanent deleting of key vaults prior to the retention period elapsing.
Click on 'Review and create'

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

STEP 5

Click on Create


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


STEP 6

Go to Resource


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


STEP 7
Key vault now active

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

STEP 8

To create Keys
Search for 'Keys' and click on it

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

STEP 9
Choose a unique name
-Set an activation and expiration date
-You can choose to add a tag or not
Click on 'Create'


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

STEP 10
Key is created

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

STEP 11

To create Secrets in Key Vault,
Search for 'Secrets' and click on it,
Then click on 'Generate/Import'


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

STEP 12
-Choose a unique name
-Set an activation and expiration date
-You can choose to add a tag or not
Click on 'Create'


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

STEP 13
Secret has been created

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

STEP 14

To create Certificates in Key Vault,
Search for 'Certificates' and click on it,
Then click on 'Generate/Import'


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


STEP 15
-Method of Certificate Creation: Generate
-Create a unique name
-Subject - CN here stands for Common Name. Use any name of your choice but it must follow the required format. I used 'CN=Afolabicertificate.com'
-Fill the remaining boxes accordingly
Click on 'Create'


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


STEP 16

violla!!! Certificate has been created


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