Hello everyone,
I am developing a Python Geoprocessing tool that uses arcpy.na.ShareAsRouteLayers. The tool works perfectly when executed directly within ArcGIS Pro, but fails after being published as a Geoprocessing Service on ArcGIS Enterprise (11.4).
The Issue: Even though I am generating a token and calling arcpy.SignInToPortal(), the subsequent ShareAsRouteLayers call fails with: ERROR 030189: You must be signed in to "portal".
Interestingly, my logs show that SignInToPortal reports success, but a call to arcpy.GetSigninToken() immediately after returns None.
# Token is generated successfully via requests
arcpy.SignInToPortal(portal_url, user, pwd)
logger.info("SignInToPortal successfully")
# This returns None when running as a Service
logger.info(f"generated token is: {arcpy.GetSigninToken()}")
# This triggers ERROR 030189
arcpy.na.ShareAsRouteLayers(...)
Attached sample code for reference