Azure Function App Error: Failed to Fetch - TypeError in Extend Function

Yue Zhao 0 Reputation points
2024-11-12T15:35:58.87+00:00

Hello everyone,

I'm encountering an issue while testing my Azure Function App, specifically in the "extend" function. I'm receiving the following error:

Error: {"message":"Failed to fetch","stack":"TypeError: Failed to fetch\n at https://portal.azure.com/Content/Dynamic/BeUd4HiejUj:113:24094","isError":true}

Function Details:

The function is intended to handle image processing with the following key steps:

  1. It reads parameters like container_name, input_folder, output_folder, and new_crs_proj4 from the request body.

It then processes an image with a specified Coordinate Reference System (CRS) transformation and saves the output to a new location.

Testing Details:

  • Local Testing: The function works perfectly when tested locally, with no errors.
  • Azure Portal Testing: This error occurs only when I test it in the Azure portal.

Environment Details:

  • Azure Function App set up with HTTP trigger.
  • Testing in the Azure portal.
  • The app is running in read-only mode, as indicated by the portal due to running from a package file.

Possible Causes and Questions:

  1. Could this be related to CORS (Cross-Origin Resource Sharing) settings? I see a message about CORS configuration on the portal.
  2. Is there a network or permissions setting that could be preventing the function from accessing required resources?
  3. Any other insights into debugging this Failed to fetch error in the Azure portal?

I've attached a screenshot below of the error and logs for additional context.

Screenshot 2024-11-12 132633

Any help or guidance would be greatly appreciated. Thank you!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,200 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 5,305 Reputation points Microsoft Employee
    2024-11-13T19:00:21.4466667+00:00

    Hello @Yue Zhao

    This error can occur due to various reasons, including CORS settings, network or permissions settings, or other issues. To troubleshoot this issue, you can try the following steps:

    1. Check the CORS settings in your Azure Function App. You can enable CORS for your app by adding the allowed origins in the CORS settings. You can refer to the Azure documentation for more information on how to enable CORS for your app.
    2. Check the network and permissions settings for your app. Ensure that your app has the required permissions to access the resources it needs. You can also check if there are any network issues that could be preventing the app from accessing the required resources.
    3. Check the logs for your app in the Azure portal. The logs can provide more information on the error and help you identify the root cause of the issue. You can access the logs by going to the "Logs" section in the Azure portal.

    I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.