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

[BUG] Can't disassociate NATGateway from Subnet #47261

Open
lissdy opened this issue Nov 20, 2024 · 1 comment
Open

[BUG] Can't disassociate NATGateway from Subnet #47261

lissdy opened this issue Nov 20, 2024 · 1 comment
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 Network question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@lissdy
Copy link

lissdy commented Nov 20, 2024

Library name and version

Azure.ResourceManager.Network 1.9.0

Describe the bug

I need to disassociate NATGateway from Subnet with SDK, while set subnetData.NatGatewayId = null, hit below error

Content:
{"error":{"code":"InvalidRequestFormat","message":"Cannot parse the request.","details":[{"code":"MissingJsonReferenceId","message":"Value for reference id is missing. Path properties.natGateway."}]}}

            // get the SubnetResource
            ResourceIdentifier subnetResourceId = SubnetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, virtualNetworkName, subnetName);
            SubnetResource subnet = client.GetSubnetResource(subnetResourceId);
            SubnetResource result = await subnet.GetAsync();
            var subnetData = result.Data;
            subnetData.NatGatewayId = null;
            var subnetCollection = client.GetVirtualNetworkResource(VirtualNetworkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, virtualNetworkName)).GetSubnets();
            // hit bad request exception
            var operation = await subnetCollection.CreateOrUpdateAsync(WaitUntil.Started, subnetName, subnetData, default);

Expected behavior

The SDK supports NAT Gateway disassociation

Actual behavior

Hit exception while set NatGatewayId to null

Reproduction Steps

            SubnetResource subnet = client.GetSubnetResource(subnetResourceId);
            SubnetResource result = await subnet.GetAsync();
            var subnetData = result.Data;
            subnetData.NatGatewayId = null;
            await subnet.UpdateAsync(WaitUntil.Started, subnetData);

Environment

No response

@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 Nov 20, 2024
@jsquire jsquire added Network 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 Nov 20, 2024
@jsquire
Copy link
Member

jsquire commented Nov 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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 Network question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants