[英]How do I get my Azure C# function app to return json?
I have a function app which I run locally to test and all is fine我有一个 function 应用程序,我在本地运行它进行测试,一切正常
http://localhost:9999/api/DataFunction
This returns a json string no problem.这返回一个 json 字符串没问题。
However when I publish and connect to the url from Azure I just get the " Your Functions 4.0 app is up and running " page.但是,当我从 Azure 发布并连接到 url 时,我只看到“您的 Functions 4.0 应用程序已启动并正在运行”页面。
https://datafunctionxxxxxxxxxxxxx.azurewebsites.net/
The app has hard coded data as I am new to Function Apps and this was a test.该应用程序具有硬编码数据,因为我是 Function 应用程序的新手,这是一个测试。
What have I missed, do I need to do something else?我错过了什么,我需要做其他事情吗? I published from VS2022 to Azure with all the default settings.
我使用所有默认设置从 VS2022 发布到 Azure。
Have you tried appending api/DataFunction
on to the end of your URI:您是否尝试过将
api/DataFunction
附加到 URI 的末尾:
https://datafunctionxxxxxxxxxxxxx.azurewebsites.net/api/Datafunction
If you are using function level authentication then you will also have an authentication key as a query string.如果您使用 function 级别的身份验证,那么您还将拥有一个身份验证密钥作为查询字符串。
https://datafunctionxxxxxxxxxxxxx.azurewebsites.net/api/Datafunction&code=<keyhere>
You can obtain this from the Azure Portal您可以从 Azure 门户网站获取
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.