azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Get-AzRecoveryServicesVaultSettingsFile : Parameter set cannot be resolved using the specified named parameters.

Open villanub opened this issue 7 years ago • 13 comments

Description

Unable to run Get-AzRecoveryServicesVaultSettingsFile : Parameter set cannot be resolved using the specified named parameters.

Steps to reproduce

Type Get-AzRecoveryServicesVaultSettingsFile error occurs, does not accept any parameters

Get-AzRecoveryServicesVaultSettingsFile : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Get-AzRecoveryServicesVaultSettingsFile
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-AzRecoveryServicesVaultSettingsFile], ParameterBindingExceptio
   n
    + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Azure.Commands.RecoveryServices.GetAzureRmRecoveryServic
   esVaultSettingsFile

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.17763.503
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.503
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module versions

Get-InstalledModule -Name  Az.RecoveryServices

Version              Name                                Repository           Description
-------              ----                                ----------           -----------
2.0.0-preview        Az.RecoveryServices                 PSGallery            Microsoft Azure PowerShell - Recovery ...


Debug output

PS C:\WINDOWS\system32> Get-AzRecoveryServicesVaultSettingsFile -Vault $ASR -Debug -Verbose
Get-AzRecoveryServicesVaultSettingsFile : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Get-AzRecoveryServicesVaultSettingsFile -Vault $ASR -Debug -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-AzRecoveryServicesVaultSettingsFile], ParameterBindingExceptio
   n
    + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Azure.Commands.RecoveryServices.GetAzureRmRecoveryServic
   esVaultSettingsFile

Error output

Message        : Parameter set cannot be resolved using the specified named parameters.
StackTrace     :    at System.Management.Automation.CmdletParameterBinderController.ThrowAmbiguousParameterSetException
                 (UInt32 parameterSetFlags, MergedCommandParameterMetadata bindableParameters)
                    at System.Management.Automation.CmdletParameterBinderController.ValidateParameterSets(Boolean
                 prePipelineInput, Boolean setDefault)
                    at
                 System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1
                 arguments)
                    at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
                    at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)
                    at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary
                 psDefaultParameterValues)
                    at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
                    at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object
                 input)
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object
                 input)
                    at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput,
                 CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][]
                 commandRedirections, FunctionContext funcContext)
                    at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
                    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
                 frame)
Exception      : System.Management.Automation.ParameterBindingException
InvocationInfo : {Get-AzRecoveryServicesVaultSettingsFile}
Line           : Get-AzRecoveryServicesVaultSettingsFile
Position       : At line:1 char:1
                 + Get-AzRecoveryServicesVaultSettingsFile
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 14

villanub avatar Jul 09 '19 22:07 villanub

You need -Backup or -SiteRecovery. And -Certificate is a must.

(https://docs.microsoft.com/en-us/powershell/module/az.recoveryservices/get-azrecoveryservicesvaultsettingsfile?view=azps-2.4.0)

ghost avatar Jul 10 '19 07:07 ghost

This command work perfectly fine with the AzureRM module

Get-AzurermRecoveryServicesVaultSettingsFile -Vault $vault -SiteRecovery -Path 'c:\something'

The problem is on the AZ module. Do we have to go back to the AzureRM modules?

diegopietruszka avatar Jul 18 '19 13:07 diegopietruszka

Anyone on this?

diegopietruszka avatar Aug 01 '19 13:08 diegopietruszka

@diegopietruszka: Unfortunately, due to underlying platform limitations, Az module requires a certificate whereas AzureRM does not. While we are pursuing this PS team, request you to kindly take a look at documentation where we provided an example and re-try.

https://docs.microsoft.com/azure/backup/backup-client-automation#registering-using-the-ps-az-module

pvrk avatar Aug 21 '19 06:08 pvrk

Thanks for the answer, but makes no sense. I will stay with the azurerm module then, I'm using Azure to make things easier and simpler for us, don't need this kind of nonsense complications.

diegopietruszka avatar Aug 21 '19 12:08 diegopietruszka

Any activity on this from Microsoft? Managing a self-signed certificate for the vault process is an extra hurdle that we don't need. This severely impedes my work to update all of our automation processes to the new Az module.

marktheiii avatar Feb 04 '20 18:02 marktheiii

@marktheiii : Unfortunately, we still need a self-signed certificate for this with Az Module but we have fixed few issues with the command that may ease the problem a little bit. Please refer to this section for more details

https://docs.microsoft.com/azure/backup/backup-client-automation#registering-using-the-ps-az-module

pvrk avatar Mar 10 '20 06:03 pvrk

@pvrk it is again broken.. not sure why this is soo much unreliable Get-AzRecoveryServicesVaultSettingsFile: X509Certificate is immutable on this platform. Use the equivalent constructor instead.

mganeshphani avatar Apr 28 '20 17:04 mganeshphani

@vidyadharijami : Can you please check on this? @mganeshphani : We tested this internally and this works. Can you please share the version number and more details?

pvrk avatar Jun 08 '20 05:06 pvrk

@mganeshphani Can you please use windows powershell instead of powershell core to check this.

vidyadharijami avatar Jun 08 '20 05:06 vidyadharijami

Please refer below documentation to download vault cred file https://docs.microsoft.com/azure/backup/backup-client-automation#registering-using-the-ps-az-module

vidyadharijami avatar Jun 08 '20 06:06 vidyadharijami

tried this but no luck. opened a new issue #12541

NimalDas avatar Jul 30 '20 16:07 NimalDas

Closing this issue since this is tracked in the new issue.

pvrk avatar Sep 14 '20 18:09 pvrk