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

MSFT_AADApplication: New AADApplication fails to create due to issue with parameter Oauth2RequirePostResponse #2276

Closed
JamieH-risual opened this issue Sep 13, 2022 · 4 comments · Fixed by #2537 or #2546
Assignees
Labels
Bug Something isn't working Entra ID V1.22.907.1 Version 1.22.907.1

Comments

@JamieH-risual
Copy link

When creating a new AADApplication it fails with the error: Resource '' does not exist or one of its queried reference-property objects are not present.

This appears to be an issue with the Oauth2RequirePostResponse parameter as removing it when running New-MGApplication manually creates the application successfully.

It looks like this has already been recognised as an issue on the update of an app as it has been removed from the param list:

image

Verbose logs showing the problem

image

Suggested solution to the issue

Remove the parameter prior to creation:

$currentParameters.Remove("Oauth2RequirePostResponse") | Out-Null

The DSC configuration that is used to reproduce the issue (as detailed as possible)

AADApplication d84f590a-ca35-4bed-9745-7f1e71176a32
        {
            AppId                     = "1a172134-1330-4ead-a557-719b14c52d21";
            AvailableToOtherTenants   = $False;
            Credential                = $Credscredential;
            DisplayName               = "P2P Server";
            Ensure                    = "Present";
            IdentifierUris            = @("urn:p2p_cert");
            KnownClientApplications   = @();
            Oauth2RequirePostResponse = $False;
            ObjectId                  = "2e89d6db-fd47-4fad-81e4-b77e00186956";
            Owners                    = @();
            PublicClient              = $False;
            ReplyURLs                 = @();
        }

Version of the DSC module that was used ('dev' if using current dev branch)

Microsoft365DSC - 1.22.907.1
Microsoft.Graph* - 1.11.1

@andikrueger andikrueger added Bug Something isn't working Entra ID labels Sep 13, 2022
@andikrueger
Copy link
Collaborator

This fix was introduced for the update scenario to fix unit test. The docs for the cmdLet outline this parameter. For me, this looks like an issue with the Microsoft.Graph.* modules and should be fixed there. Removing the parameter within M365DSC could cause configuration drifts and configurations that look like they were applied correctly, but aren't.

@NikCharlebois What's the best place to raise the issue with the Graph module.

@JamieH-risual
Copy link
Author

Thanks for the prompt response @andikrueger. I've raised an issue on the Graph PowerShell SDK page: https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/1502

@andikrueger andikrueger added the V1.22.907.1 Version 1.22.907.1 label Oct 17, 2022
@Faketology
Copy link

Kinda happy I found this, after spending way to much time looking for errors in my implementation LOL. Especially since it was frustrating that Update seemed to work, but New did not.

So thanx @JamieH-risual and @andikrueger.

Not 100% sure how it works at the "Graph PowerShell SDK page". But the Issue now seems to be closed and at least the latest Powershell Microsoft Graph 1.16.0 does still have the same problem.

Is it working for anyone?

@NikCharlebois
Copy link
Collaborator

Let's deprecate this parameter from the resource. The documentation seems off for this parameter anyway:
image

NikCharlebois added a commit to NikCharlebois/Microsoft365DSC that referenced this issue Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Entra ID V1.22.907.1 Version 1.22.907.1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants