I am using this test script as the source for a Python Script Tool that works in ArcGIS Pro 3.0.2 and that I wish to share as a Web Tool to ArcGIS Enterprise 11.
import arcpy
arcpy.env.overwriteOutput = True
csvFile = arcpy.GetParameterAsText(0)
test_data_name = arcpy.GetParameterAsText(1)
gdb = r"C:\Users\my_username\AppData\Roaming\Esri\ArcGISPro\Favorites\my_sde.sde"
csv_table_name = "{0}_CSV".format(test_data_name)
csv_table = r"{0}\{1}".format(gdb,csv_table_name)
srGDA2020 = arcpy.SpatialReference("GDA2020")
pointFC = r"{0}\{1}_Points".format(gdb,test_data_name)
arcpy.conversion.TableToTable(csvFile,gdb,csv_table_name)
arcpy.management.XYTableToPoint(csv_table,pointFC,"Longitude","Latitude",None,srGDA2020)
The two parameters on my tool named Test Tool are configured like this:
If I comment out the last line of my Python script (the one that uses XYTableToPoint) then the tool can be run in ArcGIS Pro, shared as a web tool and run successfully on the portal to upload a CSV file and create a copy of it as an Enterprise Geodatabase table.
However, if I leave the XYTableToPoint line uncommented, then trying to Analyze for sharing is blocked by an error:
00068 Script Test Tool contains broken project data source {0}{1}:
The error is described at 00068: Result contains broken project data source: .
Why is the web tool, and the Analyze that shares it, able to successfully write a table to the workspace, and then not be able to create a feature class from it in the same workspace?