question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Azure.ResourceManager.RecoveryServicesBackup

See original GitHub issue

Library name and version

Azure.ResourceManager.RecoveryServicesBackup

Describe the bug

Hi

I have an azure SQL VM.

I have an azure recovery vault. Takes backup every day of the SQL DB’s. Takes backup once a week of the VM.

All is working, and from inside Jobs in the vault it shows all success.

But now i want to use the SDK (Nuget: Azure.ResourceManager.RecoveryServicesBackup)

For an daily report, that i need.

All works perfectly, except when there are a VM backup i the timespan:

From my code (Working perfectly, filter include SQL backup ie ‘AzureWorkload’):

//Actually “startTime eq …” does a “startTime gt…”

String filter = “startTime eq ‘2023-03-29 00:00:00 AM’ and backupManagementType eq ‘AzureWorkload’”;

Pageable<BackupJobResource> backupJobResources = resourceGroup.GetBackupJobs(“/MyRecoveryServicesvault”).GetAll(filter);

From my code (NOT Working throws exception, at the time a VM backup is hit, in a following foreach):

//Actually “startTime eq …” does a “startTime gt…” String filter = “startTime eq ‘2023-03-29 00:00:00 AM’”

System.InvalidOperationException HResult=0x80131509 Message=The requested operation requires an element of type ‘String’, but the target element has type ‘Number’. Source=System.Text.Json StackTrace: at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType) at Azure.ResourceManager.RecoveryServicesBackup.Models.IaasVmBackupJob.DeserializeIaasVmBackupJob(JsonElement element) at Azure.ResourceManager.RecoveryServicesBackup.Models.BackupGenericJob.DeserializeBackupGenericJob(JsonElement element) at Azure.ResourceManager.RecoveryServicesBackup.BackupJobData.DeserializeBackupJobData(JsonElement element) at Azure.ResourceManager.RecoveryServicesBackup.BackupJobCollection.<>c__DisplayClass11_0.<GetAll>b__2(JsonElement e) at Azure.Core.PageableHelpers.PageableImplementation1.<GetEnumerator>d__17.MoveNext() at BackupNotify.Function1.Run(TimerInfo myTimer, ILogger log) in D:\Visual Studio 2022\Projects\BackupNotify\Function1.cs:line 153 at Microsoft.Azure.WebJobs.Host.Executors.VoidMethodInvoker2.InvokeAsync(TReflected instance, Object[] arguments) at Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker`2.<InvokeAsync>d__10.MoveNext()

Expected behavior

That i do not get an exception if the the timespan includes a VM backup.

Actual behavior

Hi

I have an azure SQL VM.

I have an azure recovery vault. Takes backup every day of the SQL DB’s. Takes backup once a week of the VM.

All is working, and from inside Jobs in the vault it shows all success.

But now i want to use the SDK (Nuget: Azure.ResourceManager.RecoveryServicesBackup)

For an daily report, that i need.

All works perfectly, except when there are a VM backup i the timespan:

From my code (Working perfectly, filter include SQL backup ie ‘AzureWorkload’):

//Actually “startTime eq …” does a “startTime gt…”

String filter = “startTime eq ‘2023-03-29 00:00:00 AM’ and backupManagementType eq ‘AzureWorkload’”;

Pageable<BackupJobResource> backupJobResources = resourceGroup.GetBackupJobs(“/MyRecoveryServicesvault”).GetAll(filter);

From my code (NOT Working throws exception, at the time the VM backup is hit, in a following foreach):

//Actually “startTime eq …” does a “startTime gt…” String filter = “startTime eq ‘2023-03-29 00:00:00 AM’”

System.InvalidOperationException HResult=0x80131509 Message=The requested operation requires an element of type ‘String’, but the target element has type ‘Number’. Source=System.Text.Json StackTrace: at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType) at Azure.ResourceManager.RecoveryServicesBackup.Models.IaasVmBackupJob.DeserializeIaasVmBackupJob(JsonElement element) at Azure.ResourceManager.RecoveryServicesBackup.Models.BackupGenericJob.DeserializeBackupGenericJob(JsonElement element) at Azure.ResourceManager.RecoveryServicesBackup.BackupJobData.DeserializeBackupJobData(JsonElement element) at Azure.ResourceManager.RecoveryServicesBackup.BackupJobCollection.<>c__DisplayClass11_0.<GetAll>b__2(JsonElement e) at Azure.Core.PageableHelpers.PageableImplementation1.<GetEnumerator>d__17.MoveNext() at BackupNotify.Function1.Run(TimerInfo myTimer, ILogger log) in D:\Visual Studio 2022\Projects\BackupNotify\Function1.cs:line 153 at Microsoft.Azure.WebJobs.Host.Executors.VoidMethodInvoker2.InvokeAsync(TReflected instance, Object[] arguments) at Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker`2.<InvokeAsync>d__10.MoveNext()

