發表文章

目前顯示的是 3月, 2016的文章

Azure Storage 複製

網路上目前看到的寫法都是container間的複製 一直沒找到可用的可以在Storage間互相複製全部container 所以參考網路寫法,自己寫一個 不過實際跑完測試好像還是Azcopy比較快@@ 就當作練習嗎XD #Server side storage copy $SourceStorageAccount = "" $SourceStorageKey = "" $DestStorageAccount = "" $DestStorageKey = "" $SourceStorageContext = New-AzureStorageContext –StorageAccountName $SourceStorageAccount -StorageAccountKey $SourceStorageKey $DestStorageContext = New-AzureStorageContext –StorageAccountName $DestStorageAccount -StorageAccountKey $DestStorageKey $SourceStorageContainer = Get-AzureStorageContainer -Context $SourceStorageContext; foreach ($Container in $SourceStorageContainer) { $Blobs = Get-AzureStorageBlob -Context $SourceStorageContext -Container $Container.Name $BlobCpyAry = @() #Create array of objects $DestStorageContainer = New-AzureStorageContainer $Container.Name -Permission Off -Context $DestStorageContext #Do the copy of everything foreach ($Blob in $Blobs) { Write-Output "Moving $Blob....