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

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

Closed
sbest-gcm opened this issue Feb 20, 2025 · 2 comments · Fixed by #3153
Assignees
Labels
type:bug A broken experience

Comments

@sbest-gcm
Copy link

sbest-gcm commented Feb 20, 2025

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.
@sbest-gcm sbest-gcm added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Feb 20, 2025
@sbest-gcm sbest-gcm changed the title Failure response from Update-MgApplication with -Web switch and RedirectUris specified Failure response from Update-MgApplication with -Web switch and RedirectUris specified since version 2.26.0 Feb 20, 2025
@sbest-gcm
Copy link
Author

I've also tried this format, same error:

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

@timayabi2020
Copy link
Contributor

Hi @sbest-gcm apologies for this experience. Kindly use Invoke-MgGraphRequest cmdlet as we work to resolve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A broken experience
Projects
None yet
2 participants