microsoftgraph / msgraph-bicep-types

Repo contains Microsoft Graph resource types to integrate with bicep templates.
MIT License
37 stars 6 forks source link

Using property `oauth2RequirePostResponse` causes error "Resource '' does not exist" #155

Open SimonWahlin opened 1 month ago

SimonWahlin commented 1 month ago

Bicep version Bicep CLI version 0.28.1 (ba1e9f8c1e)

Resource and API version Microsoft.Graph/applications@v1.0

Auth flow Interactive using az cli

Deployment details Graph client request id: a8459e6a-82ab-4e71-b79c-96ac9ad696d9. Graph request timestamp: 2024-07-12T12:33:57Z.

Describe the bug Using the property oauth2RequirePostResponse when deploying an application using bicep cases an error stating: Resource '' does not exist or one of its queried reference-property objects are not present.

This happens both if I'm deploying to an already existing application as well as trying to create a new one. I have tried to use the values true, false and null with the same result.

To Reproduce Deploy the following template:

provider microsoftGraph

resource appRegistration 'Microsoft.Graph/applications@v1.0' = {
  uniqueName: 'myExampleApp'
  displayName: 'myExampleApp'
  oauth2RequirePostResponse: false
}
dkershaw10 commented 1 month ago

Thanks @SimonWahlin We can try to repro this - but the error that's coming back in the logs is a 404 not found, which is a bit odd.

SimonWahlin commented 1 month ago

@dkershaw10 thanks. Every time I try to det this property I'm experiencing the same error. Have tried with all possible values and multiple different combinations of other properties set. The repro template above is the smallest repro I could make, would be interesting to see if anyone else can make it work.

dkershaw10 commented 1 month ago

I repro'd the issue. We'll need to look into this a bit further.

dkershaw10 commented 1 month ago

@SimonWahlin NOTE: I can reproduce the same thing through Graph Explorer, so this is an issue with the underlying Graph API and not with Graph Bicep.

For now I would recommend omitting this property (as long as the default behaviour of "false" is what you want.

dkershaw10 commented 1 month ago

@jason-dou it looks like another case of a property being publicly exposed that isn't exposed in the underlying directory service. Confirming with the app model team...