We are trying to automatically publish datasets into our image server.
We have an environment with a Portal enterprise server, an image server, a raster server and a machine running ArcGIS Pro. I have tried this running on both the image server and the ArcGIS Pro machine.
We are following this documentation example, slightly modified so it only takes a single file rather than all the files in a directory, and gets the parameters from other places.
It runs through with out any problems to the
arcpy.UploadServiceDefinition_server call. At which point it fails with the dreaded
If I try and upload the service definition 'manually' from ArcGIS Pro it works OK. I am using the same .ags file in both cases.
My best guess is that my script is not logged into the portal correctly. I've attempted to use
arcpy.SignInToPortal but it seems to have made no difference to the error I am getting.
Does this process only work if run inside of ArcGIS Pro and not the Esri Python environment?
Is there a step that I'm missing when running outside of ArcGIS Pro?