Closed gvanbuskirkpps closed 6 months ago
@gvanbuskirkpps Could you please try Remove-AzStorageTable -Table $table.name -Context $ctx -Force
instead of -Confirm
to see if the issue persists?
If the issue still happens, could you help check if the script hangs at Remove-AzStorageTable
and get a network trace so we can investigate further? Thanks!
@yifanz7 Good suggestion. I tried it with the -Force parameter instead of -Confirm and it worked fine. Issue seems to only reside with the -Confirm flag or with neither -Confirm or -Force.
@gvanbuskirkpps It's great that adding -Force works! In this case -Confirm also works as intended as the differences between -Confirm and -Force are:
-confirm
means PSH will have a prompt message to ask confirmation when the ShouldProcess() method is called. (by default ShouldProcess() method doesn't need confirmation .)Also if there's content in the table, PSH will have the prompt message that needs user's input to continue the deletion if -Force is not specified.
An exmaple of deleting with -Confirm:
Therefore for the cases of with -Confirm, and with neither -Confirm or -Force, the script would hang there waiting for user's input when the script is running unattended.
@yifanz7 Did you press [Y] there? I was running it attended. When I pressed Y Enter to confirm, the cmdlet just sat there and never actually deleted the table.
@gvanbuskirkpps Yeah I pressed Y and Enter to confirm and it worked well for me. Do you have a network trace of the cmdlet that hangs so that we can investigate further?
@yifanz7 the eventual plan for my use case for this cmdlet is to run it unattended anyway. It's very well possible that my particular configuration is wayy out of date for this anyway. I'm running 5.1 on Az.Storage so I'm going to upgrade that and take another stab.
If I did need to reopen this issue at a later date, what kind of network trace are you looking for, just a total packet capture while I try to run the cmdlet?
@gvanackern Gotcha. If running with -Force works and CLI works well too, it's unlikely to be a PSH issue. We can look into the issue further if the script doesn't work even with -Force parameter.
And for the network trace - just need http requests and responses to and from the server. Normally can get it by adding -Debug to the cmdlet. However in this case it doesn't seem to be a network issue so it might not help too much.
Closing the issue for now. @gvanackern please feel free to let us know if any further assistance is needed
Description
I've attempted this across multiple subscriptions, had my coworker try it as well.
If you check the issue script, it contains minimal code to reproduce the issue. You'll need to fill in a subscriptionname, StorageAccountName, StorageAccountResourceGroupName, and a Table name which you don't care if you delete.
The script will hang for a long time before looking like it did its work and then silently quits, without ever actually deleting the table.
I did the same logic in az cli and the portal/storage explorer ui and the tables are deleted almost instantly.
Issue script & Debug output
Environment data
Module versions
Error output
No response