Select to view content in your preferred language

Thumbnail png file created when running the Stage Service (Server) tool

231
1
12-12-2023 12:35 PM
SydneyS
New Contributor

We have a python script that creates several SSDraft files, creates SD files from those drafts, then uploads them to ArcGIS Online as hosted feature layers.

When you run the Stage Service (Server) tool to create SD files, a thumbnail called 'Thumbnail.png' is created alongside it.

If you have a folder with many SSDraft files in it, a thumbnail will be created for the first SDDraft file processed, then any subsequent run will use the existing Thumbnail. The result was that all of our hosted feature layers on ArcGIS Online had the exact same thumbnail (which only applied to one layer), and this cascaded into the gallery cards in our Hub Site, which use the thumbnails.

We were able to insert a bit of code that replaces the thumbnail PNG file each run with the correct one. But I'm wondering if anyone knows why the Stage Service (Server) tool does this? I can’t find any ESRI documentation that explains this. Has anyone else experienced this issue?

0 Kudos
1 Reply
BillMyers
New Contributor III

Yes, I'm doing the exact same thing and I'm experiencing the single thumbnail issue.  This appears to be a bug.  Thanks for the tip(work around) of removing Thumbnail.png after running StageService.  Here's my code:

#Service setup
service_name = "ODL_" + lyr.name
sddraft = run_path + "\\output\\" + service_name + ".sddraft"
sd = run_path + "\\output\\" + service_name + ".sd"
tn = run_path + "\\output\\Thumbnail.png"

#Publish
arcpy.mp.CreateWebLayerSDDraft(lyr, sddraft, service_name, "MY_HOSTED_SERVICES", "FEATURE_ACCESS","OpenDataTest", True, True)
arcpy.StageService_server(sddraft, sd)
arcpy.UploadServiceDefinition_server(sd, "My Hosted Services", "", "", "", "", "", "OVERRIDE_DEFINITION", "SHARE_ONLINE", "PUBLIC", "SHARE_ORGANIZATION", "Open Data Test")
os.remove(tn) #work around: remove thumbnail so it's get re-generated

William H Myers
0 Kudos