使用Azure功能和Azure Active Directory的ASP.NET Core Web App [英] ASP.NET Core Web App using Azure Functions with Azure Active Directory

查看:144
本文介绍了使用Azure功能和Azure Active Directory的ASP.NET Core Web App的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用VS 2019模板构建的ASP.NET核心Web应用程序(剃刀页面),并启用了Work / School帐户登录。好的,应用程序运行并进行身份验证。

I have an ASP.NET Core Web Application (razor pages) built using the VS 2019 template with Work/School account sign-in enabled. All good, the app runs and authenticates.

我有一些Azure功能配置了用户身份验证。

I have some Azure Functions which are configured with User authentication.

我希望我的网络应用程序是能够调用这些函数,因此我正在寻找有关如何配置工作的最新信息(即与当前门户网站体验相匹配)。目前经过几次尝试后,我只是在调用
函数时继续获得401。

I want my web app to be able to call the functions and so I'm looking for recent information (i.e. that matches the current portal experience) on how to configure things to work. Currently after several attempts I just keep getting 401's when calling the functions.

我希望所有这些都可以在没有复杂的令牌处理的情况下完成。

I'm hoping all this is possible without complex token handling.

推荐答案

您好,

Azure功能中的401可能是由于功能应用程序上的授权设置所致。 如果您从VS Code部署,那么它可能会在Azure的JSON的'bindings'对象下设置'user'auth。

A 401 in Azure Functions is likely due to the authorisation settings on the Function App.  If you deploy from VS Code then it will probably have 'user' auth set under the 'bindings' object of the JSON for this in Azure.

您可以将此设置为以下任何一项取决于您想要设置的内容。  

You can set this to any of the below depending on what you want to have set.  

如果要设置用户,则可以使用
Azure App Security
。 或者根据函数的调用方式,我发现由于API URL调用的长度,很多人都使用匿名。

If you want to set a user then you can use Azure App Security.  Or depending on how the functions are called, I see a lot of people use anonymous due to the length of the API URL call.

希望有帮助吗?

谢谢,

马特


这篇关于使用Azure功能和Azure Active Directory的ASP.NET Core Web App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