Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-AzDisk: Missing required parameter StorageAccountId #26573

Open
elcrgo opened this issue Nov 3, 2024 · 1 comment
Open

New-AzDisk: Missing required parameter StorageAccountId #26573

elcrgo opened this issue Nov 3, 2024 · 1 comment
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Compute customer-reported Service Attention This issue is responsible by Azure service team.

Comments

@elcrgo
Copy link

elcrgo commented Nov 3, 2024

Description

Source documentation: https://learn.microsoft.com/en-us/azure/virtual-machines/scripts/virtual-machines-powershell-sample-create-managed-disk-from-vhd

When I run the script New-AzDisk -DiskName $diskName -Disk $diskConfig -ResourceGroupName $resourceGroupName -StorageAccountId $storageAccountId it complains about the parameter StorageAccountId which cannot be found.

However when I omit this parameter, it complains about a missing required parameter 'StorageAccountId'.

So it can't run with or without this parameter. How to proceed?

Issue script & Debug output

Run script with parameter 'StorageAccountId':

New-AzDisk: /home/rick/createdisk.ps1:61
Line |
61 | … onfig -ResourceGroupName $resourceGroupName -StorageAccountId $storag …
| ~~~~~~~~~~~~~~~~~
| A parameter cannot be found that matches parameter name 'StorageAccountId'.

Run script without parameter 'StorageAccountId':

New-AzDisk: /home/rick/createdisk.ps1:61
Line |
61 | New-AzDisk -DiskName $diskName -Disk $diskConfig -ResourceGroupName $ …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Required parameter 'storageAccountId' is missing (null). ErrorCode: BadRequest ErrorMessage: Required parameter 'storageAccountId' is missing (null). ErrorTarget: StatusCode: 400 ReasonPhrase: Bad Request OperationID : 399f6f8b-e088-4ec6-aff7-1c584c0b457e

Environment data

PS /home/rick> $PSVersionTable

Name Value


PSVersion 7.4.5
PSEdition Core
GitCommitId 7.4.5
OS CBL-Mariner/Linux
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Module versions

PS /home/rick> Get-Module Az*

ModuleType Version PreRelease Name ExportedCommands


Script 3.0.4 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script 8.4.0 Az.Compute {Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUnattendContent, Add-AzVMDataDisk…}
Script 7.9.0 Az.Network {Add-AzApplicationGatewayAuthenticationCertificate, Add-AzApplicationGatewayBackendAddressPool, Add-AzApplicationGatewayBackendHttpSetting, Add-AzApplicationGatewayBackendSetting…}
Script 6.15.1 Az.Resources {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}
Script 7.4.0 Az.Storage {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagementPolicyAction, Add-AzStorageAccountNetworkRule, Close-AzStorageFileHandle…}
Script 1.1.3 Az.Tools.Predictor {Disable-AzPredictor, Enable-AzPredictor, Open-AzPredictorSurvey, Send-AzPredictorRating}
Script 0.0.0.10 AzureAD.Standard.Preview {Add-AzureADApplicationOwner, Add-AzureADDeviceRegisteredOwner, Add-AzureADDeviceRegisteredUser, Add-AzureADDirectoryRoleMember…}
Script 0.9.3 AzurePSDrive

Error output

PS /home/rick> Resolve-AzError -Last

HistoryId: 32

Message : A parameter cannot be found that matches parameter name 'storageAccountId'.
StackTrace : at System.Management.Automation.CmdletParameterBinderController.VerifyArgumentsProcessed(ParameterBindingException originalBindingException)
at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection1 arguments) at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection1 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 ---
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 : {New-AzDisk}
Line : New-AzDisk -DiskName $diskName -Disk $diskConfig -ResourceGroupName $resourceGroupName -storageAccountId $storageAccountId
Position : At /home/rick/createdisk.ps1:61 char:88
+ … onfig -ResourceGroupName $resourceGroupName -storageAccountId $storag …
+ ~~~~~~~~~~~~~~~~~
HistoryId : 32

@elcrgo elcrgo added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Nov 3, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Nov 3, 2024
@vidai-msft vidai-msft added Compute Service Attention This issue is responsible by Azure service team. labels Nov 7, 2024
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @TravisCragg-MSFT, @nikhilpatel909, @sandeepraichura, @hilaryw29, @GabstaMSFT, @ramankumarlive, @ushnaarshadkhan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Compute customer-reported Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants