Azure Pills 1 - Load Azure Key Vault Secrets within your local environment

Hello folks! Today we'll learn how to connect to Azure Key Vault within our local environment to read secrets.

Contents

    Context

    I’m currently working inside a small team of developer and we were facing some issues when developing a micro service architecture project. All the environmental variables were spread inside files everywhere. We decided to start using Azure Key Vault to manage and easily access those secrets. Now, let’s be honest: how many times did you accidentally push some secrets that were somewhere in your code? Well that’s a bad practice first of all, so let’s dig in to find a solution for this problem.

    What is Azure Key Vault?

    Azure Key Vault is a cloud service that provides a secure store for secrets. You can securely store keys, passwords, certificates, and other secrets.

    Prerequisites

    Active Azure Account

    If you don’t have one you can create a free Azure Account using this link.

    Install Azure CLI

    To use Azure Key Vault locally the first thing to do is to install the Azure CLI. You can find the installation process on the Microsoft Site using this link.

    After the Azure CLI installation it’s necessary to restart any open terminal to use the next command.

    Login to Azure inside terminal

    Now it’s time to remember some passwords! Open your favourite terminal and execute the following command:

    $ az login

    This message will popup immediately

    and this page will open in the browser

    Insert your Azure Portal credentials and procede to login.

    That’s it! Now it’s possible to use Key Vaults secrets right in your local environment!
    If you need other ways to login inside your Azure Account you can follow this link.


    Comments

    Popular Posts