I have an ArcPy script that calls ConvertWebMapToMapDocument—Help | Documentation and passes it an AGS file. In the old days, the AGS file was linked to a specific instance of AGS (e.g. URL of "https://TerriblePun.datacenter.local:6443/arcgis" + username/password of an AGS user account).
Now, my company is going to Portal 10.7.1 and becoming a little more highly available so I want to use a URL that looks more like "https://BoringPublicSubdomain.example.net/fw_arcgisportal" + username/password of a Portal account. That way, I don't have to maintain a different AGS file for each server that is running Server.
What is the best way to allow access to secured map services from that function? I tried 3 ways to generate an AGS file and failed all 3 times.
First, I tried to force ArcCatalog 10.7.1 to generate an AGS file with the above parameters. That failed.
---------------------------
Add ArcGIS Server
---------------------------
We were unable to connect to: https://arcgis.firstwatch.net/fw_arcgisportal.
Error: Proxy server got bad address from remote server (verify the server is running). (status code 504).
---------------------------
OK
---------------------------
Next, I tried using the local host file.
1. Add "127.0.0.1 FW_Local_AGS" on the server that will ultimately run the geoprocessing service.
2. Add "127.0.0.1 FW_Local_AGS" to my laptop's host file and fill in the IP address of the AGS server (not 127.0.0.1).
3. In ArcCatalog, use a URL of "https://FW_Local_AGS:6443/arcgis" + username/password of a Portal account
That didn't work either.
---------------------------
Add ArcGIS Server
---------------------------
We were unable to connect to: https://FW_Local_AGS:6443/arcgis.
Error: Bad syntax in request. (status code 400).
---------------------------
OK
---------------------------
Finally, I repeated the host file idea with the Primary Site Administrator's account (I know this is a big security no-no but I also know that some things in AGS don't work right with federated Portal accounts). I got the same error:
---------------------------
Add ArcGIS Server
---------------------------
We were unable to connect to: https://FW_Local_AGS:6443/arcgis.
Error: Bad syntax in request. (status code 400).
---------------------------
OK
---------------------------