[BUG] Azure.ResourceManager.RecoveryServicesBackup
See original GitHub issueLibrary 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.VoidMethodInvoker
2.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.VoidMethodInvoker
2.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.VoidMethodInvoker
2.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:
- Created 5 months ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
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: @.@.>>
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.