Hey Everyone,
I have a routing service published to my 11.3 Enterprise portal (via map image layer w/ Network Analysis capability checked) and I am attempting to utilize the REST endpoint in an arcpy script that I will eventually publish as a web tool. I know I could use a local ND in a script and publish the GP tool which would include the ND, but the client wants the routing service separate so they can update it at will w/o updating the published tool. Anyway, this service has a single analysis layer for calculating service areas and I am using the arcpy.nax module to call the service endpoint and instantiate a ServiceArea() class.
service_url = r'https://<my_domain>'
svc_area_solver = arcpy.nax.ServiceArea(service_url)
When line 3 runs, I get:
ValueError: Cannot use 'https://<my_domiain>' for network analysis.
I am using the following example from this documentation on consuming the routing service in arcpy:
import arcpy
# Instantiate a ServiceArea analysis object.
service_area = arcpy.nax.ServiceArea("https://myportal.mysite.com/portal/")
I am assuming, since the URL here is only to the portal, that the URL to the service area layer of the published routing service needs to be applied to the Directions and Routing section of the portal org settings (Organization > Utility Services > Directions and Routing > Paste service area layer URL in the Service Area box of the Network Analysis Services section; see below image). I have done this and I receive the aforementioned ValueError exception.

We are using ArcGIS Server Advanced, so I know network analysis comes with it by default. I am also signed into Portal with the main site administrator credentials, so it shouldn't be due to a lack of privileges. Wondering if anyone has any insight into what I may be doing wrong or missing. Thanks!
- Jack C