0
votes

Do you know how to send an Azure DevOps build pipeline artifact to a database in Azure?

The artifact is CSV. Got it to create it.

Now wondering what steps to get it to Azure Database in Azure. Also unsure on best approach for database in Azure as well for a CSV Artifact.

Not a dba. Have infrastructure background and automate infrastructure with Azure DevOps to Azure. Hard to decipher the best approach from all the documentation. If y'all can point me on the best approach I would appreciate it.

1
Do you want to insert all the data from the Csv file to some Azure SQL/other database?subhankars
Yes, that is correctSam Nadim

1 Answers

0
votes

In your release pipeline add an Azure SQL InlineSqlTask and use the following script

FROM '<Your build artifact directory>\YourCsvFilename.csv'
WITH
(
    FIRSTROW = 2, -- as 1st one is header
    FIELDTERMINATOR = ',',  --CSV field delimiter
    ROWTERMINATOR = '\n',   --Use to shift the control to next row
    TABLOCK
)

enter image description here