Skip to content
Advertisement

Azure data upload and SQL database update failure for filename tracking

I have a scenario, in which I upload the file to Azure and will get the uploaded filename. Now I would need to store the filename (received for Azure upload) to SQL database.

In case, if database down means it will fail to capture the filename (received for Azure upload) to SQL database but the File upload to Azure was successful.

Here, how can I update the filename (received for Azure upload) to SQL database?

Advertisement

Answer

You can add the filename to your Azure SQL Database whenever you upload new blob in Storage account using Azure Logic App.

Create Logic App service using Azure Portal. Follow link.

Once it is created, Go to the resource. Click on Logic App Designer and select Blank Logic App.

Search for when blob is added or modified and select it.

enter image description here

Give the connection name, storage account name and storage account access key to connect your storage account. Click Create.

enter image description here

Fill the details to connect your container. Fill other required details to run your logic app automatically after given interval time. Click on + Next Step.

enter image description here

Search for SQL Server and select. Fill the required details to connect with your SQL Server. Click Create.

enter image description here

In the next step, select the server, database and table. Also select the column name in which you want to store the filenames. In the selected column name, select List of Files DisplayName. This will capture the filenames you uploaded in the container.

enter image description here

Lastly, click on Save -> Run Trigger -> Run to run your app login.

Simply, add any blob in your container and it’s filename will be added in your SQL Database. Check below for reference.

enter image description here

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement