We would like to manage/publish our services on different environments with service definition files (SD files). However, I realised that it is not possible to overwrite an existing service with registered data by using an SD file (screenshot 1).
It is of course possible to delete the service and republish it. However, republishing the service like this changes the itemID of the corresponding portal-item. An existing web map which consumes this service will still work (probably because the rest-url of the service is still the same), but the newly published item can no longer be called in the overview page of the web map item, because the link still contains the old itemID (screenshot 2). This can be fixed by changing the ItemID of the service in the JSON configuration file of the web map item on the portal server. However, this workaround cannot be the proper solution.
Is there really no way to overwrite a service with registered data using an SD file without changing the ID of the corresponding portal item?
product-version: ArcGIS Enterprise 10.8.1
Screenshot 1:
Screenshot 2:
Solved! Go to Solution.
Yup your right, that version is for standalone servers, here is for the federated one,
I tested it on a map service i published on our 10.8.1 enterprise setup, it works as expected and portal ids are retained after publishing the sd file.
This is for FS, https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/featuresharingdraft-class.htm
Hello,
First of all... are you using a referenced feature service in Enterprise Portal or is this a hosted feature service?
Hi, I’m using a referenced feature service in Enterprise Portal. The feature service is based on a database which is registered on the ArcGIS Portal Server.
You probably are missing a step before uploading the service definition,
Check this article, https://pro.arcgis.com/en/pro-app/latest/help/sharing/overview/publish-services.htm
And you can also check this script in this arcticle for overwriting services, https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/mapservicedraft-class.htm#GUID-F39810A0-180C-...
They talk about capability to overwrite so you dont have to lose your portal item ID.
Thanks a lot for the response. Yes, I directly created the service definition file (.sd) and missed the step of creating a map service definition draft (.sddraft). The workflow works fine for a Standalone ArcGIS Server but when I use the script to create the draft for a Portal ArcGIS Server the function «arcpy.sharing.CreateSharingDraft» returns an error indicating that the target server is not a standalone server.
In the script in this articel, https://enterprise.arcgis.com/en/server/latest/develop/windows/example-publish-service-definitions-l..., they delete and republish the service.. but then the ItemID of the Portal Item will probably change.
Yup your right, that version is for standalone servers, here is for the federated one,
I tested it on a map service i published on our 10.8.1 enterprise setup, it works as expected and portal ids are retained after publishing the sd file.
This is for FS, https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/featuresharingdraft-class.htm
Thanks a lot! It works