<?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 Re: Issues with publishing a Map in an ArcGIS Pro project as a Map Service to ArcGIS Server in ArcAPI Questions</title>
    <link>https://community.esri.com/t5/arcapi-questions/issues-with-publishing-a-map-in-an-arcgis-pro/m-p/1004671#M113</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/43250"&gt;@MehdiPira1&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I see this is back from January so I'm not sure if you've resolved your issue or not.&lt;/P&gt;&lt;P&gt;I'm wondering if you are needing to share as a service or would hosting the layer serve your purpose?&lt;/P&gt;&lt;P&gt;I'm currently in the process of automating many of the services we were running here due to some software versioning issues we encountered (we're still on 10.4&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":expressionless_face:"&gt;😑&lt;/span&gt;)&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/sharing/featuresharingdraft-class.htm" target="_blank" rel="noopener"&gt;Feature Sharing Draft&lt;/A&gt;&amp;nbsp; seems to be the "go-to" answer for automating overwrites but there are still a lot of rough edges with the process to be honest. When you use the script as described in the document most of the configurable properties you may have set when originally hosting the layer revert to the default... the two biggest ones in my case are timezone and sharing options.&lt;/P&gt;&lt;P&gt;The timezone issue has been resolved and I've attached the script in a txt file. I'm still working on trying to fix the sharing issue I'm having because it's not a huge benefit to have to go in and manually update the sharing on all these layers everyday just to have it revert to not shared every evening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helped or that you got your problem solved already&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 15:08:47 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2020-11-25T15:08:47Z</dc:date>
    <item>
      <title>Issues with publishing a Map in an ArcGIS Pro project as a Map Service to ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcapi-questions/issues-with-publishing-a-map-in-an-arcgis-pro/m-p/861565#M93</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to get the following code running. This code is a copy from this link:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/sharing/createsharingdraft.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/sharing/createsharingdraft.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;CreateSharingDraft—Sharing module | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy 
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os 
&lt;SPAN class="comment token"&gt;# Set output file names &lt;/SPAN&gt;
outdir &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\Project\Output"&lt;/SPAN&gt; 
service &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MapServiceDraftExample"&lt;/SPAN&gt; 
sddraft_filename &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; service &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".sddraft"&lt;/SPAN&gt; 
sddraft_output_filename &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;outdir&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sddraft_filename&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
&lt;SPAN class="comment token"&gt;# Reference map to publish &lt;/SPAN&gt;
aprx &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"C:\Project\World.aprx"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
m &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMaps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"World"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; 
&lt;SPAN class="comment token"&gt;# Create MapServiceDraft and set service properties &lt;/SPAN&gt;
service_draft &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sharing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateSharingDraft&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"STANDALONE_SERVER"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MAP_SERVICE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; service&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; m&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
service_draft&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;targetServer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\Project\myserver.ags.esri.com (publisher).ags"&lt;/SPAN&gt; 
&lt;SPAN class="comment token"&gt;# Create Service Definition Draft file&lt;/SPAN&gt;
service_draft&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;exportToSDDraft&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sddraft_output_filename&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
&lt;SPAN class="comment token"&gt;# Stage Service &lt;/SPAN&gt;
sd_filename &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; service &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".sd"&lt;/SPAN&gt; 
sd_output_filename &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;outdir&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sd_filename&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;StageService_server&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sddraft_output_filename&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sd_output_filename&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
&lt;SPAN class="comment token"&gt;# Share to portal &lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Uploading Service Definition..."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UploadServiceDefinition_server&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sd_output_filename&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\Project\myserver.ags.esri.com (publisher).ags"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Successfully Uploaded service."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've changed the variable accordingly, however I get this error even though I can connect to the server (.ags) in ArcGIS Pro:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="478325" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/478325_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there any other options besides&amp;nbsp;&lt;SPAN style="color: #c41a16;"&gt;"STANDALONE_SERVER" &lt;SPAN style="color: #000000;"&gt;in&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;service_draft = arcpy.sharing.CreateSharingDraft(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;"STANDALONE_SERVER"&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;, &lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;"MAP_SERVICE"&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;, service, m)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:40:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/issues-with-publishing-a-map-in-an-arcgis-pro/m-p/861565#M93</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2021-12-12T10:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with publishing a Map in an ArcGIS Pro project as a Map Service to ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcapi-questions/issues-with-publishing-a-map-in-an-arcgis-pro/m-p/1004671#M113</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/43250"&gt;@MehdiPira1&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I see this is back from January so I'm not sure if you've resolved your issue or not.&lt;/P&gt;&lt;P&gt;I'm wondering if you are needing to share as a service or would hosting the layer serve your purpose?&lt;/P&gt;&lt;P&gt;I'm currently in the process of automating many of the services we were running here due to some software versioning issues we encountered (we're still on 10.4&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":expressionless_face:"&gt;😑&lt;/span&gt;)&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/sharing/featuresharingdraft-class.htm" target="_blank" rel="noopener"&gt;Feature Sharing Draft&lt;/A&gt;&amp;nbsp; seems to be the "go-to" answer for automating overwrites but there are still a lot of rough edges with the process to be honest. When you use the script as described in the document most of the configurable properties you may have set when originally hosting the layer revert to the default... the two biggest ones in my case are timezone and sharing options.&lt;/P&gt;&lt;P&gt;The timezone issue has been resolved and I've attached the script in a txt file. I'm still working on trying to fix the sharing issue I'm having because it's not a huge benefit to have to go in and manually update the sharing on all these layers everyday just to have it revert to not shared every evening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helped or that you got your problem solved already&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 15:08:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/issues-with-publishing-a-map-in-an-arcgis-pro/m-p/1004671#M113</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-11-25T15:08:47Z</dc:date>
    </item>
  </channel>
</rss>

