Defining sharing options in the service definition draft

248
2
10-06-2021 06:04 AM
michaelmgis
New Contributor

Hello,

I want to publish a Map Image Service on ArcGIS Enterprise 10.8.1 with arcpy in ArcGIS Pro using arcpy.MapImageSharingDraft. By adapting the Modify SDDraft example 3 I parsed the Map Image Service sddraft to enable the WMS option.

The next stept would be staging and publishing but an error appears when staging: Error 00297 because WMS layer has to be shared with everyone. 

Is there a way to define the sharing option before staging the sddraft like setting an option in the sddraft itself? I wasn't able to find a line which adresses this issue. 

Regards

Michael

0 Kudos
2 Replies
DonMorrison1
Occasional Contributor III

I wrote some python code a while back to publish REST services to our ArcGIS server and as far as I could tell I could only secure the service after the publish (UploadServiceDefinition) was complete. This was fairly simple to do by sending  a series of requests via the Add Permissions REST API. First I  looped on the roles that I wanted to give access to  ({'principal': <role_name>, 'isAllowed': True}), then I sent a request to disable the public access ({'principal': 'esriEveryone', 'isAllowed': False})

I didn't enable WMS so maybe there is an issue there that I didn't have to deal with. I'm curious is somebody has a better way so that my "secure" endpoint doesn't have to be exposed publicly - even if it is only for a couple of seconds

0 Kudos
jotaefe_1980
New Contributor

Hi, you can define the sharing option before staging the sddraft like setting an option in the sddraft itself. 

In the XML : SVCManifest > StagingSettings > PropertyArray and go to the PropertySetProperty node defined by the key Node name "PackageIsPublic": set true to the Value node

Best reg.

0 Kudos