In this Azure PowerShell article, we will discuss the syntax and usage of the New-AzStorageQueue PowerShell command with certain examples.
Table of Contents
New-AzStorageQueue
This PowerShell command can help you to create a storage queue in Azure.
Syntax
Below is the syntax of the New-AzStorageQueue Azure PowerShell command.
New-AzStorageQueue
[-Name] <String>
[-Context <IStorageContext>]
Examples
Let’s discuss a few examples of the New-AzStorageQueue PowerShell command.
Example-1:
You can execute the below PowerShell command to quickly create a storage queue in Azure.
$myrg1 = "DEMORG2"
$mysactnm1 = "demoggh"
$mysactKey1 = (Get-AzStorageAccountKey -ResourceGroupName $myrg1 -AccountName $mysactnm1).Value[0]
$myctx1 = New-AzStorageContext -StorageAccountName $mysactnm1 -StorageAccountKey $mysactKey1
New-AzStorageQueue -Name "demoiu" -Context $myctx1
Note: Don’t forget to pass the storage context with the New-AzStorageQueue PowerShell command, or else you will get the error.
After executing the above command, I got the below-expected output.
Queue End Point: https://demoggh.queue.core.windows.net/
Name Uri ApproximateMessageCount EncodeMessage
---- --- ----------------------- -------------
demoiu https://demoggh.queue.core.windows.net/demoiu True
You can see the same output as below

Wrapping Up
In this Azure PowerShell article, we discussed the syntax and usage of the New-AzStorageQueue PowerShell command with certain examples. Thanks for reading this article !!!