none
Unable to create azure premium file storage with PowerShell RRS feed

  • Question

  • Hi All,

    I am trying this powershell command to create the Azure File Storage

    New-AzStorageAccount  -ResourceGroupName "Resource Group Name" -AccountName "Storage Account Name" -SkuName "Premium_LRS" -Location "westus2" -Kind "FileStorage"

    The error I am getting is below. Can anyone please suggest what is the issue?

    New-AzStorageAccount : Cannot validate argument on parameter 'Kind'. The argument "FileStorage" does not belong to the set "Storage,StorageV2,BlobStorage,BlockBlobStorage" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.
    At line:1 char:143
    + ... vp448" -SkuName "Premium_LRS" -Location "westus2" -Kind "FileStorage"
    +                                                             ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [New-AzStorageAccount], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Azure.Commands.Management.Storage.NewAzureStorageAccountCommand

    Monday, July 15, 2019 10:48 AM

All replies

  • @Askwizard I was able to create Azure Premium file storage using Powershell

    Note: Try in Cloud shell and let me know the status.

    New-AzStorageAccount -ResourceGroupName subm -name <storageaccountname> -SkuName Premium_LRS -Location 'West Us' -Kind filestorage 

    You may also try different option:

    $resourceGroup = "storage-how-to-resource-group"
    $location = "westus2"
    New-AzResourceGroup -Name $resourceGroup -Location $location
    $storageAcct = New-AzStorageAccount -ResourceGroupName $resourceGroup -Name "fileshowto" -SkuName "Premium_LRS" -Location "westus2" -Kind "FileStorage"
    

    Hope this helps!

    Kindly let us know if the above helps or you need further assistance on this issue.
    -----------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and Upvote on the post that helps you, this can be beneficial to other community members.

    Monday, July 15, 2019 11:49 AM
    Moderator
  • Please make sure you are using the latest version of the az module.

    https://www.powershellgallery.com/packages/Az/2.4.0

    Monday, July 15, 2019 10:42 PM
  • @Askwizard  Just checking in to see if the above answer helped. If this answers your query, do click “Mark as Answer” and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us 
    Wednesday, July 17, 2019 5:52 AM
    Moderator
  • @Askwizard Is there any update on the issue?

    If the suggested answer helped for your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members.

    Monday, July 22, 2019 4:36 AM
    Moderator
  • @Askwizard  I am following up on this query.
    Is there any update on the issue?

    If the suggested answer helped for your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members.

    Wednesday, July 24, 2019 8:07 AM
    Moderator
  • Hi Sumanth,

    Thanks for the follow up, it didn't work from my laptop and I am getting same error however worked from Azure CloudShell.

    I have update the Az module to the latest one still didn't work.

    Wednesday, July 24, 2019 8:47 AM
  • Thanks for letting us know the status of the issue was able to be fixed! This is related to Azure Powershell Module. Un-install the old Powershell module and install the latest PS module.

    Note: System restart is required for the necessary changes take place.

    Az2.0 : https://www.powershellgallery.com/packages/Az/2.0.0

    Kindly let us know if the above helps or you need further assistance on this issue.
    -----------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and Upvote on the post that helps you, this can be beneficial to other community members.

    Wednesday, July 24, 2019 10:56 AM
    Moderator
  • @Askwizard Just checking in to see if the above answer helped. If this answers your query, do click “Mark as Answer” and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.
    Friday, July 26, 2019 5:17 AM
    Moderator
  • @Askwizard Is there any update on the issue?

    If the suggested answer helped for your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members.

    Wednesday, July 31, 2019 5:35 AM
    Moderator