Skip to content

Failure response from Update-MgApplication with -Web switch and RedirectUris specified since version 2.26.0 #3149

Closed
@sbest-gcm

Description

@sbest-gcm

Describe the bug

Since version 2.26.0, I am getting an error when attempting to update an App Registration including the -Web switch with RedirectUris set, using Update-MgApplication.

Update-MgApplication_UpdateExpanded: XXX
Line |
  13 |  Update-MgApplication -ApplicationId $appRegistration.Id `
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Invalid value specified for property 'web' of resource 'Application'.  Status: 400 (BadRequest) ErrorCode: Request_BadRequest Date: 2025-02-20T20:08:52  Headers: Cache-Control                 : no-cache Vary                          :     
     | Accept-Encoding Strict-Transport-Security     : max-age=31536000 request-id                    : ec39fe39-4203-4059-8dae-51a5fada1f93 client-request-id             : b4ef96a3-9287-4d58-be46-b9d20dfb530a x-ms-ags-diagnostic           :     
     | {"ServerInfo":{"DataCenter":"North Central US","Slice":"E","Ring":"4","ScaleUnit":"000","RoleInstance":"CH01EPF0004FDBC"}} x-ms-resource-unit            : 1 Date                          : Thu, 20 Feb 2025 20:08:51 GMT

Expected behavior

The app registration to be updated without an error.

How to reproduce

Create an App Registration and execute the below script:

Import-Module Microsoft.Graph.Applications

Connect-AzAccount
Connect-MgGraph -Scopes 'Application.ReadWrite.All' -TenantId "<redacted>"

$DisplayName = "test-application-name"
$appRegistration = Get-MgApplication -Filter "DisplayName eq '$DisplayName'"

$web = @{
    RedirectUris = @("http://localhost/.auth/login/aad/callback")
}

Update-MgApplication -ApplicationId $appRegistration.Id -Web $web

SDK Version

2.26.0

Latest version known to work for scenario above?

2.25.0

Known Workarounds

No response

Debug output

Click to expand log ```

Update-MgApplication_UpdateExpanded: C:\Users\SBEST\OneDrive - GCM Grosvenor\Documents\bugtest.ps1:13:1
Line |
13 | Update-MgApplication -ApplicationId $appRegistration.Id `
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Invalid value specified for property 'web' of resource 'Application'. Status: 400 (BadRequest) ErrorCode: Request_BadRequest Date: 2025-02-20T20:08:52 Headers: Cache-Control : no-cache Vary :
| Accept-Encoding Strict-Transport-Security : max-age=31536000 request-id : ec39fe39-4203-4059-8dae-51a5fada1f93 client-request-id : b4ef96a3-9287-4d58-be46-b9d20dfb530a x-ms-ags-diagnostic :
| {"ServerInfo":{"DataCenter":"North Central US","Slice":"E","Ring":"4","ScaleUnit":"000","RoleInstance":"CH01EPF0004FDBC"}} x-ms-resource-unit : 1 Date : Thu, 20 Feb 2025 20:08:51 GMT

</details>


### Configuration

Name                           Value
----                           -----
PSVersion                      7.4.6
PSEdition                      Core
GitCommitId                    7.4.6
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Error is not specific to this configuration, also happening on our DevOps pipelines.

### Other information

This error started occurring upon the recent release of Microsoft.Graph 2.26.0. The call works if I don't include the RedirectUris. The RedirectUris I've attempted to use in PowerShell succeed in the portal.

Metadata

Metadata

Assignees

Labels

type:bugA broken experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions