title: Python: Upload a package to Azure using SAS URI
body: <p>I am using the Microsoft's Hardware dashboard API to automate the submission of my (.CAB) package for signing. I have followed the steps in this documentation: <a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/dashboard/create-a-new-submission-for-a-product" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/windows-hardware/drivers/dashboard/create-a-new-submission-for-a-product</a></p>
  
  <p>The response of new submission contains the SAS(Shared Access Signature) URI 
  like this: (changed the sig and accnt_name for security)</p>
  
  <p>'''<a href="https://accnt_name.blob.core.windows.net/scsjc/cexxxxxxxxxx?sv=2017-04-17&amp;sr=b&amp;sig=xxxxxxxxxxxxxx&amp;se=2019-07-10T18:15:58Z&amp;sp=rwl&amp;rscd=attachment%3B" rel="nofollow noreferrer">https://accnt_name.blob.core.windows.net/scsjc/cexxxxxxxxxx?sv=2017-04-17&amp;sr=b&amp;sig=xxxxxxxxxxxxxx&amp;se=2019-07-10T18:15:58Z&amp;sp=rwl&amp;rscd=attachment%3B</a> filename%3Dinitial_xxxxxxxx.cab'''</p>
  
  <p><strong>I need to use this SAS URI to upload by package to azure blob storage.</strong>
  The examples in documentation shows C# or .NET as follows: </p>
  
  <pre><code>string sasUrl = 
  "https://productingestionbin1.blob.core.windows.net/ingestion/26920f66- 
   b592-4439-9a9d-fb0f014902ec?sv=2014-02-
   14&amp;sr=b&amp;sig=usAN0kNFNnYE2tGQBI%2BARQWejX1Guiz7hdFtRhyK%2Bog%3D&amp;se=2016- 
   06-17T20:45:51Z&amp;sp=rwl";
   Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob blockBob =
   new Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob(new 
   System.Uri(sasUrl));
   await blockBob.UploadFromStreamAsync(stream);
  </code></pre>
  
  <p>I want to use the SAS URI obtained from submission resource JSON Response to upload the package. </p>
  
  <p>This link <a href="https://stackoverflow.com/questions/55794030/download-file-from-azure-blob-container-using-sas-uri-in-python">Download file from AZURE BLOB CONTAINER using SAS URI in PYTHON</a> suggests that there is no equivalent method in python and BlockBlobService can be used.</p>
  
  <pre><code>from azure.storage.blob import BlockBlobService
  
   blobservice = BlockBlobService("storage_account",sas_token="?sv=2018-03- 
   28&amp;ss=bfqt&amp;srt=sco&amp;sp=rwdlacup&amp;se=2019-04-24T10:01:58Z&amp;st=2019-04- 
   23T02:01:58Z&amp;spr=https&amp;sig=xxxxxxxxx")
  
   blobservice.create_blob_from_path(container_name, local_file_name, 
   full_path_to_file)
  </code></pre>
  
  <p>However I am not sure of what is storage_account name and container name from the SAS URI obtained from submission resource. </p>
  
  <p>Also I have created a separate azure storage account and added a new container, blob in it. I have tried passing the new container and storage account name with SAS access token from SAS URI (obtained from submission JSON response micorsoft hardware api)  but always get below <strong>ERROR</strong></p>
  
  <p>'''
  AzureHttpError: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. ErrorCode: AuthenticationFailed
  <Code>AuthenticationFailed</Code>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
  RequestId:5463b7d2-901e-0068-6994-36782e000000
  Time:2019-07-09T20:23:04.5760736ZSignature did not match. String to sign used was rwl</p>
  
  <p>2019-07-10T18:15:58Z
  /blob/evcertautomation/ev2/initial_1152921504628106590.cab</p>
  
  <p>2017-04-17</p>
  
  <p>attachment; filename=initial_1152921504628106563.cab
  
  '''
  Thanks in advance</p>