简体   繁体   中英

User assigned managed identity in azure functions throwing value cannot be null

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.

在此处输入图片说明

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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM