简体   繁体   English

无法在portal.azure.com中删除存储帐户

[英]Failed to delete storage account in portal.azure.com

I deleted a Virtual Machine and its associated cloud service and virtual network but I can't delete its storage account. 我删除了虚拟机及其关联的云服务和虚拟网络,但我无法删除其存储帐户。

I got this error: 我收到了这个错误:

Failed to delete storage account messega. 无法删除存储帐户messega。 Unable to delete storage account 'messega': 无法删除存储帐户'messega':

'Storage account messega has some active image(s) and/or disk(s), eg messega-messega-os-1449504882530. '存储帐户messega有一些活动图像和/或磁盘,例如messega-messega-os-1449504882530。 Ensure these image(s) and/or disk(s) are removed before deleting this storage account.'. 在删除此存储帐户之前,请确保删除这些映像和/或磁盘。'。

I went to Storage accounts (classic)>>Services--Blobs>>Containers--vhds and tried to delete the storage container 'vhds': messega-messega-os-1449504882530 but I got this new error: 我去了存储帐户(经典)>>服务 - Blob >>容器 - vhds并试图删除存储容器'vhds':messega-messega-os-1449504882530但我收到了这个新错误:

Failed to delete storage container 'vhds'. 无法删除存储容器'vhds'。 Error: 'There is currently a lease on the container and no lease ID was specified in the request.' 错误:'当前存在容器租约,并且未在请求中指定租约ID。

删除磁盘可以通过以前版本的门户网站manage.windowsazure.com虚拟机 - >磁盘完成

It's a common error. 这是一个常见的错误。 Your vhd is in this storage account, that's why you can't remove it, without delete the vhd. 您的vhd在此存储帐户中,这就是为什么在不删除vhd的情况下无法将其删除的原因。

https://stackoverflow.com/a/10969013/1384539 https://stackoverflow.com/a/10969013/1384539

If lease on your .vhd keeps annoying you, you may use a tool than enables to break the lease such as Azure Management Studio or use code to break it : 如果您的.vhd上的租约一直让您烦恼,那么您可以使用一个工具而不是启用来破坏租约,例如Azure Management Studio或使用代码来破坏它:

        var azureStorageConnectionString = ConfigurationManager.AppSettings["AzureStorage.ConnectionString"];
        var blobFileToDelete= ConfigurationManager.AppSettings["BlobFileToDelete.Name"];  

        var account = CloudStorageAccount.Parse(azureStorageConnectionString);

        // Create the blob client using the Accounts above
        var client = account.CreateCloudBlobClient();
        // Retrieve reference to a previously created container
        // Rename "vhds" as needed.  Can be used to read from any container.
        var container = client.GetContainerReference("vhds");

        var blob = container.GetBlockBlobReference(blobFileToDelete);

        if (blob.Properties.LeaseStatus==Microsoft.WindowsAzure.Storage.Blob.LeaseStatus.Locked) 
        { 
            try 
            { 
                Console.WriteLine("Breaking leases on {0} blob.",blobFileToDelete); 
                // Create Timespan to allow the Lease to remain, in this case 1 second
                TimeSpan breakTime = new TimeSpan(0, 0, 1);

                blob.BreakLease(breakTime, null, null, null); 
                Console.WriteLine("Successfully broken lease on {0} blob.",blobFileToDelete); 
            } 
            catch (StorageException ex ) 
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine("Failed to break lease on {blobName} blob.", blobFileToDelete); 
            } 
        } 
        else 
        {
            Console.WriteLine("The {0} blob's lease status is unlocked.", blobFileToDelete); 
        } 
        Console.ReadLine();

Hopes this helps Best regards Stéphane 希望这有助于最好的问候Stéphane

您需要使用Azure存储资源管理器工具,并在大多数情况下检查容器的内容是否为空

I tried all these things with no luck. 我没有运气就尝试了所有这些事情。 The answer for me was to download http://storageexplorer.com/ and from this tool I was able to delete the necessary files. 我的答案是下载http://storageexplorer.com/ ,从这个工具我能够删除必要的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 portal.azure.com 阻止用户 - Block user from portal.azure.com manage.windowsazure.com与portal.azure.com - manage.windowsazure.com vs. portal.azure.com portal.azure.com 中的 Azure 应用服务运行时堆栈可用性 - Azure App Service Runtime Stack Availability in portal.azure.com portal.azure.com WebApp面板,无信息/标签 - portal.azure.com WebApp Panel without info/tabs 远程桌面通过端口443到azure VM(由新门户网站portal.azure.com创建) - remote desktop to an azure VM (created by the new portal - portal.azure.com) over the port 443 如何在 Azure Application Insights 中使用 BeginScope(在 https://portal.azure.com 中)? - How to use BeginScope in Azure Application Insights (in https://portal.azure.com)? 创建自定义Azure RBAC角色以允许用户交换portal.azure.com中的插槽 - Creating Custom Azure RBAC Role to allow users to swap slots within portal.azure.com 通过 https://portal.azure.com 导出 Azure SQL 永远不会完成 - Azure SQL Export via https://portal.azure.com Never Completes 可以在Azure AD上登录的Java代码,但无需登录portal.azure.com即可获得代码 - Java code to sign-in at Azure AD but need code without login to portal.azure.com portal.azure.com仪表板上的VM诊断指标编号似乎不正确 - Numbers for diagnostics metrics of VM on portal.azure.com dashboard seem incorrect
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM