title: Azure bulk import csv file into Azure SQL Server from Azure file service location
body: <p>I would like to import a csv file (sqlserver-dba-csv.txt) into a table on a SQL Server database hosted in Azure.  </p>
  
  <p>This file is located on a Azure File Service (location address: '<a href="https://XXXXXXXXXXX.file.core.windows.net/XXXXXXXXXXX/sqlserver-dba-csv.txt" rel="nofollow noreferrer">https://XXXXXXXXXXX.file.core.windows.net/XXXXXXXXXXX/sqlserver-dba-csv.txt</a>') which is also a mapped drive on my local machine. </p>
  
  <p>Eventually I would like this to be somewhat automated by a trigger, but for now I just want to import the data into a table on the SQL server to prove the process works.</p>
  
  <p>the contents of this sqlserver-dba-csv.txt file are :</p>
  
  <pre><code>1,James Brown,blue 
  2,Prince,red 
  3,Rick James,yellow
  </code></pre>
  
  <p>The code I am using on SSMS is:</p>
  
  <pre><code>**--create a table
  CREATE TABLE musicians_csv (
  musician_id INT,
  full_name VARCHAR(50),
  colour VARCHAR(20)
  )
  GO
  --bulk insert csv into a SQL Server table
  BULK
  INSERT musicians_csv
  FROM 'https://XXXXXXXXXXX.file.core.windows.net/XXXXXXXXXXX/sqlserver-dba-csv.txt'
  WITH
  (
  FIELDTERMINATOR = ',',
  ROWTERMINATOR = '\n'
  )
  GO
  --Verify data inserted
  SELECT *
  FROM musicians_csv
  GO
  --Drop the table
  DROP TABLE musicians_csv
  GO**
  </code></pre>
  
  <p>The error message I receive is :</p>
  
  <blockquote>
    <p>Msg 4861, Level 16, State 1, Line 10 Cannot bulk load because the file
    "https:/xxxxxxxxx.file.core.windows.net/xxxxxxxxx/sqlserver-dba-csv.txt"
    could not be opened. Operating system error code (null).</p>
    
    <p>(0 row(s) affected)</p>
  </blockquote>
  
  <p>I suspect that the formatting of the file location is incorrect but have not been able to find any solution after searching. </p>
  
  <p>Alternatively - am I able to reference to and import a file on my local machine, even though my SQL Server is in the Azure Cloud - for example a location like: "C:\Users\user.name\Desktop\sqlserver-dba-csv.txt" </p>
  
  <p>Any help greatly appreciated</p>