The Azure Key Vault that is provided by Microsoft is a cloud management service that allows the user to encrypt their sensitive information by using keys that are protected by hardware security modules. Generally, Azure Key Vault is a tool that can be used to secure the keys by storing and certificates. We can use them from the Vault when needed. For securing our information like password, connection string in a secure way we can use Azure Key Vault. A vault is a logical group of secrets.
By the way, anybody with the Azure Subscription can create and use key vaults. It can be implemented and managed by the organization’s administrator to manage the services. Let’s say for an example: An Administrator can create a vault for the organization to store the keys and operational tasks like
An important point I would like to mention is the secret keys can be protected by software or FIPS 140-2 level 2 validated HSMs.
Prerequisites
Step 1
Sign in to the online Microsoft Azure Portal.
Step 2
From the Azure portal menu, or from the Home page, select Create a resource. In the Search box, enter Key Vault. From the results list, choose Key Vault. On the Key Vault section, choose to Create.
Now we need to provide some of the basic requirements for creating the key vaults like
Step 3
Now we need to select the Access Policy and leave the rest values to be in default and select >> Review + Create.
Step 4
Select >> Create for creating an Azure Key Vault and it can take few minutes for setting up and the Azure Key Vault will be created.
Step 5
Select >> Secrets from the left side menu and click >> Generate/ Import and copy the secret identifier to the clipboard so that it can be used later.
Step 6
Create a Function App and for creating an Azure Function App you can refer to the following link.
Select the Function App >> and select Identity from the platform features.
Step 7
Copy the Object ID using copy board and it can be used later
Step 8
Now Select >> Access Policies from the Key Vault and we can see current Access Policies, select >> Add Access Policy and fill the values and select >> Add.
Step 9
Now switch back again to function app and select >> Configuration in platform features and copy the value to the clipboard so that we can use it later and Click >> Ok.
After that the application setting will be added
Step 10
Open Visual Studio 2019 or 2017, Click >> New project and select >> Function App
Replace the following application setting value inside of it and publish the code.
So that we can check in the Azure portal, copy your newly deployed function and after put in URL with a browser.
In this article, we discussed how to create secure the Azure Function Apps using the Azure Key Vault.
#azure #Key Vault #security #devops