I have a map in ArcGIS pro that I can upload to ArcGIS online using the "Share as Web Map" dialog, which gives me various options for how I want the data copied (in my case it creates an ArcGIS Online web map and a feature layer). I'd like to automate that in Python but having some trouble figuring out how to do it.
BTW - I first raised this a a question so there is more discussion there
All the tools you require for you to script in python or model builder are in the Package toolbox.
Thanks Duncan, but I'm still not seeing how to use the Package toolset to code the equivalent of "Share as Web Map".. I ran "Package Map" followed by "Share Package" but I ended up with the .mpkx file being upload to ArcGIS Online as a Map Package item. What I want to is end up with a Web Map item in ArcGIS Online (and a related Feature Layer if needed).
BTW - I did figure out how to accomplish thi using a combination of arcpy, REST APIs, and the Python for ArcGIS API, but it was quite a bit of relatively complicated code.
hi there,
we have the same requirements, since we are building Azure DevOps pipelines that publish entire test and demo environment. While we are able to automate the publishing of services and other artifacts, the last piece missing is the publishing of a WebMap based on an ArcGIS Pro map.
Thank you for the comment @cspoerri Please be sure to add your kudo to this idea 😉
I have the same problem. It appears this isn't supported in ArcPy. I have tried using sddraft and the files are uploaded as a map package and not as a web layer.
On investigation, it would appear ArcGIS Pro (v2.9.2) is utilising .msd files under the hood when the Share as "Web Map" is invoked. .sd files are not supported in ArcPy and were deprecated in favor of "sddrafts".
To verify, under options, navigate to "Share and Download". Open the staging folder and you will see folders for each transaction that include .msd files.
@DonMorrison1 Are you able to share the solution you arrived at here?
@DonMorrison1 Hi Don, were you able to figure out this? If so, can you please share your python pseudocode? I am trying to automate publishing Map Image Layer from ArcGIS Pro to ArcGIS Enterprise.
Here is a rough outline of the steps I went through. The input is a mpxk file and I end up with a hosted feature layer . I'm not sure this is really what you want to do since you are working with image layers and my goal was to get the features published, but in any case here it is
Thanks for sharing. I'm following a similar workflow to publish a hosted feature layer, but I'm still unable to automate the updating of the associated web map. In my current workflow, if I add new layers to the map in Pro, I have to manually add them to the Web Map JSON, which is cumbersome and error-prone.
Have you found a way to automate the updating of the Web Map JSON specification? This is something I'd like to accomplish, and I'd prefer not to write a custom toolbox to parse and update the Web Map JSON from my previous version.
Let me know if you have any leads. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.