I'm currently looking for "the correct way" on how to publish services to portal or to a portal federated servers (like an imageserver).
For example I have a mosaic dataset and I would like to create a service with it on my imageserver, which is federated with my portal. In ArcGIS Pro there I select my mosaic dataset and then I click "Share as weblayer". The connection is then read from the active portal (manage portals in ArcGIS Pro). I can then select my image server to host the service.
What is the "correct" way to automate this process with python (arcpy or python api for arcgis)? What I have so far:
The whole process is mix between arcpy and python api for arcgis and I don't know if this is the way to go? And not all necessary function are available (CreateServer Connection File) in python 3.x .
When to use arcpy and when to use the new python api for arcgis?
Any ideas or tipps? Searching the examples didn't really help.
My Environment: ArcGIS Enterprise 10.8.1 single stack full, Windows server 2012R2.
It's difficult to define "correct". Many options. Can you lay out your environment to help define solutions that might work for you.
But 1st, based on your single scenario, why automate service publishing? Once you've published an image service type, if you add or subtract content from the source Mosaic Data Set (MDS) and rebuild statistics and overviews without any other changes, then the service doesn't need to be republished. At most, if you don't want to wait for recycle time, you may have to stop and restart the service. The scenario changes, of course if you chose to publish a Map service type and you selected the option to copy data to the Data Store.
ArcGIS Enterprise 10.8.1, Windows Server 2016
The scenario is easy:
We have 4 environments running the architecture described above and we have a lot of drone flights to process (raster files) and therefore we need an automated process to process those files and automatically publish them as service. Doing it manually is no option and error-prone.