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

[Sample Issue] Workspace Purge #2768

Open
2 of 9 tasks
dansaltmer opened this issue May 11, 2023 · 0 comments
Open
2 of 9 tasks

[Sample Issue] Workspace Purge #2768

dansaltmer opened this issue May 11, 2023 · 0 comments
Assignees
Labels
customer-reported needs-triage question Further information is requested

Comments

@dansaltmer
Copy link

Link to sample

https://learn.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge?tabs=dotnet

Library name and version

Azure.ResourceManager.OperationalInsights 1.1.0

Language of the Sample

  • C#/.NET
  • Java
  • JavaScript/TypedScript
  • Python
  • Golang
  • Other - Please specify in Issue details field

Sample Issue Type

  • Sample not working
  • Sample missing
  • Do not understand sample

Issue details

The samples are assigning filter values using BinaryData.FromString, this usage is incorrect and causes serialisation errors. The code summary for the Value field on OperationalInsightsWorkspacePurgeFilter explains the usage correctly and BinaryData.FromObjectAsJson should be used in these examples.

Expected behavior

Expected behaviour is that the code sample would work when replacing values and updating the filter.

Actual behavior

Actual behaviour is that the code sample errors with a serialisation error due to incorrect usage.

Reproduction Steps

Use the code snippet as is, with the example filter of

new()
{
    Column = "_ResourceId",
    Operator = "==",
    Value = BinaryData.FromString("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/SomeResourceGroup/providers/microsoft.insights/components/AppInsightResource"),
}

This will result in the serialisation error '/' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.

Environment

Windows 11
Visual Studio 2022
dotnet 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported needs-triage question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants