Inserting data into Supabase using Azure Functions

Victor Skou Fertin 25 Reputation points
2024-09-09T12:22:27.5166667+00:00

Hi all,

I have an azure function which processes PDFs, Images and other unstructured data sources through a blob trigger. The output is a json which is uploaded to a blob storage as well as in the end of the function being inserted into a table in Supabase.

The function runs from end to end if the Supabase upload is commented out but otherwise it does not execute any of code. The json-output is not uploaded to blob storage, even though the supabase insertion is executed after the blob upload.

The environment variables are defined and Azure Functions recognizes the function to be without any errors.

If I run the function locally using Azure Functions Core Tools, everything works and the files are processed and the output inserted as expected.

Have any of you experienced something similar? My guess is something along the lines and Azure or Supabase blocking the connection/upload to an external database, but I have not found documentation or alike which could explain it.

I hope you have some guidance. :)

Best,

Victor

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

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 4,290 Reputation points Microsoft Employee
    2024-09-11T18:40:06.3666667+00:00

    Hello @Victor Skou Fertin

    Based on what you have described, it seems like the issue might be related to the connection between your Azure Function and Supabase. Here are a few things you can try to troubleshoot the issue:

    1. Check your connection string: Make sure that the connection string you are using to connect to Supabase is correct and up-to-date. You can check this by logging into your Supabase account and verifying the connection details.
    2. Check your firewall settings: Supabase has a firewall that can block incoming connections from certain IP addresses. Make sure that your Azure Function's IP address is not being blocked by the firewall.
    3. Check your authentication settings: Supabase requires authentication to access its database. Make sure that your Azure Function is using the correct authentication credentials to access the database.
    4. Check your Supabase logs: Supabase logs can provide valuable information about any errors or issues that are occurring when you try to insert data. Check the logs to see if there are any error messages that might help you diagnose the issue.
    5. If none of these steps help you resolve the issue, you may want to reach out to Supabase support for further assistance.

    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.


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.