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?