title: How do I bulk insert into an Azure SQLServer Database?
body: <p>I would like to do bulk inserts to my Azure database from Python, but I can't find the documentation for how it's done.</p>
  
  <p><a href="https://azure.microsoft.com/en-us/documentation/articles/machine-learning-data-science-move-sql-azure/" rel="nofollow noreferrer">This page</a> says:</p>
  
  <blockquote>
    <p>The following table summarizes the options for moving data to an Azure SQL Database.</p>
  </blockquote>
  
  <p>The section <a href="https://azure.microsoft.com/en-us/documentation/articles/machine-learning-data-science-move-sql-azure/#bulk-insert-sql-query" rel="nofollow noreferrer">linked from that table</a> says:</p>
  
  <blockquote>
    <p>The steps for the procedure using the Bulk Insert SQL Query are similar to those covered in the sections for moving data from a flat file source to SQL Server on an Azure VM.</p>
  </blockquote>
  
  <p>And that provides the following query:</p>
  
  <pre><code>BULK INSERT &lt;tablename&gt;
  FROM    
  '&lt;datafilename&gt;'
  WITH 
  (
  FirstRow=2,
  FIELDTERMINATOR =',', --this should be column separator in your data
  ROWTERMINATOR ='\n'   --this should be the row separator in your data
  )
  </code></pre>
  
  <p>But presumably that datafile has to live somewhere, but I can't find <em>where</em> in the documentation that it confirms where this data file should live. I can create a csv file and upload it as a blob to Azure storage, but <a href="https://stackoverflow.com/q/29633297/344286">nobody in the last year had an answer for how get it from there to SQL Azure</a>.</p>
  
  <p>How can I bulk insert into SQL Azure?</p>