microsoftgraph / msgraph-bicep-types

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

Adding logo to an application returns error `Unexpected contents in request body` #153

Open SimonWahlin opened 3 months ago

SimonWahlin commented 3 months 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: 025d0b33-4e7a-4301-a498-151ea9b39030. Graph request timestamp: 2024-07-11T18:52:02Z.

Describe the bug Using the property logo, either using a string (empty or not), a URL or a base64 encoded string of an image results in an error stating: Unexpected contents in request body.

To Reproduce Steps to reproduce the behavior: Deploy following bicep template:

provider microsoftGraph

resource appRegistration 'Microsoft.Graph/applications@v1.0' = {
  uniqueName: 'myExampleApp'
  displayName: 'myExampleApp'
  logo: 'testlogo'
}

Additional context Removing logo makes the deployment work, can't find any documentation describing how logo is supposed to be used with Bicep. According to the Graph API documentation it can be added using the PUT method and a stream.

dkershaw10 commented 3 months ago

Thanks @SimonWahlin We'll take a look at this. As this is a Stream property, we might need to consider exposing this in a different way in Graph Bicep. In Microsoft Graph, Stream properties must be updated separately from the rest of the entity type's properties, on their edit URL via a PUT operation, so even though we expose it as a property of application, it cannot be updated directly as it is currently modelled in Graph Bicep. Sorry - we totally missed this.

SimonWahlin commented 3 months ago

Thanks for your quick reply. No problem, I'm just preparing some training material and just want to report the problems I encounter.

dkershaw10 commented 3 months ago

We'll take another look at this. It'll require a bit of design work on our side first to figure out the best way to do this. We'll come back to you when we have more info to share.