在ADF(Azure Data Factory)中,调用Azure Function App中的Function,遇见了 Failed to get MI access token
There was an error while calling endpoint with error message - 'Failed to get MI access token. The error message is: Acquire MI token from AAD failed.
ErrorCode: invalid_resource,
Message: AADSTS500011: The resource principal named https://xxxxxxxxxx.chinacloudsites.cn was not found in the tenant named ***************.
This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant.
You might have sent your authentication request to the wrong tenant.
错误截图如下:
那么,如何来解决 Acquire MI Token from AAD Failed 的问题呢?
出现Failed to get MI access token的问题,主要原因是: 在Azure Function Link Service 时,选择了Authentication Method为 System Assigned Managed Identity。
如果输入的是其他值,则错误消息中,包含您输入的Resource ID值。如下图所示:
所以,解决这个问题的关键就是在ADF的Link Service中,配置正确的Resource ID(即被访问资源所生产的System Managed Identity App(Client) ID)。
具体的操作步骤,参考文章:https://www.cnblogs.com/lulight/articles/17195587.html