After running arcpy.server.UploadServiceDefinition to create a map service in my ArcGIS Enterprise (10.9.1), the documentation indicates I should be able access the out_mapServiceItemID by looking at result.getOutput(2). However, the return value is blank.
result = arcpy.server.UploadServiceDefinition(service_definition, "https://arcgisenv/serverWebAdaptor", in_folder_type="EXISTING", in_folder="myfoldername")
result.getOutput(2) #this ends up being ''
I'm trying to get the Portal Item ID of the map service that is published using the above service definition. Documentation says it should be available in the derived output (https://pro.arcgis.com/en/pro-app/latest/tool-reference/server/upload-service-definition.htm). In fact every output is blank after the first 2.
Any ideas what could be happening?
Running into this same thing. Hoping to derive to newly created service ID. Did you make any progress on this?
No progress. I just do a very specific search using the Portal search API to get my item.
I'm seeing the same results ... none of the good result values are being populated according to the doc. Any chance you reported this as a bug?
All,
This is a documented BUG now and has been reproduced internally. Hopefully a hotfix is out soon.
BUG-000140843
It does seem like you might be able to use the Python API to get the output instead of getting it through arcpy:
rsp = arcpy.UploadServiceDefinition_server(<sd_output_filename>, "HOSTING_SERVER") gis_item = gis.content.get(rsp[2])
Thanks,
Ben Keller
Fred, I was able to find a possible workaround with the API instead of arcpy. If you want to give that a try.
Thanks Ben, I've probably worked out that solution as well... i have file level access to the config store so i'm able to open the item json and scrap the ids from there... not totally ideal but slightly faster than an api query and a bit easier to code.