<?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: Automation for publishing CRFs in a Storage Account in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697803#M75212</link>
    <description>&lt;P&gt;What do you mean by "after registering"? Are you referring to the data store? If so, that is already registered. I would not have been able to publish via the UI otherwise.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Apr 2026 20:34:35 GMT</pubDate>
    <dc:creator>Jeff-Reinhart</dc:creator>
    <dc:date>2026-04-22T20:34:35Z</dc:date>
    <item>
      <title>Automation for publishing CRFs in a Storage Account</title>
      <link>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697786#M75210</link>
      <description>&lt;P&gt;I am attempting to automate the workflow for publishing a CRF stored in an Azure Storage Account as a referenced Imagery Layer. We have close to 100 CRFs to publish as part of our cloud migration. So far, I have gathered that the general workflow would be to create a service definition and then use the ArcGIS Python API to publish that service definition.&lt;/P&gt;&lt;P&gt;I cannot even get past creating the service definition.&lt;/P&gt;&lt;P&gt;When I run:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;crf_path = r'c:\myacsfile.acs\folder_name\mycrf.crf'
sharing_draft = arcpy.sharing.CreateSharingDraft('FEDERATED_SERVER', 'IMAGE_SERVICE', 'service_name', crf_path)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The return is None. The likely culprit is that CreateSharingDraft does not like the value passed for the draft_value (crf_path). I copied the CRF path from Pro | Catalog | Project | Cloud Stores using r-click &amp;gt; Copy Path. I have successfully tested publishing the CRF via the UI. There does not seem to be any reason the path is wrong.&lt;/P&gt;&lt;P&gt;I tried arcpy.Exists(crf_path), and that is returning True.&lt;/P&gt;&lt;P&gt;Am I missing something or is this not supported?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2026 13:12:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697786#M75210</guid>
      <dc:creator>Jeff-Reinhart</dc:creator>
      <dc:date>2026-04-23T13:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Automation for publishing CRFs in a Storage Account</title>
      <link>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697795#M75211</link>
      <description>&lt;P&gt;I believe ArcPy cannot directly publish a cloud-hosted CRF via .acs&amp;nbsp;path,&amp;nbsp;you have to go through a map or use REST/API instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After registering try:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;crf_path = r'/vsiaz/&amp;lt;container-name&amp;gt;/path/to/your.crf'&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Apr 2026 20:25:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697795#M75211</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2026-04-22T20:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Automation for publishing CRFs in a Storage Account</title>
      <link>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697803#M75212</link>
      <description>&lt;P&gt;What do you mean by "after registering"? Are you referring to the data store? If so, that is already registered. I would not have been able to publish via the UI otherwise.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2026 20:34:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697803#M75212</guid>
      <dc:creator>Jeff-Reinhart</dc:creator>
      <dc:date>2026-04-22T20:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Automation for publishing CRFs in a Storage Account</title>
      <link>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697811#M75213</link>
      <description>&lt;P&gt;&lt;SPAN&gt;CreateSharingDraft needs a &lt;/SPAN&gt;map or layer object&lt;SPAN&gt;, not a file path string.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ok try:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;# Add your CRF to a map using the .acs connection (for client access)
aprx = arcpy.mp.ArcGISProject("CURRENT")
map_obj = aprx.listMaps()[0]
crf_layer = map_obj.addDataFromPath(r'c:\myacsfile.acs\folder_name\mycrf.crf')

