Hello,
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 xyz 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 (gis.content.search), 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 = gis.content.search("title:SIG Intempéries", item_type = "Web Map")
print(search_result[0].type)
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 ?