Cannot sign into portal via ArcPy

182
0
03-25-2021 06:25 AM
ColtonLuttrell
New Contributor

I am trying to export my utility network package via arcpy.pt.UtilityNetworkToAssetPackage(), however my initial error was:

arcgisscripting.ExecuteError: ERROR 002119: Must be connected and signed into the portal.
Failed to execute (UtilityNetworkToAssetPackage).

So I added a line before the utility network call to sign into my portal, and this error is now thrown:

ValueError: Error signing on to <myportal>.

Message : s
Details : Unable to generate token.

Anyone have any potential solutions for this kind of error?

Sample code is below:

import arcpy

arcpy.SignInToPortal(<portalurl>, <username>, <password>)

arcpy.pt.UtilityNetworkToAssetPackage(un, '*', dest_path, file_name, 'INCLUDE_DATA')

 

0 Kudos
0 Replies