# Now pass the layer object, not the file path string
sharing_draft = arcpy.sharing.CreateSharingDraft(
    'FEDERATED_SERVER', 
    'IMAGE_SERVICE', 
    'service_name', 
    crf_layer  # Pass the layer object, not a string path
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use a Cloud-Native VSI Path,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is a direct path to the raster, bypassing the &lt;/SPAN&gt;.acs&lt;SPAN&gt; connection file:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;crf_path = r'/vsiaz/your-container-name/path/to/your.crf&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2026 20:58:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697811#M75213</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2026-04-22T20:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Automation for publishing CRFs in a Storage Account</title>
      <link>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697820#M75214</link>
      <description>&lt;P&gt;Thanks for the reply. I tried that. The CRF adds to the map as expected. Unfortunately, the return from&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;sharing&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;CreateSharingDraft() is still None.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Apr 2026 21:16:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697820#M75214</guid>
      <dc:creator>Jeff-Reinhart</dc:creator>
      <dc:date>2026-04-22T21:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Automation for publishing CRFs in a Storage Account</title>
      <link>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697829#M75215</link>
      <description>&lt;P&gt;And I should note that according to:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/createsharingdraft.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/createsharingdraft.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;a path to a raster dataset should be valid for a draft_value param...&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;For a map service, this is a&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/3.6/arcpy/mapping/map-class.htm" target="_blank" rel="noopener"&gt;Map&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;object. For a geoprocessing service or a web tool, this is one or more geoprocessing results. For an image service or web imagery layer, this is the path of a raster or mosaic dataset.&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;Also of note, I tried passing the path string within a list.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2026 21:23:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697829#M75215</guid>
      <dc:creator>Jeff-Reinhart</dc:creator>
      <dc:date>2026-04-22T21:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Automation for publishing CRFs in a Storage Account</title>
      <link>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697855#M75216</link>
      <description>&lt;P&gt;If I am reading it correctly. Passing a .acs&amp;nbsp;path directly are not supported.&lt;/P&gt;&lt;P&gt;ArcPy sharing API expects real dataset path,&amp;nbsp; can not resolve cloud store connections (.acs).&lt;/P&gt;&lt;P&gt;So you have to use&amp;nbsp;r"D:\rasters\image.crf" or&amp;nbsp;r"Database Connections\conn.sde\mosaic_dataset"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2026 22:40:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697855#M75216</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2026-04-22T22:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Automation for publishing CRFs in a Storage Account</title>
      <link>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697930#M75217</link>
      <description>&lt;P&gt;In regard to using the REST API... this doc:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/publish-item/" target="_blank"&gt;https://developers.arcgis.com/rest/users-groups-and-items/publish-item/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;States:&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;Publishers can create feature services as well as tiled map services."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;From my experience, assumption based on omission is how to read Esri documentation. With "imagery layers" not included in this description, I am lead to believe publishing them via the REST API is not supported.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2026 13:27:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1697930#M75217</guid>
      <dc:creator>Jeff-Reinhart</dc:creator>
      <dc:date>2026-04-23T13:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Automation for publishing CRFs in a Storage Account</title>
      <link>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1698519#M75218</link>
      <description>&lt;P&gt;Try using,&amp;nbsp;arcpy.management.CreateImageSDDraft&amp;nbsp; is currently the more reliable choice, even though it's the "older" tool.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import arcpy

aprx = arcpy.mp.ArcGISProject("CURRENT")

sddraft = r"C:\temp\service.sddraft"
sd = r"C:\temp\service.sd"

# This is the key tool (not CreateSharingDraft)
arcpy.management.CreateImageSDDraft(
    in_raster=crf_path,
    out_sddraft=sddraft,
    service_name="service_name",
    server_type="FEDERATED_SERVER",
    connection_file_path=r"C:\path\to\server.ags",
    copy_data_to_server=False
)

arcpy.server.StageService(sddraft, sd)
arcpy.server.UploadServiceDefinition(sd, r"C:\path\to\server.ags")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Esri tends to document each service type in its own section rather than having one universal publish endpoint. Feature/tiled services use the Sharing API’s /publish. Imagery services use Image Server / Raster Analysis tools and dedicated create/publish operations.&lt;/P&gt;&lt;P&gt;For your bulk cloud migration of CRFs as referenced web imagery layers, the most reliable automated paths are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;arcpy.management.CreateImageSDDraft&lt;/SPAN&gt; + &lt;SPAN&gt;StageService&lt;/SPAN&gt; + &lt;SPAN&gt;UploadServiceDefinition&lt;/SPAN&gt;)&lt;/LI&gt;&lt;LI&gt;Or switching to &lt;SPAN&gt;arcgis&lt;/SPAN&gt; Python API calls that leverage the registered Azure cloud store directly.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Mon, 27 Apr 2026 14:16:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1698519#M75218</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2026-04-27T14:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Automation for publishing CRFs in a Storage Account</title>
      <link>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1699293#M75219</link>
      <description>&lt;P&gt;Needed a few tweaks, but this worked. Thank you. Running from 3.6.2.&lt;/P&gt;&lt;P&gt;The function arcpy.management.CreateImageSDDraft had to be called as arcpy.CreateImageSDDraft.&lt;/P&gt;&lt;P&gt;The in_raster param for&amp;nbsp;&lt;SPAN&gt;CreateImageSDDraft&amp;nbsp;&lt;/SPAN&gt;had to be updated to raster_or_mosaic_layer.&lt;/P&gt;&lt;P&gt;For arcpy.server.UploadServiceDefinition, the in_server param needed to be the Enterprise URL string, not the AGS server connection file. I think this varies depending on what type of server you are publishing to.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2026 14:07:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1699293#M75219</guid>
      <dc:creator>Jeff-Reinhart</dc:creator>
      <dc:date>2026-04-30T14:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Automation for publishing CRFs in a Storage Account</title>
      <link>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1699296#M75220</link>
      <description>&lt;P&gt;Noice!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2026 14:11:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/automation-for-publishing-crfs-in-a-storage/m-p/1699296#M75220</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2026-04-30T14:11:59Z</dc:date>
    </item>
  </channel>
</rss>

