var account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");
// create container
Storage = account.CreateCloudBlobClient();
Container = Storage.GetContainerReference("container");
Container.CreateIfNotExist();
// configure for public access
var permissions = Container.GetPermissions();
permissions.PublicAccess = BlobContainerPublicAccessType.Container;
Container.SetPermissions(permissions);
...
CloudBlockBlob blob = Storage.GetBlockBlobReference(blobname);
blob.UploadFromStream(file.InputStream);
url = blob.Uri.AbsoluteUri;
//url returns: https://myazureacct.blob.core.windows.net/...
I can access the resource with http://myazureacct…. but why is AbsoluteUri returning https?
The Uri is created by the library using the underlying connection string/client – and I’m guessing that your “DataConnectionString” contains “UseHttps=true” – hence why the url’s the library is using (and producing) are HTTPs.
At a slightly deeper level than that, you can access the blob storage service using http or https – just as you can access table and queue storage too. If you’re working within a single Azure data center, or if you are working with non-sensitive data, then you are free to use http – otherwise https is preferred for your security.