Call Azure Function from Javascript

前端 未结 2 1505
你的背包
你的背包 2021-01-18 18:32

I have a simple HTML page which has a Textbox and a Submit Button. I have a Azure Function which when hit takes in the content of the textbox, which we should send to the Az

相关标签:
2条回答
  • 2021-01-18 19:17

    This is definitely a CORS related issue. Luckily, it's easy to configure CORS for Function Apps in the portal. Just navigate to your Function App and then select Platform Features:

    Select the CORS option under API which will take you to a screen where you can add the hostname of your clientside application:

    0 讨论(0)
  • 2021-01-18 19:30

    That looks like a cross origin request blocked. Normally you can't make a request from the browser to a different host. You will either need to use CORS or backend code.

    Notice the method of the request is OPTIONS instead of Post or Get. Typically this means the browser is blocking the call.

    Here is a link to a Node solution. https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook

    0 讨论(0)
提交回复
热议问题