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

Response is System.Null Reference while Update_RegisterAzureStorageProtectionContainers #37904

Closed
pksouza23 opened this issue Jul 28, 2023 · 17 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Recovery Services Backup
Milestone

Comments

@pksouza23
Copy link

Library name and version

Azure.ResourceManager.RecoveryServicesBackup 1.0.0

Describe the bug

I am registering storage container in the recovery service vault. But I am getting System Reference null error is throwing, storage container is successfully register. But problem is the response.

image

image

Expected behavior

Response should come properly without null reference issue.

Response should be included status 202 and location path.

HTTP/1.1 202 Accepted
'Pragma': 'no-cache'
'Expires': '-1'
'Location': ‘https://management.azure.com/Subscriptions/00000000-0000-0000-0000-000000000000/ResourceGroups
/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupFabrics/Azure/operationResults/
cca47745-12d2-42f9-b3a4-75335f18fdf6?api-version=2016-12-01’
'Retry-After': '60'
'X-Content-Type-Options': 'nosniff'
'x-ms-request-id': '6cc12ceb-90a2-430d-a1ec-9b6b6fdea92b'
'x-ms-client-request-id': ‘3da383a5-d66d-4b7c-982a-bc8d94798d61,3da383a5-d66d-4b7c-982a-bc8d94798d61’
'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
'X-Powered-By': 'ASP.NET'
'x-ms-ratelimit-remaining-subscription-reads': '11996'
'x-ms-correlation-request-id': '6cc12ceb-90a2-430d-a1ec-9b6b6fdea92b'
'x-ms-routing-request-id': CENTRALUSEUAP:20200203T091326Z:6cc12ceb-90a2-430d-a1ec-9b6b6fdea92b'
'Date': 'Mon, 03 Feb 2020 09:13:25 GMT'

Actual behavior

image

image

Reproduction Steps

https://learn.microsoft.com/en-us/rest/api/backup/protection-containers/register?tabs=dotnet

using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.RecoveryServicesBackup;
using Azure.ResourceManager.RecoveryServicesBackup.Models;
using Azure.ResourceManager.Resources;

// Generated from example definition: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureStorage/ProtectionContainers_Register.json
// this example is just showing the usage of "ProtectionContainers_Register" operation, for the dependent resources, they will have to be created separately.

// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);

// this example assumes you already have this BackupProtectionContainerResource created on azure
// for more information of creating BackupProtectionContainerResource, please refer to the document of BackupProtectionContainerResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "SwaggerTestRg";
string vaultName = "swaggertestvault";
string fabricName = "Azure";
string containerName = "StorageContainer;Storage;SwaggerTestRg;swaggertestsa";
ResourceIdentifier backupProtectionContainerResourceId = BackupProtectionContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, fabricName, containerName);
BackupProtectionContainerResource backupProtectionContainer = client.GetBackupProtectionContainerResource(backupProtectionContainerResourceId);

// invoke the operation
BackupProtectionContainerData data = new BackupProtectionContainerData(new AzureLocation("placeholder"))
{
Properties = new StorageContainer()
{
SourceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa"),
AcquireStorageAccountLock = AcquireStorageAccountLock.Acquire,
FriendlyName = "swaggertestsa",
BackupManagementType = BackupManagementType.AzureStorage,
},
};
ArmOperation lro = await backupProtectionContainer.UpdateAsync(WaitUntil.Completed, data); // has problem in response
BackupProtectionContainerResource result = lro.Value;

// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BackupProtectionContainerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");

Environment

Microsoft Visual Studio Enterprise 2022 (64-bit) - Current
Version 17.6.4

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 28, 2023
@jsquire jsquire added Recovery Services Backup Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jul 28, 2023
@jsquire
Copy link
Member

jsquire commented Jul 28, 2023

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@pksouza23
Copy link
Author

Sure, Thank you

@pksouza23
Copy link
Author

I have uploaded source code in the https://github.com/pksouza23/POCfilesharebackup

@pksouza23
Copy link
Author

Is there any update on this issue?

@HarveyLink
Copy link
Member

Hi @pksouza23 , we have repro you issue, working on a solution now.

@pksouza23
Copy link
Author

Hi @HarveyLink , Please let us know once it is fixed, we are waiting for the resolution. Thank you.

@pksouza23
Copy link
Author

Hi @HarveyLink , Any update on fix for the issue ?

Thanks in advance.

@pksouza23
Copy link
Author

HI @HarveyLink @jsquire ,

Any progress on this issue?

Thanks in advance.

@jsquire
Copy link
Member

jsquire commented Sep 15, 2023

@pksouza23: Unfortunately, I do not have insight. We'll need an update from @HarveyLink or @ArthurMa1978.

@HarveyLink
Copy link
Member

Hi @pksouza23 It's a service issue, we'll make a quick fix on the sdk to make it work first. Further fix would need service team's help.

@pksouza23
Copy link
Author

Hi @HarveyLink, Thanks for the response. Once quick fix applied on the SDK let us know.

@YariMVSage
Copy link

YariMVSage commented Nov 2, 2023

Also waiting for a resolution. Same issue with BackupProtectedItems PUT, @HarveyLink I don't know if you are aware of it. Any news on that would be grateful

@pksouza23
Copy link
Author

pksouza23 commented Nov 3, 2023

Hi @YariMVSage , @HarveyLink , If this is fixed, please let me know, if quick fix applied on the SDK. So that I can test the issue using updated SDK.

Thanks,

@HarveyLink
Copy link
Member

Also waiting for a resolution. Same issue with BackupProtectedItems PUT, @HarveyLink Minghao Chen (WICRESOFT NORTH AMERICA LTD) Vendor I don't know if you are aware of it. Any news on that would be grateful

Opened issue to track the fix, have a PR now. Will let you know once we fixed that.

@YariMVSage
Copy link

Hi @HarveyLink Thanks!!

@HarveyLink
Copy link
Member

Hi @HarveyLink Thanks!!

Issue fix was meged, will have a release for that. I will keep you posted.

@HarveyLink HarveyLink added this to the 2024-02 milestone Jan 12, 2024
@HarveyLink
Copy link
Member

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Recovery Services Backup
Projects
None yet
Development

No branches or pull requests

5 participants