Hi,
I've tried using the following script to upload a map tile package and publish it to a hosted tile layer but it failed. The map tile package was successfully uploaded and the hosted tile layer was successfully created. However, it didn't copy the min and max scale to the service so the publishing tile process was failed.
That's the script I used.
from arcgis.gis import GIS
gis = GIS("https://www.arcgis.com", "username", "password")
cm = gis.content
print(gis._con._token)
itemProperties = {}
data = r"TileMapPackage\PlanningTeamArea_agspro.tpk"
item = cm.add(itemProperties, data=data, folder="test_automation")
if item != None:
print(item)
tiledServiceItem = item.publish()
if tiledServiceItem != None:
print("published")
that's the error message I got.
Traceback (most recent call last):
File "D:/Data/Requests/Requests 2017/26_0511_AGOL_Automation_Test/Codes/addingItems.py", line 11, in <module>
tiledServiceItem = item.publish()
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 4299, in publish
serviceitem_id = self._check_publish_status(ret, folder)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 4519, in _check_publish_status
raise Exception("No job id")
Exception: No job id
Any idea?