DEV Community

Wallism
Wallism

Posted on

Azure Az.Storage command returns "A task was canceled."

Using az.storage version 6.1.0 with this command:

$context = New-AzStorageContext -StorageAccountName accountname
Enter fullscreen mode Exit fullscreen mode

(run after successfully connecting - Connect-AzAccount - and selecting the correct subscription - Set-AzAccount)

I kept getting this error:

New-AzStorageContext: A task was canceled.

Not the most helpful error message! Turns out the fix is very simple, we now need to provide the key as well (the previous version I was running did not require the key)

$context = New-AzStorageContext -StorageAccountName accountname -StorageAccountKey accountkey
Enter fullscreen mode Exit fullscreen mode

Easy...made difficult by the useless error message.

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay