We have a geodatabase (10.4.1) that is stored in an AlwaysOn cluster in SQL Server 2016. Since most of our traffic on the database is from the web and is readonly, I have configured the database to use readonly routing so that readonly connections go to the secondary replica. I have specified in my SDE connections the listener name and the ApplicationIntent=Readonly. In Arcmap, the connection is correctly sent to the secondary node, but when I publish the map to Server, it always sends it to the primary node. I have checked the data stores, and they are set correctly to use ApplicationIntent=Readonly.
Why is ArcGIS Server not honoring the application intent while ArcMap is? How do I fix this?