AnsweredAssumed Answered

How to pass username/pass to a Hosted Feature Layer in Python

Question asked by dougbrowning on Sep 17, 2015
Latest reply on Sep 28, 2015 by RTreecare

I have a simple script to grab the data from a HFS.  It works great if the HFS sharing is Everyone but I can not get it to work with a username/password.

 

I know that arcpy.SignInToPortal_server was removed (even though it worked great).  I have also tried using he script in a toolbox then run inside of ArcMap but that does not work either.  I do have ArcMap open and signed in.

 

I use a layer file that points to the HFS.

 

Any help on the proper way to do this is great.  I am using 10.2.2 but could use 10.3.1 also.

 

import arcpy

localDB = r"something.gdb"

justPlots = r"JustPlots.lyr"

 

# Load in from AGO HFS

arcpy.MakeFeatureLayer_management(justPlots, "plots_lyr")

arcpy.Append_management("plots_lyr", localDB + "\\Plots", "NO_TEST")

 

 

Thanks

Outcomes