microsoftgraph / microsoftgraph/msgraph-beta-sdk-dotnet

BitLockerRecoveryKey VolumeType Conversion from https request wrong

Open
#848 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug: metadata type:bug
Dominant language
C#
Stars
112
Forks
37
Avg merge
14h 57m
Merged PRs (30d)
3

Description

Describe the bug

Im trying to get all BitlockerRecoveryKey objects via Graph API using the GraphServiceClient library in the newest beta version 5.77.0-preview.
This is my request:
var allBitlockerRecoveryKeys = await GraphClient.InformationProtection.Bitlocker.RecoveryKeys.GetAsync(requestConfiguration => { requestConfiguration.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"); });

This is one of the results:
image

The Volume Type is "FixedDataVolume" in every Result which is strange in itself but ok.
But if I now look at the same deviceId in Azure via my browser, the Volume Type is "Operating system drive".
image

Also if i go through the http data that my own GraphClient gets i get the Volume Type "1" (which stands for Operating System Drive according to the docu)

But somehow if it goes through the type from Microsoft.Graph.Beta.Models it gets converted to the wrong type.

Expected behavior

The VolumeType should convert the json data from the http request result to the correct value.
volumeType=1 => operatingSystemVolume
volumeType=2 => fixedDataVolume
...

How to reproduce

NuGet Package Microsoft.Graph.Beta 5.77.0-preview
Functioning and Authenticated GraphClient
Execute
var allBitlockerRecoveryKeys = await GraphClient.InformationProtection.Bitlocker.RecoveryKeys.GetAsync(requestConfiguration =>
{
requestConfiguration.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36");
});

SDK Version

5.77.0-preview

Latest version known to work for scenario above?

No response

Known Workarounds

Workaround is to just use a normal http request without GraphServiceClient Library

Debug output
Click to expand log ```
</details>


### Configuration

Windows 11, x64
Nothing Special. Using Visual Studio 22
net6.0

### Other information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the BitLockerRecoveryKey request through GraphServiceClient with Microsoft.Graph.Beta 5.77.0-preview, then compare the raw HTTP volumeType value with the Microsoft.Graph.Beta.Models conversion. The work is done when volumeType=1 maps to operatingSystemVolume, volumeType=2 maps to fixedDataVolume, and the returned model matches the API data.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.