How to rename the container name in windows azure?
Is there any way by which we can rename the blob container name in windows azure ?
c# azure azure-storage
add a comment |
Is there any way by which we can rename the blob container name in windows azure ?
c# azure azure-storage
See stackoverflow.com/questions/3734672/azure-storage-blob-rename
– Paul Zahra
Sep 11 '12 at 13:21
add a comment |
Is there any way by which we can rename the blob container name in windows azure ?
c# azure azure-storage
Is there any way by which we can rename the blob container name in windows azure ?
c# azure azure-storage
c# azure azure-storage
asked Sep 11 '12 at 13:18
GauravGaurav
4,806114479
4,806114479
See stackoverflow.com/questions/3734672/azure-storage-blob-rename
– Paul Zahra
Sep 11 '12 at 13:21
add a comment |
See stackoverflow.com/questions/3734672/azure-storage-blob-rename
– Paul Zahra
Sep 11 '12 at 13:21
See stackoverflow.com/questions/3734672/azure-storage-blob-rename
– Paul Zahra
Sep 11 '12 at 13:21
See stackoverflow.com/questions/3734672/azure-storage-blob-rename
– Paul Zahra
Sep 11 '12 at 13:21
add a comment |
5 Answers
5
active
oldest
votes
UPDATE
Please see answer from Nuri Tasdemir below.
No. You can't rename a blob container in Windows Azure. What you could do is create a new blob container with the new name and copy blobs from old blob container to the new one. Once the blobs are copied, you can delete the old blob container. Please note that if you're doing the copy blob in Cloud, this operation is asynchronous. So ensure that the blobs are copied completely before deleting the blob container.
6
It is now possible to do this with "Microsoft Azure Storage Explorer". Please see Nuri Tasdemir's answer.
– tmutton
Mar 6 '17 at 10:43
@tmutton This is a tool feature and not a platform feature.
– Gaurav Mantri
Mar 6 '17 at 10:45
4
It is a solution to the problem.
– tmutton
Mar 6 '17 at 10:50
1
@Ofer Zelig. I rolled back your edit. IMHO, if you are not happy with an answer, instead of editing it to something completely different, you can always cast vote or add your own answer.
– Nuri Tasdemir
Nov 12 '18 at 3:52
2
@OferZelig... Interesting discussion! I have updated my answer and informed folks to look for Nuri's answer. Hope this helps.
– Gaurav Mantri
Nov 13 '18 at 5:38
|
show 6 more comments
Now, you can rename containers with Microsoft's "Microsoft Azure Storage Explorer" (after version 0.8.3). You can also rename azure tables and file shares with this tool. See the release notes here.
Note that this feature has the following disclaimer during usage.
Renaming works by copying to the new name, then deleting the source item. Renaming a blob container currently loses the container's properties and metadata, and may take a while if there are lots of blobs.
Therefore this is not an actual renaming behind the scenes and incurs read/write/transaction costs.
add a comment |
No. You can't rename a blob container in Windows Azure.
Code to copy from the old storage to the new storage
AzCopy /Source:https://oldstorage.blob.core.windows.net/oldstorage /Dest:https://newstorage.blob.core.windows.net/newstorage /SourceKey:sourcekey /DestKey:destkey /S /XO
add a comment |
Check out listing container. You can list all blobs and easily copy them to a new container.
There is also more useful stuff there.
add a comment |
This RenameBlob method will allow you to rename folders or files in an Azure container.
- album1/image1.jpg -> album2/image1.jpg
- album1/image1.jpg -> album1/image2.jpg
HTH
public class AzureStorageService
readonly CloudStorageAccount _storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);
public void RenameBlob(string oldName, string newName)
var blobClient = _storageAccount.CreateCloudBlobClient();
var container = blobClient.GetContainerReference("MyContainer");
var blobs = container.GetDirectoryReference(oldName).ListBlobs();
foreach (var item in blobs)
string blobUri = item.Uri.ToString();
var oldBlob = container.GetBlockBlobReference(blobUri);
var newBlob = container.GetBlockBlobReference(blobUri.Replace(oldName, newName));
newBlob.StartCopyFromBlob(oldBlob);
oldBlob.Delete();
This method renames only folders
– f0rza
Jul 4 '14 at 9:28
2
Also, I don't know if it's a good idea to delete the old blob while the cop operation is in progress. Just because you returned fromStartCopyFromBlob
doesn't mean the operation completed.
– Dave Van den Eynde
Mar 8 '16 at 8:46
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f12370656%2fhow-to-rename-the-container-name-in-windows-azure%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
UPDATE
Please see answer from Nuri Tasdemir below.
No. You can't rename a blob container in Windows Azure. What you could do is create a new blob container with the new name and copy blobs from old blob container to the new one. Once the blobs are copied, you can delete the old blob container. Please note that if you're doing the copy blob in Cloud, this operation is asynchronous. So ensure that the blobs are copied completely before deleting the blob container.
6
It is now possible to do this with "Microsoft Azure Storage Explorer". Please see Nuri Tasdemir's answer.
– tmutton
Mar 6 '17 at 10:43
@tmutton This is a tool feature and not a platform feature.
– Gaurav Mantri
Mar 6 '17 at 10:45
4
It is a solution to the problem.
– tmutton
Mar 6 '17 at 10:50
1
@Ofer Zelig. I rolled back your edit. IMHO, if you are not happy with an answer, instead of editing it to something completely different, you can always cast vote or add your own answer.
– Nuri Tasdemir
Nov 12 '18 at 3:52
2
@OferZelig... Interesting discussion! I have updated my answer and informed folks to look for Nuri's answer. Hope this helps.
– Gaurav Mantri
Nov 13 '18 at 5:38
|
show 6 more comments
UPDATE
Please see answer from Nuri Tasdemir below.
No. You can't rename a blob container in Windows Azure. What you could do is create a new blob container with the new name and copy blobs from old blob container to the new one. Once the blobs are copied, you can delete the old blob container. Please note that if you're doing the copy blob in Cloud, this operation is asynchronous. So ensure that the blobs are copied completely before deleting the blob container.
6
It is now possible to do this with "Microsoft Azure Storage Explorer". Please see Nuri Tasdemir's answer.
– tmutton
Mar 6 '17 at 10:43
@tmutton This is a tool feature and not a platform feature.
– Gaurav Mantri
Mar 6 '17 at 10:45
4
It is a solution to the problem.
– tmutton
Mar 6 '17 at 10:50
1
@Ofer Zelig. I rolled back your edit. IMHO, if you are not happy with an answer, instead of editing it to something completely different, you can always cast vote or add your own answer.
– Nuri Tasdemir
Nov 12 '18 at 3:52
2
@OferZelig... Interesting discussion! I have updated my answer and informed folks to look for Nuri's answer. Hope this helps.
– Gaurav Mantri
Nov 13 '18 at 5:38
|
show 6 more comments
UPDATE
Please see answer from Nuri Tasdemir below.
No. You can't rename a blob container in Windows Azure. What you could do is create a new blob container with the new name and copy blobs from old blob container to the new one. Once the blobs are copied, you can delete the old blob container. Please note that if you're doing the copy blob in Cloud, this operation is asynchronous. So ensure that the blobs are copied completely before deleting the blob container.
UPDATE
Please see answer from Nuri Tasdemir below.
No. You can't rename a blob container in Windows Azure. What you could do is create a new blob container with the new name and copy blobs from old blob container to the new one. Once the blobs are copied, you can delete the old blob container. Please note that if you're doing the copy blob in Cloud, this operation is asynchronous. So ensure that the blobs are copied completely before deleting the blob container.
edited Nov 13 '18 at 5:34
answered Sep 11 '12 at 13:22
Gaurav MantriGaurav Mantri
71.8k8108134
71.8k8108134
6
It is now possible to do this with "Microsoft Azure Storage Explorer". Please see Nuri Tasdemir's answer.
– tmutton
Mar 6 '17 at 10:43
@tmutton This is a tool feature and not a platform feature.
– Gaurav Mantri
Mar 6 '17 at 10:45
4
It is a solution to the problem.
– tmutton
Mar 6 '17 at 10:50
1
@Ofer Zelig. I rolled back your edit. IMHO, if you are not happy with an answer, instead of editing it to something completely different, you can always cast vote or add your own answer.
– Nuri Tasdemir
Nov 12 '18 at 3:52
2
@OferZelig... Interesting discussion! I have updated my answer and informed folks to look for Nuri's answer. Hope this helps.
– Gaurav Mantri
Nov 13 '18 at 5:38
|
show 6 more comments
6
It is now possible to do this with "Microsoft Azure Storage Explorer". Please see Nuri Tasdemir's answer.
– tmutton
Mar 6 '17 at 10:43
@tmutton This is a tool feature and not a platform feature.
– Gaurav Mantri
Mar 6 '17 at 10:45
4
It is a solution to the problem.
– tmutton
Mar 6 '17 at 10:50
1
@Ofer Zelig. I rolled back your edit. IMHO, if you are not happy with an answer, instead of editing it to something completely different, you can always cast vote or add your own answer.
– Nuri Tasdemir
Nov 12 '18 at 3:52
2
@OferZelig... Interesting discussion! I have updated my answer and informed folks to look for Nuri's answer. Hope this helps.
– Gaurav Mantri
Nov 13 '18 at 5:38
6
6
It is now possible to do this with "Microsoft Azure Storage Explorer". Please see Nuri Tasdemir's answer.
– tmutton
Mar 6 '17 at 10:43
It is now possible to do this with "Microsoft Azure Storage Explorer". Please see Nuri Tasdemir's answer.
– tmutton
Mar 6 '17 at 10:43
@tmutton This is a tool feature and not a platform feature.
– Gaurav Mantri
Mar 6 '17 at 10:45
@tmutton This is a tool feature and not a platform feature.
– Gaurav Mantri
Mar 6 '17 at 10:45
4
4
It is a solution to the problem.
– tmutton
Mar 6 '17 at 10:50
It is a solution to the problem.
– tmutton
Mar 6 '17 at 10:50
1
1
@Ofer Zelig. I rolled back your edit. IMHO, if you are not happy with an answer, instead of editing it to something completely different, you can always cast vote or add your own answer.
– Nuri Tasdemir
Nov 12 '18 at 3:52
@Ofer Zelig. I rolled back your edit. IMHO, if you are not happy with an answer, instead of editing it to something completely different, you can always cast vote or add your own answer.
– Nuri Tasdemir
Nov 12 '18 at 3:52
2
2
@OferZelig... Interesting discussion! I have updated my answer and informed folks to look for Nuri's answer. Hope this helps.
– Gaurav Mantri
Nov 13 '18 at 5:38
@OferZelig... Interesting discussion! I have updated my answer and informed folks to look for Nuri's answer. Hope this helps.
– Gaurav Mantri
Nov 13 '18 at 5:38
|
show 6 more comments
Now, you can rename containers with Microsoft's "Microsoft Azure Storage Explorer" (after version 0.8.3). You can also rename azure tables and file shares with this tool. See the release notes here.
Note that this feature has the following disclaimer during usage.
Renaming works by copying to the new name, then deleting the source item. Renaming a blob container currently loses the container's properties and metadata, and may take a while if there are lots of blobs.
Therefore this is not an actual renaming behind the scenes and incurs read/write/transaction costs.
add a comment |
Now, you can rename containers with Microsoft's "Microsoft Azure Storage Explorer" (after version 0.8.3). You can also rename azure tables and file shares with this tool. See the release notes here.
Note that this feature has the following disclaimer during usage.
Renaming works by copying to the new name, then deleting the source item. Renaming a blob container currently loses the container's properties and metadata, and may take a while if there are lots of blobs.
Therefore this is not an actual renaming behind the scenes and incurs read/write/transaction costs.
add a comment |
Now, you can rename containers with Microsoft's "Microsoft Azure Storage Explorer" (after version 0.8.3). You can also rename azure tables and file shares with this tool. See the release notes here.
Note that this feature has the following disclaimer during usage.
Renaming works by copying to the new name, then deleting the source item. Renaming a blob container currently loses the container's properties and metadata, and may take a while if there are lots of blobs.
Therefore this is not an actual renaming behind the scenes and incurs read/write/transaction costs.
Now, you can rename containers with Microsoft's "Microsoft Azure Storage Explorer" (after version 0.8.3). You can also rename azure tables and file shares with this tool. See the release notes here.
Note that this feature has the following disclaimer during usage.
Renaming works by copying to the new name, then deleting the source item. Renaming a blob container currently loses the container's properties and metadata, and may take a while if there are lots of blobs.
Therefore this is not an actual renaming behind the scenes and incurs read/write/transaction costs.
edited Apr 9 '18 at 23:41
answered Aug 16 '16 at 11:04
Nuri TasdemirNuri Tasdemir
7,91512544
7,91512544
add a comment |
add a comment |
No. You can't rename a blob container in Windows Azure.
Code to copy from the old storage to the new storage
AzCopy /Source:https://oldstorage.blob.core.windows.net/oldstorage /Dest:https://newstorage.blob.core.windows.net/newstorage /SourceKey:sourcekey /DestKey:destkey /S /XO
add a comment |
No. You can't rename a blob container in Windows Azure.
Code to copy from the old storage to the new storage
AzCopy /Source:https://oldstorage.blob.core.windows.net/oldstorage /Dest:https://newstorage.blob.core.windows.net/newstorage /SourceKey:sourcekey /DestKey:destkey /S /XO
add a comment |
No. You can't rename a blob container in Windows Azure.
Code to copy from the old storage to the new storage
AzCopy /Source:https://oldstorage.blob.core.windows.net/oldstorage /Dest:https://newstorage.blob.core.windows.net/newstorage /SourceKey:sourcekey /DestKey:destkey /S /XO
No. You can't rename a blob container in Windows Azure.
Code to copy from the old storage to the new storage
AzCopy /Source:https://oldstorage.blob.core.windows.net/oldstorage /Dest:https://newstorage.blob.core.windows.net/newstorage /SourceKey:sourcekey /DestKey:destkey /S /XO
answered Nov 14 '18 at 4:15
Fernando MagnoFernando Magno
1717
1717
add a comment |
add a comment |
Check out listing container. You can list all blobs and easily copy them to a new container.
There is also more useful stuff there.
add a comment |
Check out listing container. You can list all blobs and easily copy them to a new container.
There is also more useful stuff there.
add a comment |
Check out listing container. You can list all blobs and easily copy them to a new container.
There is also more useful stuff there.
Check out listing container. You can list all blobs and easily copy them to a new container.
There is also more useful stuff there.
answered Sep 13 '12 at 7:02
AriAri
2,1641840
2,1641840
add a comment |
add a comment |
This RenameBlob method will allow you to rename folders or files in an Azure container.
- album1/image1.jpg -> album2/image1.jpg
- album1/image1.jpg -> album1/image2.jpg
HTH
public class AzureStorageService
readonly CloudStorageAccount _storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);
public void RenameBlob(string oldName, string newName)
var blobClient = _storageAccount.CreateCloudBlobClient();
var container = blobClient.GetContainerReference("MyContainer");
var blobs = container.GetDirectoryReference(oldName).ListBlobs();
foreach (var item in blobs)
string blobUri = item.Uri.ToString();
var oldBlob = container.GetBlockBlobReference(blobUri);
var newBlob = container.GetBlockBlobReference(blobUri.Replace(oldName, newName));
newBlob.StartCopyFromBlob(oldBlob);
oldBlob.Delete();
This method renames only folders
– f0rza
Jul 4 '14 at 9:28
2
Also, I don't know if it's a good idea to delete the old blob while the cop operation is in progress. Just because you returned fromStartCopyFromBlob
doesn't mean the operation completed.
– Dave Van den Eynde
Mar 8 '16 at 8:46
add a comment |
This RenameBlob method will allow you to rename folders or files in an Azure container.
- album1/image1.jpg -> album2/image1.jpg
- album1/image1.jpg -> album1/image2.jpg
HTH
public class AzureStorageService
readonly CloudStorageAccount _storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);
public void RenameBlob(string oldName, string newName)
var blobClient = _storageAccount.CreateCloudBlobClient();
var container = blobClient.GetContainerReference("MyContainer");
var blobs = container.GetDirectoryReference(oldName).ListBlobs();
foreach (var item in blobs)
string blobUri = item.Uri.ToString();
var oldBlob = container.GetBlockBlobReference(blobUri);
var newBlob = container.GetBlockBlobReference(blobUri.Replace(oldName, newName));
newBlob.StartCopyFromBlob(oldBlob);
oldBlob.Delete();
This method renames only folders
– f0rza
Jul 4 '14 at 9:28
2
Also, I don't know if it's a good idea to delete the old blob while the cop operation is in progress. Just because you returned fromStartCopyFromBlob
doesn't mean the operation completed.
– Dave Van den Eynde
Mar 8 '16 at 8:46
add a comment |
This RenameBlob method will allow you to rename folders or files in an Azure container.
- album1/image1.jpg -> album2/image1.jpg
- album1/image1.jpg -> album1/image2.jpg
HTH
public class AzureStorageService
readonly CloudStorageAccount _storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);
public void RenameBlob(string oldName, string newName)
var blobClient = _storageAccount.CreateCloudBlobClient();
var container = blobClient.GetContainerReference("MyContainer");
var blobs = container.GetDirectoryReference(oldName).ListBlobs();
foreach (var item in blobs)
string blobUri = item.Uri.ToString();
var oldBlob = container.GetBlockBlobReference(blobUri);
var newBlob = container.GetBlockBlobReference(blobUri.Replace(oldName, newName));
newBlob.StartCopyFromBlob(oldBlob);
oldBlob.Delete();
This RenameBlob method will allow you to rename folders or files in an Azure container.
- album1/image1.jpg -> album2/image1.jpg
- album1/image1.jpg -> album1/image2.jpg
HTH
public class AzureStorageService
readonly CloudStorageAccount _storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);
public void RenameBlob(string oldName, string newName)
var blobClient = _storageAccount.CreateCloudBlobClient();
var container = blobClient.GetContainerReference("MyContainer");
var blobs = container.GetDirectoryReference(oldName).ListBlobs();
foreach (var item in blobs)
string blobUri = item.Uri.ToString();
var oldBlob = container.GetBlockBlobReference(blobUri);
var newBlob = container.GetBlockBlobReference(blobUri.Replace(oldName, newName));
newBlob.StartCopyFromBlob(oldBlob);
oldBlob.Delete();
edited Oct 3 '13 at 13:34
answered Oct 3 '13 at 13:17
Manny DelarosaManny Delarosa
152
152
This method renames only folders
– f0rza
Jul 4 '14 at 9:28
2
Also, I don't know if it's a good idea to delete the old blob while the cop operation is in progress. Just because you returned fromStartCopyFromBlob
doesn't mean the operation completed.
– Dave Van den Eynde
Mar 8 '16 at 8:46
add a comment |
This method renames only folders
– f0rza
Jul 4 '14 at 9:28
2
Also, I don't know if it's a good idea to delete the old blob while the cop operation is in progress. Just because you returned fromStartCopyFromBlob
doesn't mean the operation completed.
– Dave Van den Eynde
Mar 8 '16 at 8:46
This method renames only folders
– f0rza
Jul 4 '14 at 9:28
This method renames only folders
– f0rza
Jul 4 '14 at 9:28
2
2
Also, I don't know if it's a good idea to delete the old blob while the cop operation is in progress. Just because you returned from
StartCopyFromBlob
doesn't mean the operation completed.– Dave Van den Eynde
Mar 8 '16 at 8:46
Also, I don't know if it's a good idea to delete the old blob while the cop operation is in progress. Just because you returned from
StartCopyFromBlob
doesn't mean the operation completed.– Dave Van den Eynde
Mar 8 '16 at 8:46
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f12370656%2fhow-to-rename-the-container-name-in-windows-azure%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
See stackoverflow.com/questions/3734672/azure-storage-blob-rename
– Paul Zahra
Sep 11 '12 at 13:21