title: How to read file from Azure SAS using Java
body: <p>I have SAS URL of CSV file in Azure Bolb Storage. I need to download the file and write it to a SQL database. The question is, how to download the file using SAS URL. I tried with <code>RestTemplate</code>, but I'm getting a <code>NullPointerException</code>. Since I'm new to Java I can't figure this out.</p>
  
  <pre><code>String url="https://orcatest.blob.core.windows.net/ABC/extract.csv?st=2020-04-";
  
  HttpHeaders headers = new HttpHeaders();
  headers.setAccept(Arrays.asList(MediaType.APPLICATION_OCTET_STREAM));
  
  HttpEntity&lt;String&gt; entity = new HttpEntity&lt;String&gt;(headers);
  
  ResponseEntity&lt;String[]&gt; response = restTemplate.exchange(link, HttpMethod.GET, entity, String[].class);
  </code></pre>