Azure / Azure/azure-powershell

Update-AzADApplication : Cannot bind argument to parameter 'Id' because it is an empty string.

Open
#19,069 23 comments 0 reactions 1 assignee Claimed by @VeryEarly View on GitHub
AAD act-identity-squad Azure PS Team bug customer-reported needs-team-attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

Hi,

while updating this service principal I get the following error.

### Issue script & Debug output

```PowerShell
Connect-AzAccount

$appId = "00000015-0000-0000-c000-000000000000"
$sp = Get-AzADServicePrincipal -ApplicationId $appId
$sp | Set-AzADServicePrincipal -ReplyUrl $sp.ReplyUrl

Update-AzADApplication : Cannot bind argument to parameter 'Id' because it is an empty string.
At C:\Program
Files\WindowsPowerShell\Modules\Az.Resources\6.0.1\MSGraph.Autorest\custom\Update-AzADServicePrincipal.ps1:617 char:5
+ Update-AzADApplication @param
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Update-AzADApplication], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Update-AzADApplication
```

### Environment data

```PowerShell
$PSVersionTable

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

### Module versions

```PowerShell
Get-Module Az*

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.9.0 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear...
Script 6.0.1 Az.Resources {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDeny...
```

### Error output

```PowerShell
HistoryId: 5

Message : Cannot bind argument to parameter 'Id' because it is an empty string.
StackTrace : at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext
funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar,
Object inputToProcess)
at System.Management.Automation.PSScriptCmdlet.DoProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
Exception : System.Management.Automation.ParameterBindingValidationException
InvocationInfo : {Update-AzADApplication}
Line : Az.MSGraph.internal\Update-AzADApplication @PSBoundParameters

Position : At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.0.1\MSGraph.Autorest\custom\Update-AzADAp
plication.ps1:545 char:48
+ Az.MSGraph.internal\Update-AzADApplication @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~
HistoryId : 5

The Azure PowerShell team is listening, please let us know how we are doing: https://aka.ms/azpssurvey?Q_CHL=ERROR.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.