Reproduction Steps

Hi

I have an azure SQL VM.

I have an azure recovery vault. Takes backup every day of the SQL DB’s. Takes backup once a week of the VM.

All is working, and from inside Jobs in the vault it shows all success.

But now i want to use the SDK (Nuget: Azure.ResourceManager.RecoveryServicesBackup)

For an daily report, that i need.

All works perfectly, except when there are a VM backup i the timespan:

From my code (Working perfectly, filter include SQL backup ie ‘AzureWorkload’):

//Actually “startTime eq …” does a “startTime gt…”

String filter = “startTime eq ‘2023-03-29 00:00:00 AM’ and backupManagementType eq ‘AzureWorkload’”;

Pageable<BackupJobResource> backupJobResources = resourceGroup.GetBackupJobs(“/MyRecoveryServicesvault”).GetAll(filter);

From my code (NOT Working throws exception, at the time the VM backup is hit, in a following foreach):

//Actually “startTime eq …” does a “startTime gt…” String filter = “startTime eq ‘2023-03-29 00:00:00 AM’”

System.InvalidOperationException HResult=0x80131509 Message=The requested operation requires an element of type ‘String’, but the target element has type ‘Number’. Source=System.Text.Json StackTrace: at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType) at Azure.ResourceManager.RecoveryServicesBackup.Models.IaasVmBackupJob.DeserializeIaasVmBackupJob(JsonElement element) at Azure.ResourceManager.RecoveryServicesBackup.Models.BackupGenericJob.DeserializeBackupGenericJob(JsonElement element) at Azure.ResourceManager.RecoveryServicesBackup.BackupJobData.DeserializeBackupJobData(JsonElement element) at Azure.ResourceManager.RecoveryServicesBackup.BackupJobCollection.<>c__DisplayClass11_0.<GetAll>b__2(JsonElement e) at Azure.Core.PageableHelpers.PageableImplementation1.<GetEnumerator>d__17.MoveNext() at BackupNotify.Function1.Run(TimerInfo myTimer, ILogger log) in D:\Visual Studio 2022\Projects\BackupNotify\Function1.cs:line 153 at Microsoft.Azure.WebJobs.Host.Executors.VoidMethodInvoker2.InvokeAsync(TReflected instance, Object[] arguments) at Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker`2.<InvokeAsync>d__10.MoveNext()

Environment

Visual studio 2022 latest update, and latest update of nuget packets.

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
PRC2019commented, Jun 9, 2023

Hi ChengMing

I can confirm that the issue is resolved in 1.1.0-beta.1 !

Thank you for your help.

[AddProDKLogo] Med venlig hilsen / Best regards​​ Peter Christoffersen

Office: +45 40420187 | addpro.dkhttps://addpro.dk

Porschevej 3 , DK-7100 Vejle

From: Chengming @.> Sent: 7. juni 2023 05:07 To: Azure/azure-sdk-for-net @.> Cc: Peter Christoffersen @.>; Mention @.> Subject: Re: [Azure/azure-sdk-for-net] [BUG] Azure.ResourceManager.RecoveryServicesBackup (Issue #35585)

Hi @PRC2019https://github.com/PRC2019 I reproduce this issue in Azure.ResourceManager.RecoveryServicesBackup stable 1.0.0 and it will be resolved in the latest version 1.1.0-beta.1https://www.nuget.org/packages/Azure.ResourceManager.RecoveryServicesBackup/1.1.0-beta.1, could you try to bump SDK version to the latest version? If still encounter this issue feel free to contact us.

— Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-sdk-for-net/issues/35585#issuecomment-1579802165, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMYTV63SPYEO3JR3WE4WLILXJ7V5RANCNFSM6AAAAAAW6QLGPA. You are receiving this because you were mentioned.Message ID: @.@.>>

0reactions
github-actions[bot]commented, Jun 7, 2023

Hi @PRC2019. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure.ResourceManager.RecoveryServicesBackup. ...
Explore all classes and interfaces of the Azure.ResourceManager.RecoveryServicesBackup.Models namespace.
Read more >
Azure.ResourceManager.RecoveryServicesBackup 1.0.0
This library supports managing Microsoft Azure Recovery Services Backup resources. This library follows the new Azure SDK guidelines, and provides many core ...
Read more >
OperationStatus.Error Property (Azure.ResourceManager. ...
Error information related to this operation. C# Copy. public Azure.ResourceManager.RecoveryServicesBackup.Models.OperationStatusError Error { get; }
Read more >
com.azure.resourcemanager.recoveryservicesbackup.models ... - NET
Package com.azure.resourcemanager.recoveryservicesbackup.models. Package containing the data models for RecoveryServicesBackupClient.
Read more >
OperationStatusError (Azure SDK for Java Reference ...
Set the code property: Error code of the operation failure. Parameters: code - the code value to set. Returns: the OperationStatusError object itself....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found