Hi @Bhargav Pasarla Thanks for reaching out.
when you deploy APIM in multiple availability zones, Azure automatically replicates your APIM instance across the availability zones and assigns the same public IP address to each instance (So when you say Consider those as AZ1 (eg server ip - 10.198.20.100) and AZ2(Eg server ip - 10.177.21.23) both AZ1 and AZ2 will have same ip address not different). Azure uses a load balancer to distribute incoming traffic across the instances of APIM that are deployed in the availability zones.
The load balancer monitors the health of each instance of APIM and automatically routes traffic to healthy instances. If one of the instances of APIM becomes unavailable, the load balancer automatically routes traffic to the remaining instances.
Is it possible to check which specific availability zone has served the request for APIM by checking anywhere like Application insights or LogAnalytics workspace or any other place if any?
In Azure Log Analytics, you can distinguish which specific APIM instance handled the request by using the cloud_RoleName
field. This field is automatically populated with the name of the APIM instance that handled the request.
But, When APIM is deployed across multiple availability zones, all instances of the APIM service share the same cloud_RoleName
because they are part of the same service. This means that the cloud_RoleName
field in Log Analytics will not differentiate between different instances of the APIM service in different availability zones.
Unfortunately, Azure does not provide a built-in way to determine which specific instance of an APIM service (in a specific availability zone) served a request. The load balancer that distributes incoming traffic across the instances is abstracted away and not exposed to users.
Hope this helps! Please let me know if you have any questions.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.