I have a Visual Basic desktop application that stored, retrieved and copied files and images to my Azure Storage Account Container and created blobs. I'm trying to switch to the new Azure Storage but am having trouble finding the equivalents to the code listed below. Does anyone know what the code below would be for the new Azure.Storage - v12.x?
Imports Azure
Imports Microsoft.WindowsAzure.Storage
Imports Microsoft.WindowsAzure.Storage.Blob
Dim storageacc As CloudStorageAccount = CloudStorageAccount.Parse(storageconn)
Dim blobClient As CloudBlobClient = storageacc.CreateCloudBlobClient()
Dim container As CloudBlobContainer = blobClient.GetContainerReference(strAgency & strAzureDirPath)
Dim blobCopy As CloudBlockBlob = container.GetBlockBlobReference(NewFileName)
Dim blockBlob As CloudBlockBlob = container.GetBlockBlobReference(uGridFiles.Selected.Rows(intJ).Cells("FileName").Text)
Dim source = container.GetBlockBlobReference(blockBlob.Name)
Dim target = container.GetBlockBlobReference(blobCopy.Name)
blobCopy.StartCopy(blockBlob)
While blobCopy.CopyState.Status = CopyStatus.Pending
System.Threading.Tasks.Task.Delay(100).Wait()
End While
If blobCopy.CopyState.Status <> CopyStatus.Success Then Throw New ApplicationException("Rename failed: " & blobCopy.CopyState.Status)
blockBlob.DeleteIfExists()
Any help is appreciated.
and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.