Azure-Functions icon indicating copy to clipboard operation
Azure-Functions copied to clipboard

Names of _master and default secret in keyvault are not unique so function apps cannot share same keyvault

Open bujhie opened this issue 3 years ago • 8 comments

Function App name: doesn't matter Tools used: irrelevant New V4 app

We are trying to use multiple function apps for some data integration work and are trying to secure their configuration. So we are trying to follow the recommendations from here: https://learn.microsoft.com/en-us/azure/azure-functions/security-concepts?tabs=v4

We have managed to instantiate a function app and integrate with key-vault using a user-managed identity. We can see that the function app successfully creates two secrets _master and default. The problem is the names of these secrets are not unique: 'host--functionKey--default' and 'host--masterKey--master' (see screnshot) which means instantiating the second function app creates a broken function app with no keys or ability to create new ones: the option to create is greyed out but after a long wait I can initiate key creation which fails with "Encountered an error (InternalServerError) from host runtime." error.

The fact that default keys aren't uniquely named will also create an issue when one deletes the function app and creates a new one pointing to the same keyvault.

Also before you suggest we are not able to adopt the model where we allocate a dedicated keyvault instance to a function app.

image image image

bujhie avatar Dec 02 '22 01:12 bujhie

@bujhie We will discuss this issue with our next level team and update you.

ramya894 avatar Dec 07 '22 10:12 ramya894

@bujhie We will discuss this issue with our next level team and update you.

Thanks @ramya894. Very much looking forward to it

bujhie avatar Dec 08 '22 00:12 bujhie

@ramya894 Any updates?

avetkhov avatar Jun 15 '23 09:06 avetkhov

@ramya894 It is the same in our case. We just starting to move the functions keys from the default storage account to a keyvault (we share a keyvault across many function apps in the subscription), but this limitation is actually weird since should be a common way of working.

Do you have any news?

orestescu avatar Jul 10 '23 10:07 orestescu

I would be interested in a solution as well.

gegetoth avatar Mar 15 '24 10:03 gegetoth