【Azure Function App】在ADF(Azure Data Factory)中调用 Azure Function 时候遇见 Failed to get MI access token

简介: 【Azure Function App】在ADF(Azure Data Factory)中调用 Azure Function 时候遇见 Failed to get MI access token

问题描述

在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。

  • 如果Funcation App没有启用认证(Authentication),只需要选择Anonymous(匿名)访问模式即可解决 Failed to get  MI access token 问题。
  • 但是只要选择了 System Assigned Managed Identity认证方式,在Resource ID的输入框中,没有输入任何内容。所以它默认使用了Function App 的 host url 作为 resource principal named。

如果输入的是其他值,则错误消息中,包含您输入的Resource ID值。如下图所示:

所以,解决这个问题的关键就是在ADF的Link Service中,配置正确的Resource ID(即被访问资源所生产的System Managed Identity App(Client) ID)。

具体的操作步骤,参考文章:https://www.cnblogs.com/lulight/articles/17195587.html

 

 

相关文章
|
2月前
|
存储 安全 数据安全/隐私保护
【Azure Function App】在Function App中使用System Managed Identity访问Storage Account
本文介绍了如何在Azure Function中使用托管身份(Managed Identity)替代AzureWebJobsStorage连接函数应用到存储账户,以提高安全性并减少Access Key的使用。具体步骤包括:1) 启用系统分配的身份;2) 为函数应用授予存储访问权限,添加必要角色(如Storage Blob Data Contributor);3) 配置`AzureWebJobsStorage__blobServiceUri`参数指定Blob Service Uri。完成后删除旧配置,即可通过Managed Identity访问Storage Account。
107 20
|
7天前
|
C++ Windows
【Function App】本地通过VS Code调试Function时候遇见无法加载文件错误Microsoft.Extensions.Diagnostics.Abstractions
在使用 VS Code 调试 Azure Functions 时,执行 `func host start` 可能因版本冲突报错。错误信息显示 Rpc Initialization Service 启动失败,可能是由于缺少文件或组件导致。解决方法包括:1) 使用 npm 卸载并重新安装 Azure Functions Core Tools;2) 若问题未解决,重新下载安装包(如 func-cli-x64.msi)修复旧版本工具;3) 退出并重启 VS Code,重新加载项目即可恢复正常运行。参考资料链接提供了更多背景信息。
|
16天前
|
安全 Linux 开发工具
【Azure Function】分享把Function App从.NET 6.0升级到.NET 8.0 Isolated的步骤
本文介绍了将Azure Function App从.NET 6.0升级到.NET 8.0 Isolated的步骤。.NET 6.0作为长期支持版本,生命周期至2024年11月结束。为确保持续支持,建议升级至更新版本。升级步骤包括安装.NET 8 SDK、更新Azure Functions Core Tools、修改项目文件目标框架为net8.0、更新兼容的NuGet包、本地测试以及重新发布到Azure。更多详细信息可参考官方文档。
|
17天前
|
存储 数据可视化 开发工具
【Application Insights】Application Insights存储的Function App的日志存在"Operation Link" 为空的情况
在将 Azure Functions 升级到 .NET 8 和 Isolated Worker 模式后,Application Insights 的请求日志中 `operation_Link` 字段为空,导致分布式追踪无法正常关联。解决方法包括:确保引用正确的 SDK 包(如 `Microsoft.Azure.Functions.Worker.ApplicationInsights`),正确配置 Application Insights 服务,移除默认日志过滤规则,并使用最新依赖包以支持分布式追踪。通过这些步骤,可恢复端到端事务视图的可视化效果。
45 10
|
30天前
【Function App】在PowerShell Function中指定特殊的Microsoft.Graph.Users版本
在Azure Function App中运行PowerShell Function时,通过Requirements.psd1文件管理模块版本。若需将“Microsoft.Graph.Users”从最新版2.26.0改回2.23.0以避免冲突,可通过以下步骤解决:1) 在requirements.psd1中明确指定版本为2.23.0 2) 在profile.ps1中添加`Import-Module Microsoft.Graph.Users -RequiredVersion 2.23.0`语句。此方法确保加载特定版本模块
55 18
|
1月前
|
API Go 网络架构
【Azure Logic App】特殊的方法来停止正常步骤无法停止的Workflow Job
本文介绍了一种特殊方法,用于解决标准版Logic App在异常情况下无法正常停止的问题。当点击Cancel按钮报错“WorkflowRunCanNotBeCancelled”时,可通过以下步骤解决:进入Logic App的Kudu页面,定位到`C:\home\site\wwwroot`目录下的`host.json`文件,添加`Jobs.SuspendedJobPartition`和`Jobs.CleanupJobPartition`参数,并以大写格式设置值为`"<WORKFLOWID>:2D<RUNID>"`。调整后可成功停止异常Job
74 18
|
2月前
【Logic App】获取Azure Logic App在执行的标识值 Identifier
本文介绍了如何在Logic App中记录执行标识符以方便问题排查。通过添加一个变量(如RequestTrackingID),将其值设为`workflow()['run']['name']`,可实现将Logic App执行的Identifier与业务数据关联。这样,在排查问题时,可通过日志中的关键信息快速定位对应的Logic App执行记录,提升效率。文中还提供了操作步骤及参考资料,帮助用户更好地理解和实现该方法。
71 10
|
2月前
|
Linux
【Function App】记录一次 "OSError: Could not find a suitable TLS CA certificate bundle" 错误
错误信息:We get an error in function app. Exception: OSError: Could not find a suitable TLS CA certificate bundle, invalid path: /home/site/wwwroot/.python_packages/lib/site-packages/certifi/cacert.pem This issue happened by chance. This appears to be a platform issue with Function Apps running on Linux
|
2月前
|
人工智能 Python
083_类_对象_成员方法_method_函数_function_isinstance
本内容主要讲解Python中的数据类型与面向对象基础。回顾了变量类型(如字符串`str`和整型`int`)及其相互转换,探讨了加法在不同类型中的表现。通过超市商品分类比喻,引出“类型”概念,并深入解析类(class)与对象(object)的关系,例如具体橘子是橘子类的实例。还介绍了`isinstance`函数判断类型、`type`与`help`探索类型属性,以及`str`和`int`的不同方法。最终总结类是抽象类型,对象是其实例,不同类型的对象有独特运算和方法,为后续学习埋下伏笔。
77 7
083_类_对象_成员方法_method_函数_function_isinstance
|
2月前
|
Python
[oeasy]python086方法_method_函数_function_区别
本文详细解析了Python中方法(method)与函数(function)的区别。通过回顾列表操作如`append`,以及随机模块的使用,介绍了方法作为类的成员需要通过实例调用的特点。对比内建函数如`print`和`input`,它们无需对象即可直接调用。总结指出方法需基于对象调用且包含`self`参数,而函数独立存在无需`self`。最后提供了学习资源链接,方便进一步探索。
79 17

热门文章

最新文章