Arcpy sign into portal using Python API

1138
1
03-21-2021 01:14 PM
Status: Closed
MarkCederholm
Occasional Contributor III

When a Python tool is published as a web tool, the user's credentials are available via the GIS object in the Python API.  However, those credentials cannot be used in arcpy.SignInToPortal in order to access Portal layers in a Pro project.  I would like to see either a new method on the GIS object to sign in arcpy, or else allow the GIS object as an argument in the arcpy function.

1 Comment
HannesZiegler
Status changed to: Closed

After careful consideration, we believe the best practice for the workflow you are trying to accomplish is to sign Pro into the Portal first, then use GIS("PRO") so as to not expose your credentials in plaintext in your code. Working backwards from a signed in GIS instance to signing in Pro is not recommended.