0
votes

I have a http post azure functions that is created using power shell 6.2. It requires access to azure key vault to retrieve secrets. It works perfectly when I assign system assigned managed identity. However, getting the attached error whilst executing with user assigned managed identity.

What I have done so far.

  1. Created a user assigned managed identity under azure managed identity service.
  2. Added a contributor role in my KeyVault Access control(IAM) -> in the assign access drop down I chose user assigned managed identity.
  3. Also, in the KeyVault access policy section, added newly created user assigned identity with get and list secret permissions
  4. Finally added the new user assigned managed identity in the azure function's identity tab.

I have read that user assigned managed identity requires clinet_id but no idea where to configure it in the azure function's post request.

enter image description here

2

2 Answers

0
votes

Using the REST protocol, you can refer to this article to append a clientid query parameter like this,

GET /MSI/token?resource=https://vault.azure.net&api-version=2017-09-01&clientid=xxxx 

With SDK, you can specify the clientid in the connection string, refer to https://docs.microsoft.com/en-us/azure/key-vault/service-to-service-authentication#connection-string-support

enter image description here