microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

Unable to create a configuration snapshot job with ConfigurationManagement builder

Open
#3,155 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:waiting-for-triage type:bug
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Describe the bug

I am trying to create a snapshot to be used for creating a monitor in tenant configuration management api, but getting an AggregateException with 404 code and an empty message. It seems, that no methods are implemented in this builder, as this code produces the exception:

graphClient.Admin.ConfigurationManagement.ConfigurationSnapshot.PostAsync(body)

It seems the correct method should be ConfigurationSnapshot.CreateSnapshot.PostAsync but it just doesn't exist. Also, it accepts the object of the type ConfigurationBaseline however in the Microsoft Graph API docs, the type should be probably something like ConfigurationSnapshotJob, or at least sharing properties with this type

Expected behavior

await graphClient.Admin.ConfigurationManagement.ConfigurationSnapshot.PostAsync(body)
should be scheduling a ConfigurationSnapshotJob and providing it in the response body. Alternatively, the following method should exist to conform with the API schema:

await graphClient.Admin.ConfigurationManagement.ConfigurationSnapshots.CreateSnapshot.PostAsync(body)

How to reproduce

If all permissions are assigned and Graph Service Client is created, just call:

await graphClient.Admin.ConfigurationManagement.ConfigurationSnapshot.PostAsync(body)

SDK Version

6.2.0

Latest version known to work for scenario above?

No response

Known Workarounds

Currently, issuing regular HTTP calls without using SDK works. The documentation also omits the part on C# (dotnet) SDK, it just has the HTTP and Javascript sections:
https://learn.microsoft.com/en-us/graph/api/configurationbaseline-createsnapshot?view=graph-rest-1.0&tabs=http

Debug output
Click to expand log ```

Graph API error (HTTP 404)
Code: UnknownError
Message:

</details>


### Configuration

- OS: Ubuntu 24.04 (WSL)
- x64

### 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 at graphClient.Admin.ConfigurationManagement.ConfigurationSnapshot.PostAsync and compare it with the documented ConfigurationBaseline createsnapshot endpoint and the proposed ConfigurationSnapshots.CreateSnapshot.PostAsync entry point. Reproduce the 404 with SDK 6.2.0, then verify that the builder exposes the correct operation and request type and returns the scheduled snapshot job.

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
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.