Hi @Tân. Trần Nhật ,
Suggest you using listener IP address in connection string to connect to SQL server AG when your application and SQL server AG are in different subnet. Can they ping each other successfully? Please test port connectivity using TELNET to the server and port from the client machine. What the error message that you got when the connection failed?
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".