Preet_pk Assuming this is being balance by virtual server you would configure the virtual server with a pool that only has the DC node/s in it and then another pool with the Azure node/s in it. The following is the iRule that you would use followed by the internal data-group that you would use that contains the source IPs for your Azure requests as the F5 would see them when connecting to the virtual server. I have IPs currently in the data group that are just examples to show you how to configure it with a single host IP as well as a subnet. Configuring it in this manner would maintain persistence if you have any configured or will have any configured while sending traffic to the appropriate destination. Please keep in mind that the match for anything other than abc.local and Azure IP sources will end up going to the default pool. If you always want Azure requests to go to Azure nodes no matter the website then you can remove the HTTP::host match and just leave the address match.
This is the iRule
when CLIENT_ACCEPTED priority 500 {
set DEFAULT_POOL [LB::server pool]
}
when HTTP_REQUEST priority 500 {
if { ([HTTP::host] == "abc.local") && ([class -- match [IP::client_addr] == CLASS_Azure_subnets]) } {
pool POOL-abc.local-AzureNodes
} else {
pool $DEFAULT_POOL
}
}
This is the internal data-group CLI output
ltm data-group internal CLASS_Azure_subnets {
records {
192.168.1.1/32 { }
192.168.2.0/24 { }
}
type ip
}
If this is not what you have configured please provide additional detail on your configuration and what you're attempting to achieve and we should be able to assist you further.