Enable LRS When Publishing a Service

153
2
a month ago
DavidHarris1
New Contributor II

Hello, 


I am trying to automate the publishing of maps as services from ArcGIS Pro.  There appear to be several tools available through arcpy to accomplish this by creating an sddraft, staging a service, and uploading a service definition. (https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/introduction-to-arcpy-sharing.htm

When manually publishing a service using the 'sharing map as web layer' pane there are several options that I do not see available using the arcpy methods mentioned above. 

DavidHarris1_0-1621015305871.png

I am looking for a way to publish services and add this capability using arcpy, or the python api if there are any functions or methods that might accomplish this there.  

Any help would be very much appreciated. 

Thanks, 

David

0 Kudos
2 Replies
NathanHeickLACSD
Occasional Contributor III

Try opening up the .sddraft file that you created.  It is an XML file and it might have a section regarding linear referencing that you can edit using Python.

Also, I think you can access the .sddraft that is created while you are publishing through ArcGIS Pro.  It is probably in your user folder and you might have to check for it at the right step in the publishing process.

I went through this whole process very slowly in ArcMap.  I used Fiddler to look at the network traffic for the REST API calls that are made to understand the process and I also saved out the .sddraft file from ArcMap during the publishing process.  Once I understood all the steps and changes that needed to be made to the .sddraft file, I was able to automate it all in Python.  This was about 4 years ago.

0 Kudos
DavidHarris1
New Contributor II

Thank you for the reply.  I was hopeful there would be a more idiomatic way to do this using the python api, but I will give this a go and try and parse it out.  

Best,

David

0 Kudos