Microsoft Azure Storage and Database Part 17 – Azure File Service – Create File Share Using Power Shell

Hello Friends,
Hope you all are doing good !!! 🙂 .
In our previous articles we have discussed many part of Azure file share through Azure portal and in our last article we have discussed how to Mount File Share On Window Server Using File Share URL. Today in this article we will discuss how to create Azure File Share using PowerShell.
Tool Installation Articles :
- Configure Azure Command Line Interface ( Azure CLI) On Windows
- Configure PowerShell For Microsoft Azure Az Module On Windows
Previous Azure series :
- Learn Basics Of Azure Networking In 60 Hours
- Learn Basic Of Azure Active Directory And Azure Identity And Access Management
- Azure DevOps – Learn at one place
Tool Installation Articles :
- Configure Azure Command Line Interface ( Azure CLI) On Windows
- Configure PowerShell For Microsoft Azure Az Module On Windows
If you have missed our previous articles on Azure Storage and Database Series, please check it in following links.
Part 1 – Overview Of Azure Storage and Database
Part 2 – Azure Storage Account
Part 4 – Work With Azure Blob Storage
Part 5 – Storage Explorer For Azure Storage
- .
- .
- .
- .
Part 13 – Azure Blob Storage – Work With AzCopy Tool
Part 14 – Azure File Service – Overview
Part 15 – Azure File Service – Mount File Share On Window Server Using PowerShell
Part 16 – Azure File Service – Mount File Share On Window Server Using File Share URL
Next Article : Part 18 – Azure File Service – Upload And Copy Files In File Share Using Power Shell
Create Azure File Share Using PowerShell
Azure file shares are just like other file shares, but stored in the cloud and backed by the Azure platform. Azure File shares support the industry standard Server Message Block (SMB) protocol, the Network File System (NFS) protocol (preview), and enables file sharing across multiple machines, applications, and instances. Today we will create a new File Share using powershell. So let’s go through the following steps.
Step 1 – Open Window Powershell, hopping you have already configured the PowerShell on your machine. If not configured yet please see our post Configure PowerShell For Microsoft Azure Az Module On Windows.
Step 2 – Create a resource group using following script if you don’t have one. In one of our previous demo we have already created the following resource group.
$resourceGroupName = "StorageAndDatabase"
$region = "westus"
New-AzResourceGroup -Name $resourceGroupName -Location $region | Out-Null

Step 3 – Let’s use following PowerShell command to get the required resource group.
$resourceGroup= Get-AzResourceGroup -Name StorageAndDatabase
Step 4 – Storage Account is a shared pool of storage we can use to deploy Azure file shares. So let’s create a Storage Account using New-AzStorageAccount cmdlet if you don’t have one.
$myStorageAcct = New-AzStorageAccount -ResourceGroupName $resourceGroup.ResourceGroupName -AccountName kjstorageaccount1
-Location westus -SkuName Standard_GRS
In one of our previous article, we have created one storage account ( kjstorageaccount1). Let’s get the existing storage account using following PowerShell cmdlet.
$myStorageAccount = Get-AzStorageAccount -ResourceGroupName $resourceGroup.ResourceGroupName -StorageAccountName "kjstorageaccount1"

Step 5 – Now we can create our Azure file share using PowerShell. We can create a file share using the New-AzRmStorageShare cmdlet as showing in the following example.
$fileShare = New-AzRmStorageShare -StorageAccount $myStorageAccount -Name "manas-ps-file-share" -QuotaGiB 1024 | Out-Null


As we can see in the above figure one newly created File Share (manas-ps-file-share
) visible in Azure portal.
Next Article : Part 18 – Azure File Service – Upload And Copy Files In File Share Using Power Shell
I hope this is informative to you. Please let me know if I missed anything important or if my understanding is not up to the mark. Keep reading, share your thoughts, experiences. Feel free to contact us to discuss more.
If you have any suggestion / feedback / doubt, you are most welcome. Stay tuned on Knowledge-Junction, will come up with more such articles.
Thanks for reading 🙂 .
6 Responses
[…] Part 17 – Azure File Service – Create File Share Using Power Shell […]
[…] Part 17 – Azure File Service – Create File Share Using Power Shell […]
[…] Part 17 – Azure File Service – Create File Share Using Power Shell […]
[…] Part 17 – Azure File Service – Create File Share Using Power Shell […]
[…] Part 17 – Azure File Service – Create File Share Using Power Shell […]
[…] Part 17 – Azure File Service – Create File Share Using Power Shell […]
You must log in to post a comment.