Closed DennisMunns closed 4 years ago
@DennisMunns Could you see whether the following cmdlet which changes the order of the parameters also has the same issue? Enable-AzRecoveryServicesBackupProtection -Policy $BackupPolicy -Name $FilesStorageAccount -StorageAccountName $FilesStorageAccount -VaultId $Vault.ID
Hi @DennisMunns . You are getting this error mostly because you have passed a fileshare name that doesn't exist in the storage account. Try giving a valid fileshare name once. However the exception caused is because of a faulty error message which will be fixed in the next release.
@sambitratha the issue was the share name in the -Name parameter, thanks.
Is it also possiable to update the help info to make this clearer?
@DennisMunns Sure. Could you please mention the changes that you made in the -Name parameter. Thanks
@sambitratha as you suggested, I was passing an incorrect value to the parameter. Giving the -Name parameter the AzureFiles share name fixed the issue.
If the help info on the parameter explained that the value should be the name of the share, I think that would clear things up a bit.
@DenisMunns: Thanks for the feedback. We have improved the error message and it should be reflected in the next release. Closing this issue.
Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.
Description
Running Enable-AzRecoveryServicesBackupProtection to add a storage account to the vault returns "Enable-AzRecoveryServicesBackupProtection : Index (zero based) must be greater than or equal to zero and less than the size of the argument list."
Steps to reproduce
Environment data
Module versions
Debug output
Error output