Unable to delete and find storage account

Magnus Eriksen 0 Reputation points
2024-04-24T11:32:40.5733333+00:00

Hi!

I am using pulumi to generate and create a storage account to launch a blob with a container. The code works fine, but pulumi is unable to locate the account upon deletio. When I use the Azure CLI I have the same problem, but in the portal I do find the account. This is a bit strange since it just happens from now and then, but I do experience this issue most frequent from 10-16. Does anyone know how it is possible to fix this, or if it just on the Azure side of things?

Diagnostics:

azure:storage:Container (storCont872ddc75750445):

error: deleting urn:pulumi:dev::vul2::azure:storage/container:Container::storCont872ddc75750445: 1 error occurred:
* Unable to locate Storage Account "pulumistoreaccount1"!

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,733 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Amrinder Singh 2,690 Reputation points Microsoft Employee
    2024-04-24T12:35:55.46+00:00

    Hi Magnus Eriksen - Thanks for reaching out over Q&A Forum.

    This appears to be a scenario wherein although the request for deletion was accepted successfully however at the backend the clean up isn't completed correctly. As a result, there appears to be a difference in the behavior.

    Ideally if the account had been deleted, it shouldn't be found which I believe is the expected behavior however since it reflects in Portal, creates the confusion.

    On the Portal, once you navigate to the storage account, there will be a field name "Provisioning State " on the Overview Page. Please check what is the status reflecting in there.

    It is suggested to wait for some time and then check ahead but if doesn't helps, then it is recommended to raise a support ticket so that it can be looked for the backend details further.

    Please let us know if you have any further queries. I’m happy to assist you further.

    ---Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


  2. Nehruji R 2,661 Reputation points Microsoft Vendor
    2024-04-25T09:22:30.37+00:00

    Hello Magnus Eriksen,

    Greetings! Welcome to Microsoft Q&A Platform.

    There are scenarios when pulumi destroy will fail to delete resources as expected. This is anticipated due to the nature of cloud provider dependencies, permissions, resources being in a state that prevents their deletion, or when a timeout is not long enough for the cloud provider to complete its operation. Review the output to identify which resources were not deleted and consider the following steps depending on the nature of the failure.

    Check to see if a resource was deleted after all

    Some resources take time to be removed. Common examples include CloudFront Lambda@Edge functions, which will fail to destroy but will eventually disappear without requiring further action. In these cases, you can wait and run pulumi refresh to see if the cloud provider was able to remove the resource.

    Check dependencies

    If the issue is due to dependencies, identify and delete the dependent external resources manually. This may involve navigating the cloud provider’s console or using its CLI to pinpoint and resolve these dependencies.

    Empty or adjust resources

    Occasionally a resource cannot be deleted because it contains data or uses network interfaces or other dependencies managed outside the stack. Common examples include deleting VPCs with EINs attached elsewhere or deleting a security group when it is in use. You will need to evaluate the dependencies given the failure and take the necessary actions to resolve this on each provider resource.

    Delete resources manually

    For each resource that couldn’t be deleted, use the cloud provider’s console or CLI to manually delete it. This may be necessary for resources in a locked state or those with specific permissions preventing automated deletion.

    Once you have resolved the source of the deletion failure, you can run pulumi refresh to validate that all of your resources are destroyed. This command will update your Pulumi state to reflect the current state in the cloud, effectively recognizing any manual deletions or changes that occurred outside of Pulumi’s management.

    refer - https://www.pulumi.com/docs/support/troubleshooting/ for more detailed guidance.

    Normally, from the activity logs on the Resource group level you should be able to see the Storage account deletion operation which will provide you the Event Initiated by details.

    Hope this answer helps! Please let us know if you have any further queries. I’m happy to assist you further.


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments