Hi @PhilipC , @MarkusBenninghoff ,
This might help you with publishing the GP tool into Portal:
portalURL = "https:??gis.example.com?portal"
portalURL = portalURL.replace('??', '//')
portalURL = portalURL.replace('?', '/')
gis = GIS(url = portalURL, username = 'geop', password = '****', verify_cert = False)
When trying to share a GP tool and analyzing it before publishing, the GP script is scanned to discover any project data. When this happens, every quoted string used in a Python variable or as an argument to a function is tested to see if it is a path to data that exists.
Therefore, in the user's script, the Portal URL string is interpreted as a file path, hence deemed to be an invalid data source. By creating a string variable as "https:??gis.example.com?portal" and replacing the "?" with "/", the URL will be interpreted as a file path.
I hope that helps.
Mehdi