Change Hosted Feature Service URL on Portal

4767
17
12-11-2017 06:41 AM
JustinGreco
Occasional Contributor

I have published all my services prior to adding a load balancer and have noticed that the URL for the service on the Portal item still references the non-load balanced URL.  I though setting the WebContextURL on the Portal and the Server to the load balanced URL would resolve that.  I would like to avoid having to republish everything after setting up the load balancer, since the load balanced URL is already being used for our existing production.  I have attempted changing it using the Python API, but get an error saying the URL cannot be edited, only thing that works is changing it from http to https.  I was hoping that the URLs in the items would be relative, but it looks like they are not.

0 Kudos
17 Replies
JonathanQuinn
Esri Notable Contributor

Yes, non-hosted services, applications, and operational and basemap service URLs within webmaps can be updated via the Sharing API using a script, but did you need to update hosted services? Those cannot be updated via the Sharing API and need to be updated elsewhere, a workflow that is not supported and risky.

0 Kudos
EricJackson1
New Contributor III

No, we didn't find a way to update the URL for hosted services.  We deleted those and will recreated as needed.  We also deleted all Insights content since those too are in the hosted folder.  The change to the secruity-config.json was necessary because it still retained a reference to the prior web adapter URL.  This wasn't changed by using the Update Server REST Endpoint. 

0 Kudos
nelsmickaelson
New Contributor III

Hi Eric,

Can you share the code you used to update the URLs of non-hosted feature services? 

Thank you!

0 Kudos
AhmadAwada1
New Contributor II

Dear Nels,

Kindly find attached the toolset I used (ago-tools-master).

You will specifically need “updateMapServiceUrlsInWebMaps & updateRegisteredUrlForServiceOrApp” tools as I remember.

Good Luck

nelsmickaelson
New Contributor III

Thank you. Really appreciate your willingness to share!

0 Kudos
EricJackson1
New Contributor III

I used these tools also.  Though some webmaps didn't get updated. However I think it was probably user error!  I recommend as much testing as possible.  There may be other tools but I didn't find any really good examples of exactly what I wanted to do (essentially a mass search and replace of an old web adaptor name to a new web adaptor name for all content that could contain those strings).

If you have qa portal running on VMs that would be helpful since you could create a snapshot prior to testing and restore if something doesn't work as planned.  

0 Kudos
NicolasGIS
Occasional Contributor III

Hello Jonathan Quinn‌,

do you have more information about this request ? Any version number for example ?

Thanks !

0 Kudos
NicolasGIS
Occasional Contributor III

Might be good to create an idea ? I did not find any thing related to that.

0 Kudos