<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Overwrite REST Service to protected Folder in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/overwrite-rest-service-to-protected-folder/m-p/1207276#M65424</link>
    <description>&lt;P class=""&gt;&lt;FONT size="2"&gt;Trying to write a python script to overwrite a REST service under a specific folder. Does anyone know where or what I need to add if I want to overwrite my service to a specific, password protected folder on my ArcServer? I've tried to have my target_server_connection with the folder I want to add to it as "&lt;A href="https://myorganization/rest/services/protectedfolder" target="_blank" rel="noopener nofollow noreferrer"&gt;https://myorganization/rest/services/protectedfolder&lt;/A&gt;"&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;but it just keeps adding to the overall rest inventory.&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;(Code Snippet)&lt;/P&gt;&lt;P class=""&gt;&lt;FONT size="2"&gt;# Create MapServiceDraft and set overwrite property&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT size="2"&gt;target_server_connection = r"&lt;A href="https://myorganization/rest/services/" target="_blank" rel="noopener nofollow noreferrer"&gt;https://myorganization/rest/services/&lt;/A&gt;"&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT size="2"&gt;sddraft = arcpy.sharing.CreateSharingDraft("STANDALONE_SERVER", "MapService", service_name, m)&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT size="2"&gt;sddraft.targetServer = target_server_connection&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT size="2"&gt;sddraft.overwriteExistingService = True&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;Like I mentioned, the code runs smooth, but I'm just trying to password protect this data behind a folder. Any suggestions are greatly appreciated!&lt;/P&gt;&lt;P class=""&gt;I have been referencing this documentation to construct my code from. It can be found at the bottom under "Overwrite a map service"&lt;BR /&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/mapservicedraft-class.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/mapservicedraft-class.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Aug 2022 15:55:09 GMT</pubDate>
    <dc:creator>Rice_GIS</dc:creator>
    <dc:date>2022-08-29T15:55:09Z</dc:date>
    <item>
      <title>Overwrite REST Service to protected Folder</title>
      <link>https://community.esri.com/t5/python-questions/overwrite-rest-service-to-protected-folder/m-p/1207276#M65424</link>
      <description>&lt;P class=""&gt;&lt;FONT size="2"&gt;Trying to write a python script to overwrite a REST service under a specific folder. Does anyone know where or what I need to add if I want to overwrite my service to a specific, password protected folder on my ArcServer? I've tried to have my target_server_connection with the folder I want to add to it as "&lt;A href="https://myorganization/rest/services/protectedfolder" target="_blank" rel="noopener nofollow noreferrer"&gt;https://myorganization/rest/services/protectedfolder&lt;/A&gt;"&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;but it just keeps adding to the overall rest inventory.&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;(Code Snippet)&lt;/P&gt;&lt;P class=""&gt;&lt;FONT size="2"&gt;# Create MapServiceDraft and set overwrite property&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT size="2"&gt;target_server_connection = r"&lt;A href="https://myorganization/rest/services/" target="_blank" rel="noopener nofollow noreferrer"&gt;https://myorganization/rest/services/&lt;/A&gt;"&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT size="2"&gt;sddraft = arcpy.sharing.CreateSharingDraft("STANDALONE_SERVER", "MapService", service_name, m)&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT size="2"&gt;sddraft.targetServer = target_server_connection&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT size="2"&gt;sddraft.overwriteExistingService = True&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;Like I mentioned, the code runs smooth, but I'm just trying to password protect this data behind a folder. Any suggestions are greatly appreciated!&lt;/P&gt;&lt;P class=""&gt;I have been referencing this documentation to construct my code from. It can be found at the bottom under "Overwrite a map service"&lt;BR /&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/mapservicedraft-class.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/mapservicedraft-class.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 15:55:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overwrite-rest-service-to-protected-folder/m-p/1207276#M65424</guid>
      <dc:creator>Rice_GIS</dc:creator>
      <dc:date>2022-08-29T15:55:09Z</dc:date>
    </item>
  </channel>
</rss>

