Skip to content

.Net Diaries

Michael Denny's blog about .NET, Azure and Software Architecture

  • Home
  • About
  • RSS Feed

Tag: affinity group

How To Copy a Blob Across Storage Accounts and Regions

If you ever worked with Windows Azure, you’ve probably stumbled in the bad practice to let the control panel create the storage for you, with an unreadable and forgettable name, and with the worst thing you can do, leaving the storage outside an affinity group, that guarantee low latency between services and storage that should communicate each other.

It is possible with the Windows Azure PowerShell module to copy a storage blob across storage accounts and regions… asynchronously!

For example, you would need to move a virtual machine disk between storage account:

Import-Module Azure
Select-AzureSubscription "My Subscription Name"

$destContext = New-AzureStorageContext –StorageAccountName "MyStorageAccountName" -StorageAccountKey "MyStorageAccountKey"

$blob = Start-AzureStorageBlobCopy -SrcContainer vhds -SrcBlob "xxxx.vhd" -DestContainer vhds -DestBlob "xxxx.vhd" -DestContext $destContext

Then to check the status of the copying, you can execute this command:

$blob | Get-AzureStorageBlobCopyState
Author Michael DennyPosted on August 4, 2013Categories PowerShell, Windows Azure Cloud, Windows Azure TipsTags affinity group, azure, blob, cloud, container, copy blob, powershell, storage, storage account, storage accounts, subscription name, windows azureLeave a comment on How To Copy a Blob Across Storage Accounts and Regions
Follow .Net Diaries on WordPress.com

Categories

  • Angular (3)
  • CSharp (12)
  • Deployment (4)
  • Electron (1)
  • Entity Framework (3)
  • Funny (1)
  • Git (1)
  • linux (2)
    • raspberry (1)
  • Microsoft MVP (1)
  • Node.js (2)
  • Office (1)
  • Performance (1)
  • PowerShell (8)
  • RabbitMQ (4)
  • Sql Server (5)
  • Team Foundation Server (5)
  • Testing (2)
  • Uncategorized (10)
  • Visual Studio (14)
  • Windows (4)
  • Windows Azure Cloud (15)
    • Windows Azure Tips (9)

Social

  • View 0v3rCl0ck’s profile on Facebook
  • View dennymic’s profile on Twitter
  • View micdenny1’s profile on Instagram
  • View dennymic’s profile on LinkedIn
  • View micdenny’s profile on GitHub
  • View UCVoaOHx4xFy3oAe7K_fYjsw’s profile on YouTube

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 237 other subscribers

Recent Comments

Michael Denny on Visual Studio: Create self-sig…
didem on Visual Studio: Create self-sig…
Kyla on WPF Design Time Resources…
Michael Denny on Share Wifi Internet with ether…
MachineMaker on Share Wifi Internet with ether…

Archives

  • September 2020 (1)
  • October 2019 (1)
  • September 2019 (1)
  • April 2019 (1)
  • March 2019 (3)
  • April 2018 (1)
  • October 2017 (1)
  • September 2017 (1)
  • February 2017 (6)
  • July 2016 (2)
  • February 2016 (2)
  • January 2016 (1)
  • July 2015 (1)
  • June 2015 (3)
  • May 2015 (1)
  • April 2015 (2)
  • March 2015 (2)
  • February 2015 (1)
  • January 2015 (3)
  • November 2014 (2)
  • October 2014 (2)
  • August 2014 (1)
  • July 2014 (1)
  • June 2014 (7)
  • May 2014 (3)
  • April 2014 (2)
  • March 2014 (5)
  • August 2013 (3)
  • July 2013 (6)
  • June 2013 (2)
  • May 2013 (1)
  • March 2013 (2)

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.com
  • Home
  • About
  • RSS Feed
.Net Diaries Blog at WordPress.com.
  • Follow Following
    • .Net Diaries
    • Already have a WordPress.com account? Log in now.
    • .Net Diaries
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar