Azure Key Vault without Azure Libraries in Playwright (Part 2)

Kam Marwaha
2 min readOct 25, 2023

--

This tutorial assumes you have created a new Azure Key Vault. If not, please click here to do that.

First we need to create an ‘App Registration’ so that we can access the Key Vault through the API.

In the Azure portal, go to ‘App Registrations’ and create a new one. This can be named whatever you want, just make a note of that name as we’ll need it later on. We don’t need to change the ‘Supported account types’, so you can stick with the default option. Nor do we need to set a ‘Redirect Url’

Once we have done this, go into the newly created App Registration, select the ‘Certificates & secrets’ page and click ‘New client secret’, set the name to whatever you want (this isn’t important right now) and set an expiry date to something you’re comfortable with that makes sense.

You’ll then see a value generated, this is will be hidden as soon as you click off this page, so please make a note of this as you’ll need this later.

Then you’ll set API Permissions, so click on API permissions on the side bar. Click ‘Add a permission’, select ‘Azure Key Vault’ and select ‘user_impersonation’ and that all we have to do for ‘App Registration.’

Setting app permissions for app registration

Now we want to allow the App Registration have access to the Key Vault so go to your Azure Key Vault. Click ‘Access policies’ then ‘Create’, select the permissions required — for this tutorial we’ll select all. Then in the ‘Principal’ selection find your App Registration name and create.

Now, head over to Part 3 which is the final part of this series.

--

--