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

[QUERY] How to add or remove IP address target from Application Gateway backend pool using the SDK #47631

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

Comments

@rabindra-harlalka
Copy link

rabindra-harlalka commented Dec 20, 2024

Library name and version

Azure.ResourceManager.Network 1.9.0

Query/Question

How to add or remove IP address target from Application Gateway backend pool using the SDK? Using Az CLI, it's possible to do the same like so: az network application-gateway address-pool update --gateway-name <GWNAME> -g <RESOURCE_GROUP> --name <BACKENDPOOLNAME> --add backendAddresses ipAddress=<IP_ADDRESS>. However, it's not clear how to do the same with the SDK.
I have created a service principal with Network Contributor role assigned to the Application Gateway resource in question. Next I create a ClientCertificateCredential object and do the following:

var armClient = new ArmClient(credential, subscriptionId);

var appGatewayResource = await armClient.GetApplicationGatewayResource(
       new ResourceIdentifier($"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}")
        ).GetAsync();

// Get the Backend Pool
var backendPool = appGatewayResource.Value.Data.BackendAddressPools.FirstOrDefault(pool => pool.Name == backendPoolName);

backendPool.BackendAddresses.Add(new ApplicationGatewayBackendAddress { IPAddress = vmIpAddress });

What should be the next step?

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

jsquire commented Dec 20, 2024

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

@ArthurMa1978
Copy link
Member

Thanks for your feedback @rabindra-harlalka , @HarveyLink please look into this question.

@mcgallan mcgallan assigned mcgallan and unassigned HarveyLink Dec 25, 2024
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

5 participants