Use PowerShell to create a Data Share in Azure

This PowerShell script creates a new Data Share within an existing Data Share account.

Sample script


# Set variables with your own values
$resourceGroupName = "<Resource group name>"
$dataShareAccountName = "<Data share account name>"
$dataShareName = "<Data share name>"

# Create a new Azure Data Share
New-AzDataShare -ResourceGroupName $resourceGroupName -AccountName $dataShareAccountName -Name $dataShareName

Script explanation

This script uses the following commands:

Command Notes
New-AzDataShare Creates a data share.

Next steps

For more information on the Azure PowerShell, see Azure PowerShell documentation.

Additional Azure Data Share PowerShell script samples can be found in the Azure Data Share PowerShell samples.