I am running into an issue when trying to publish our Geoprocessing tool as a Web Tool to our portal.
I created the simplest script, to recreate the issue:
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>gis <SPAN class="keyword token">import</SPAN> GIS
<SPAN class="keyword token">import</SPAN> arcpy
gis <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN>url<SPAN class="operator token">=</SPAN><SPAN class="string token">"https://gis.example.com/portal"</SPAN><SPAN class="punctuation token">,</SPAN> username<SPAN class="operator token">=</SPAN><SPAN class="string token">'geop'</SPAN><SPAN class="punctuation token">,</SPAN> password<SPAN class="operator token">=</SPAN><SPAN class="string token">'****'</SPAN><SPAN class="punctuation token">)</SPAN>
fv <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">if</SPAN> fv<SPAN class="operator token">==</SPAN><SPAN class="string token">""</SPAN><SPAN class="punctuation token">:</SPAN>
fv <SPAN class="operator token">=</SPAN> <SPAN class="string token">'DEFAULT'</SPAN>
fv <SPAN class="operator token">=</SPAN> str<SPAN class="punctuation token">(</SPAN>fv<SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>AddMessage<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Parameter is: {}, type: {}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>fv<SPAN class="punctuation token">,</SPAN> type<SPAN class="punctuation token">(</SPAN>fv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>AddMessage<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Finished!"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>It runs fine in ArcGIS Pro 2.5. When I try to share it as a Web Tool Error 00068 and Warning 24032 pop up, referencing a broken project data source.
Script TestScript contains broken project data source:
MESSAGEFORMAT=esriAGSInternetMessageFormatBin;SERVERTYPE=esriAGSServerTypeDiscovery;CONNECTIONMODE=esriAGSConnectionModePublisher;SERVERURL=https://gis.example.com/arcgis;USERPORTALANDFEDSERVERTOKEN=-1;PORTALURL=https://gis.example.com/portal
I suppose that including ArcGIS API for Python like this in Web Tool is not desired/supported. What is the correct way to include it?