top of page

Storing values in Azure Key Vault and retrieving with Power Automate



Contents:



Hey,


How are you doing?


I have been playing around with this cool free API for pollen counts and air quality indexes, you can find it here - https://docs.ambeedata.com/


Intro


They use an API key inside the header of the GET request, and I wasn't too keen on it being exposed inside the flow, so I started looking at Azure Key Vault.


Azure Key Vault allows you to safely store API keys and other information securely inside Azure and then through a premium Power Automate connector you can retrieve the secret when you need to use it.


I had some teething problems in connecting it to the connector in the cloud flow, so I wanted to take the time in the post to explain what those issues were and how I got around them.


Creating the Key Vault in Azure


First things first. We need to create the Key Vault in Azure. You will need a subscription for this or have signed up for the free £200 worth of credit. The cost of the calls is something like £0.02p per 10,000 calls.


Head over to https://portal.azure.com and login.


Once here, search for Key Vault, select it and then click on Create, you will be presented with the page below:


Click Review + Create and wait for validation to finish, then wait for the deployment to complete and then click Go to resource:




Click Secrets:




Click on Generate/Import.


Give the secret a name and make a note of this.


Copy your API key that you want in the Vault inside the Value text box, and click create:


When you get back to the Key Vault resource page, click on Access control (IAM) and then click on Add role assignment button in the "Grant access to this resource" area:



Select the Owner role, click the Members tab and click Select members and add yourself to the role.


Configure Azure Key Vault Connection in Power Automate


Now we have configured the Key Vault in Azure, we can now head over to Power Automate and create the connection.


To do this:




  • Add in the Vault name

  • Click save

Create the Power Automate Cloud Flow to access the Key Vault and secret


Now we can head back to https://flow.microsoft.com and create a new flow. For now, we will create an instant cloud flow as this is just a test. Search for Azure Key Vault, and then choose the Get Secret action:


Once we have done that, we need to choose our key vault secret name value. If it is not there, click Enter custom value and get the name of your key vault secret name value.


I hope this helps you.


Have a great weekend!


Jon

2,946 views0 comments

Recent Posts

See All

First

Comments


bottom of page