Hello @Mituś Wojciech ,
Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.
I understand that you would like to know if it is possible to use Azure SDK for Python to list routes in BGP sessions established in Azure Virtual Network Gateway.
It should be possible to use Azure SDK for Python to list routes in BGP sessions established in Azure Virtual Network Gateway.
First, you'll need to authenticate and create a "NetworkManagementClient" object, which you can use to interact with Azure networking resources.
Then to list the BGP routes learned by a virtual network gateway, you'll need to use the "begin_get_learned_routes" method of the "VirtualNetworkGatewayConnectionsOperations" class.
"begin_get_learned_routes" operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers.
You'll need to provide the resource group name and the name of the virtual network gateway to list its learned routes.
Kindly let us know if the above helps or you need further assistance on this issue.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.