How to automate publishing of image service to portal using a raster?

06-28-2021 06:44 AM
Occasional Contributor

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"
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


Create GIS Server Connection file

1 Reply
MVP Regular Contributor

@RehanChaudhary I am trying to do the same thing, but my tile cache is in an Azure S3 storage account.

Amanda Bishop, GISP
0 Kudos