How to pass file path from Azure Storage into your Azure stored procedure

Atul Kaushal 1 Reputation point
2021-05-14T16:12:31.167+00:00

Hi,
I have written a stored procedure that reads data from csv file and put it into multiple Postgres tables. It requires file path as a parameter and locally it works perfectly.

Call myProcedure('c:\file.csv'); // this works fine locally.

I have to make it work on Azure. I have created required tables and procedure on Azure Postgres. I have also written an azure function in Java which is connecting to database successfully. Now I need to take the CSV file from Azure Storage and pass it to stored procedure and execute it. The problem is that the path from Azure storage(SMB) is a URL(starts with https://...) whereas procedure expects path in Unix or Windows format. Is there a way I can make it work?

Call myProcedure('https://AzureURL/file.csv'); //doesn't work.
Any pointers will be helpful.

Thanks.

Azure SQL Database
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,011 questions
Azure Storage Explorer
Azure Storage Explorer
An Azure tool that is used to manage cloud storage resources on Windows, macOS, and Linux.
220 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,529 questions
Azure Database for PostgreSQL
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sumarigo-MSFT 42,516 Reputation points Microsoft Employee
    2021-05-17T07:11:10.56+00:00

    @Atul Kaushal Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused. If you are using Azure File Share, you can mount the share in the using Linux Function app

    How to mount Blob storage as a file system with blobfuse
    If you still have any question, I would like to work closer on this issue

    Hope this helps!

    Kindly let us know if the above helps or you need further assistance on this issue.

    ---------------------------------------------------------------------------------------------------------

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments