-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
Thanks for your feedback @rabindra-harlalka , @HarveyLink please look into this question. |
@rabindra-harlalka Thank you for reaching out to us.
After that, call collection.CreateOrUpdateAsync(WaitUntil.Completed, appGwName, appGatewayData) to complete the creation or update of the resource:
The removal operation is implemented in the same way. You need to set the remaining IP addresses as parameters for the new BackendAddressPools after completing the removal operation, and then call CreateOrUpdate to complete the resource upgrade. If you are only updating data, you can directly call CreateOrUpdate() with the new data after your own steps to update it. Please let us know if you have any further questions or need additional assistance. |
Hi @rabindra-harlalka. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
@mcgallan, thanks for the response. The suggested code works to add or remove IP addresses. However, I noticed that for the above to work, I also need to assign Network Contributor role at the resource group level, besides at the App Gateway resource level which I had already given. Once that was done, I was able to add or remove. From a few measurements, the rough time it took to complete an operation is ~12 seconds. I wish there was a quicker or simpler way, but I do see that the same happens on Azure Portal as well behind the scenes - a new deployment takes place for IP address update. My question is answered. This query can be closed. |
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:
What should be the next step?
Environment
No response
The text was updated successfully, but these errors were encountered: