i am trying to automate the publishing of image service so that a user can directly publish a service by using a python script and having their raster file as input using the first URL linked below. I am working on Jupyter Notebook on Arcgis portal and i am having issue on creating a Connection file which is required for create the SDdraft. it throws up a runtime error. Can i use the following code with Python 3 jupyter instance and how can i automate the process without involving the Desktop solutions of ESRI? How can i fix the runtime error?
acrcgissripting._createGISServerConnectionFile("PUBLISH_GIS_SERVICES", "/arcigs/home", "test.ags", "https://somearcgisserver", "ARCGIS_SERVER", True, "/arcgis/home", "username", "password","SAVE_USERNAME")
exp_layer = '/arcgis/home/scratch.gdb/temperature'
sddraft= "/arcgis/home/test.sddraft"
Name="test"
arcpy.CreateImageSDDraft(exp_layer, sddraft, Name,"test.ags" 'ARCGIS_SERVER', None, False, None, "Ortho Images","ortho images,image service")
here are some of the links related to above code:
Complete Code for automization
https://enterprise.arcgis.com/en/server/latest/develop/linux/example-publish-an-image-service-from-a-folder-of-images.htm
CreateImageSDDraft
https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/createimagesddraft.htm
Create GIS Server Connection file
https://community.esri.com/t5/arcgis-pro-questions/how-to-create-an-arcgis-server-connection-file-with-the-python-3/m-p/1032848