Hello all,
I am trying to write a Jupyter Notebook process to update ArcGIS Service URLs in our organization's production WebMaps that are accessible to the public. I am using ArcGIS Pro 3.4.0 to write the process and have logged in to it using my organizational user name.
Obviously, I don't want the code to actually change the production WebMaps until I've tested it. So, the first thing I am trying to do is make copies of them in my organizational account. However, I can't seem to instantiate an arcgis.map.Map object with an existing WebMap.
I've stripped everything down to, what I believe are, the bare essentials and have provided an example of a real WebMap I need to do this with:
from arcgis.gis import GIS
from arcgis.map import Map
# gis = GIS("pro") ## tried this too
gis = GIS("home")
webmap_item = gis.content.get("ae48a370a66e473b877837711ac145bf")
webmap_item
webmap = Map(item = webmap_item)
The correct webmap_item is returned and it is Shared to Everyone but the webmap isn't instantiated because of a series of validation errors.
I'm basing my code on what I found at https://www.esri.com/arcgis-blog/products/api-python/announcements/whats-new-in-arcgis-api-for-pytho.... Specifically,
I'm guessing I'm missing something obvious; so any suggestions are welcome.
Cheers,
jtm
Solved! Go to Solution.
Hi Maureen
I don't know when the next release will be; but, I contacted ESRI Support about this problem and they suggested a workaround that seems to have addressed my immediate problem.
Using an older version of ArcGIS Pro (that is, v3.3.1; forgot to put the version I used in my initial reply), I have been able to use the old libraries to successfully instantiate the WebMaps that use 10.4 ArcGIS Server services, change and save the new layer URLs which now use our 11.2 ArcGIS Servers services.
As yet, I have not attempted to instantiate those updated WebMaps with the newer libraries to see if the Validation Errors have disappeared. When I do, I'll let everyone know.
Hoping this helps,
jtm
I have also tried opening the production WebMap in the viewer and saving it to a personal AGOL account where I am able to share it with Everyone (which I don't have permissions to do in our Organization account).
Using the login information for that personal account to instantiate the GIS object, I tried the same as above but inserted the new WebMap ID. I had hoped that by opening the WebMap in the viewer and saving it to a new WebMap, AGOL would fix whatever it is that is wrong with the configuration.
No such luck. Still getting the validation errors...
Could it be because the services the WebMap is using are served by a 10.4.1 ArcGIS Server? That would be ironic since it's because we are working on upgrading to ArcGIS Server 11.x that I'm trying to figure out how we're going to update these URLs to point to our new, upgraded servers.
Cheers,
jtm
Hi @myESRIUName take a look at the Copy Web Maps tool that's included with these tools. The script will give you the logic to copy the web map, and also how to update the URLs.
Thank you for your reply, @JakeSkinner.
I have invoked the Copy Web Map tool but, unfortunately, do not have Admin permissions on the Source AGOL site and, although those parameters are optional, I don't seem to be able to do anything without providing them. For me, a red X appears next to the Source AGOL/Portal URL showing errors and including the statement "You do not have permissions to access this resource or perform this operation."
The webmap ID I am providing is Shared with Everyone so I'm not sure why I wouldn't be able to read it and copy it into my own username's account within that organization.
It strikes me that this tool's code may be running into the same problem I am. I think I'll get ESRI Support to give it a try.
jtm
I have not contacted ESRI Support about this yet. I was pulled away to other work.
I returned to it today, though, and am fairly certain the problem is that the WebMaps in question contain layers that are being served by a 10.4.1 ArcGIS Server. I imagine the responses those services are providing ArcGIS Online when I'm trying to instantiate the Map object are lacking in some information that is vital now but likely didn't exist when that version was released.
I base these assumptions on having copied one of our "official" WebMaps into a personal account (where I do have permissions to share it with Everyone), using ArcGIS Online Assistant's GUI to change the URLs to point to the equivalent services on our new 11.2 ArcGIS Server and trying to instantiate the Map in my personal account. Now it works. Before changing the URL, I just receive validation errors and can not proceed.
So, I really do have to contact ESRI Support now, because manually updating the innumerable WebMaps pointing to 10.4.1 services that exist in our organization isn't really a viable option.
Anyway, just passing along what I've learned in case it helps someone else.
Will keep you posted!
I am experiencing the same issue and have found the issue in github logged as Issue #2109. The last post says there is a fix for the next release. Can anyone say when the next release will be?
Hi Maureen
I don't know when the next release will be; but, I contacted ESRI Support about this problem and they suggested a workaround that seems to have addressed my immediate problem.
Using an older version of ArcGIS Pro (that is, v3.3.1; forgot to put the version I used in my initial reply), I have been able to use the old libraries to successfully instantiate the WebMaps that use 10.4 ArcGIS Server services, change and save the new layer URLs which now use our 11.2 ArcGIS Servers services.
As yet, I have not attempted to instantiate those updated WebMaps with the newer libraries to see if the Validation Errors have disappeared. When I do, I'll let everyone know.
Hoping this helps,
jtm