question

MingHuiHuang-6367 avatar image
0 Votes"
MingHuiHuang-6367 asked AnuragSharma-MSFT commented

Export query result into csv and store it in azure storage container

Hi,

I’m currently using Azure SQL Managed Instance. I red to export the sql query result into csv file and export the file the VM I’m using to access the managed instance or into a azure storage container.

All these have to be automated. And run daily/weekly.

Is there a way to do it?

azure-sql-database
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MingHuiHuang-6367, just wanted to check if below answer helped or else we can discuss further.

0 Votes 0 ·

1 Answer

AnuragSharma-MSFT avatar image
0 Votes"
AnuragSharma-MSFT answered

Hi @MingHuiHuang-6367, welcome to Microsoft Q&A forum. You can use Azure Logic App to achieve this. Below is the sequence of steps you can create:

1) Set Recurrence based on requirement and schedule

135554-image.png




2)Create A stored procedure which has the output that you want. Or else you can use normal Execute SQL Query task as well:

135506-image.png



3)Then lastly you can create a blob. Azure Storage Account must be existing one.

135524-image.png

This will create a blob object in the Storage Account. If you want to create CSV file and load we need to add extra step of 'Create CSV table' as per the below article:

Export Azure SQL database data to CSV files using Azure Logic Apps

Please let me know if this helps or else we can discuss further on the same.


Please don't forgot to click on accept it as answer button 135489-image.png wherever the information provided helps you. This can be beneficial to other community members as well.



image.png (31.5 KiB)
image.png (31.2 KiB)
image.png (31.0 KiB)
image.png (7.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.