Azure / azure-storage-ruby

Microsoft Azure Storage Library for Ruby
http://azure.github.io/azure-storage-ruby/
84 stars 150 forks source link

Uploading blob to existing SAS URI for Microsoft Store submission #211

Open triplef opened 2 years ago

triplef commented 2 years ago

I’m trying to upload a file to a pre-defined SAS URI to submit a package to the Microsoft Store:

If you are adding new packages for the submission, upload the ZIP archive to Azure Blob Storage using the SAS URI that was provided in the response body of the POST method you called earlier.

The documentation contains the following example to upload using the Azure Storage Client Library for .NET:

string sasUrl = "https://productingestionbin1.blob.core.windows.net/ingestion/26920f66-b592-4439-9a9d-fb0f014902ec?sv=2014-02-14&sr=b&sig=usAN0kNFNnYE2tGQBI%2BARQWejX1Guiz7hdFtRhyK%2Bog%3D&se=2016-06-17T20:45:51Z&sp=rwl";
Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob blockBob =
    new Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob(new System.Uri(sasUrl));
await blockBob.UploadFromStreamAsync(stream);

How can I do the same using the Ruby library? It seems that it always requires an account name/key and doesn’t allow providing an existing URI.