Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

http://localhost:9999/api/DataFunction

This returns a json string no problem.

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

https://datafunctionxxxxxxxxxxxxx.azurewebsites.net/

The app has hard coded data as I am new to Function Apps and this was a test.

What have I missed, do I need to do something else?
I published from VS2022 to Azure with all the default settings.

>Solution :

Have you tried appending api/DataFunction on to the end of your 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.

https://datafunctionxxxxxxxxxxxxx.azurewebsites.net/api/Datafunction&code=<keyhere>

You can obtain this from the Azure Portal

Get function URL

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading