AnsweredAssumed Answered

Share python script with 'the GIS object' from Pro to Portal

Question asked by pnord on Feb 4, 2019
Latest reply on Feb 27, 2019 by pnord


Trying to create and share a simple python script as a GP service, I keep having a "staging failed" error when sharing from AGPro to Portal. And a suspicious warning "Data source used by Script XXXX is not registered with the server and will be copied to the server : My Hosted Services"

My script connects to the portal via the GIS object (from arcgis.gis import GIS) and look for a feature service (, then update one field in one object.

From what I understand, it is due to "the GIS object" in my script, for example I'm having the same issue with a very simple script that does nothing but connect to the portal and look for a web map :


from arcgis.gis import GIS
import arcpy
gis = GIS("my_portal_url" , "user", "pass")
search_result ="title:SIG Intempéries", item_type = "Web Map")


Both scripts run well in AGPro and Jupyter Notebook but when I try to share the result as a Web Tool : same warning and same staging failed error

Any idea ?