azure-storage-blobs

StorageException for azure blob with java

廉价感情. 提交于 2019-12-24 04:19:48
问题 When i am trying create container for my storage i get StorageException. 1.I created azure account. 2.I created azure storage for blob 3.I wrotten simple test(below) 4.I made this code on local machine and got exception. What is wrong? public class Test { public static final String storageConnectionString = "DefaultEndpointsProtocol=https;" + "AccountName=my_account;" + "AccountKey=my_account_key"; public static void main(String[] args) throws StorageException, InvalidKeyException,

Can't programmatically set permissions to blob container in Azure Storage

こ雲淡風輕ζ 提交于 2019-12-24 03:24:41
问题 After creating a blob container with CreateIfNotExists() , I immediately call SetPermissions() to allow users public access to the blobs in the container, but not to the container itself. Like so: CloudBlobContainer pdfContainer = blobClient.GetContainerReference(ContainerName.PDFs); if (pdfContainer.CreateIfNotExists()) pdfContainer.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob }); The container is created successfully, but when I log in to

make a backup for azure database

断了今生、忘了曾经 提交于 2019-12-24 03:15:01
问题 I need to make a backup to my azure database, I'm trying with this command: "C:\Program Files\Microsoft SQL Server\120\DAC\bin\SqlPackage.exe" /Action:Export /SourceServerName:"tcp:MyDataServer.database.windows.net,1433" /SourceDatabaseName:MyDatabase /SourceUser:MyUser /SourcePassword:MyPass /TargetFile:C:\backups\backup.bacpac but it seems that the format that downloads it is "bacpac" and I need it to be ".bak", I tried to change the extension but says: "The TargetFile argument must refer

Windows Azure Shared Access Signature always gives: Forbidden 403

岁酱吖の 提交于 2019-12-24 03:15:01
问题 I am trying to get a shared access signature for a single blob and then download the blob using the REST api. However, I always get a forbidden 403 error message. Both on storage emulator and the cloud. Here is my code: CloudStorageAccount storageAccount = CloudStorageAccount.Parse("myConnectionStringHere..."); CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); CloudBlobContainer container = blobClient.GetContainerReference("containerName"); CloudBlob blob = container

How to convert from Azure Append Blob to Azure Block Blob

时间秒杀一切 提交于 2019-12-24 03:03:41
问题 Is their any any to convert from Append Blob to Block Blob . Regards C 回答1: Is their any any to convert from Append Blob to Block Blob . Once the blob has been created, its type cannot be changed, and it can be updated only by using operations appropriate for that blob type, i.e., writing a block or list of blocks to a block blob, appending blocks to a append blob, and writing pages to a page blob. More information please refer to this link: Understanding Block Blobs, Append Blobs, and Page

How to convert from Azure Append Blob to Azure Block Blob

允我心安 提交于 2019-12-24 03:03:20
问题 Is their any any to convert from Append Blob to Block Blob . Regards C 回答1: Is their any any to convert from Append Blob to Block Blob . Once the blob has been created, its type cannot be changed, and it can be updated only by using operations appropriate for that blob type, i.e., writing a block or list of blocks to a block blob, appending blocks to a append blob, and writing pages to a page blob. More information please refer to this link: Understanding Block Blobs, Append Blobs, and Page

Get Azure premium storage account properties

橙三吉。 提交于 2019-12-24 01:46:31
问题 I am trying to get premium storage account (classic) properties using next method: public ServiceProperties GetStorageAccountProperties(string accountName, string accountKey) { var connectionString = string.Format("DefaultEndpointsProtocol=http;AccountName={0};AccountKey={1};", accountName, accountKey); var account = CloudStorageAccount.Parse(connectionString); CloudBlobClient bloblClient = account.CreateCloudBlobClient(); return bloblClient.GetServiceProperties(); } But, it throws a

Can you set metadata on an Azure CloudBlockBlob at the same time as uploading it?

落爺英雄遲暮 提交于 2019-12-24 01:16:24
问题 I have a situation in which I currently upload a CloudBlockBlob using CloudBlockBlob.UploadFromStreamAsync, and then immediately afterward I set a bunch of user metadata on it. The issue is: I have an Event Grid event which is triggered when the blob is uploaded, but the event handler requires the metadata. Long story short, it's a race condition wherein I have to "hope" that the metadata has been set before my event handler responds to the block blob upload. Is there some way to both upload

How to list all virtual directories and subdirectories using Azure Storage Client Library for .NET (BLOBS)

泪湿孤枕 提交于 2019-12-24 00:59:28
问题 How to list ALL directories AND subdirectories in a blob container? This is what I have so far: public List<CloudBlobDirectory> Folders { get; set; } public List<CloudBlobDirectory> GetAllFoldersAndSubFoldersFromBlobStorageContainer() { CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString); CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); CloudBlobContainer container = blobClient

Azure CloudBlockBlob.DeleteIfExists() - Does false always mean the blob doesn't exist?

血红的双手。 提交于 2019-12-24 00:26:06
问题 I know that CloudBlockBlob.DeleteIfExists() returns true if the blob exists and false when it does not. However I'm curious the know what happens if the blob does exist, but something goes wrong in Azure which causes the file deletion to not occur (I can't find any documentation on that behavior). My concern is that it will return false instead of throwing some kind of exception, so I'll believe the blob is deleted, when it's actually still there. In short, if I get a value of false back,