...

/

Integrating Web Apps with Azure Key Vault

Integrating Web Apps with Azure Key Vault

Learn about a vital security measure for web apps, i.e., integrating them with Azure Key Vault.

If we have to use Azure web apps, we would choose a framework as per the technology stack our organization is following. This could be Python, Java, .NET, and so on. Now, we might have some APIs for them, and to fetch data or save data, they have to be connected to databases.

So, to establish a connection with the database, we have to specify its connection string. Now, this connection string is defined at the code level in the web app. Specifying the connection string like that is not a recommended practice. So, in the following demo, we’ll see how we can use Azure Key Vault to manage it.

Demo: Key Vault integration

Create a storage account, get its access keys, and set up a Key Vault and a Secrets object. After that, register applications on the Microsoft Entra ID. Let’s look at the steps:

Creating a storage account and getting access keys

  1. Use the following command to create a key_vault_demo named resource group:
Press + to interact
az group create --location westus --name key_vault_demo
  1. Now that we have a resource group, use the following command to create a vaultstoragedemo named storage account.
Press + to interact
az storage account create -n vaultstoragedemo -g key_vault_demo -l westus --sku Standard_LRS
  1. The next step is to get the connection string of the storage account we’ve created. Use the
...