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

830
1
06-28-2021 06:44 AM
RehanChaudhary
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"
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...

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-wi...

1 Reply
ABishop
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