<?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: How to include config.json file when publishing geoprocessing services in ArcGIS Enterprise? in Publishing and Managing Services Questions</title>
    <link>https://community.esri.com/t5/publishing-and-managing-services-questions/how-to-include-config-json-file-when-publishing/m-p/1600571#M1383</link>
    <description>&lt;P&gt;After a great deal of head scratching and frustration I found a workaround:&lt;/P&gt;&lt;P&gt;I created a config.py that contained a single line and placed it in the same location as my script tool (.pyt file):&lt;/P&gt;&lt;LI-CODE lang="python"&gt;config_file = "config.ini"&lt;/LI-CODE&gt;&lt;P&gt;then in my script tool, I imported the&amp;nbsp;config.py and declared an unused variable referencing config_file attribute in the config.py:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import config as config
script_dir = os.path.dirname(os.path.abspath(__file__))
f_config_path = os.path.join(script_dir, mappingini.config_filepath)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;this was enough for to force the geoprocessing creation service in ArcGIS Pro to include my config.ini in the same folder as the&amp;nbsp;script tool on the server. Then I could use it as intended later in the script tool:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;config = configparser.RawConfigParser()
config.read(pathlib.Path(__file__).parent / "config.ini")&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 28 Mar 2025 20:02:26 GMT</pubDate>
    <dc:creator>DarrenSmith</dc:creator>
    <dc:date>2025-03-28T20:02:26Z</dc:date>
    <item>
      <title>How to include config.json file when publishing geoprocessing services in ArcGIS Enterprise?</title>
      <link>https://community.esri.com/t5/publishing-and-managing-services-questions/how-to-include-config-json-file-when-publishing/m-p/1565209#M1312</link>
      <description>&lt;P&gt;I have a geoprocessing script written in Python that includes a main file, several .py files, and a config.json file. I want to publish it as a geoprocessing service in ArcGIS Enterprise 10.9.1.&lt;/P&gt;&lt;P&gt;In ArcGIS Pro, I set up a new script in the default toolbox, ran it, and published it as a geoprocessing service. However, when I tried to use it, I noticed that while the .py files were uploaded to the server's service directory, the config.json file was not included.&lt;/P&gt;&lt;P&gt;Is there any way to ensure the config.json file is uploaded so the service can access it without having to manually copy and paste it?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 17:10:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/publishing-and-managing-services-questions/how-to-include-config-json-file-when-publishing/m-p/1565209#M1312</guid>
      <dc:creator>EdgarZafra2</dc:creator>
      <dc:date>2024-12-05T17:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to include config.json file when publishing geoprocessing services in ArcGIS Enterprise?</title>
      <link>https://community.esri.com/t5/publishing-and-managing-services-questions/how-to-include-config-json-file-when-publishing/m-p/1600446#M1382</link>
      <description>&lt;P&gt;Hi Edgar,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Did you find a solution to this? I current have the same problem in that I want to include a config.ini file when I publish the geoprocessing service. It feels like we can't be the first people to have wanted to do something like this.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2025 15:38:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/publishing-and-managing-services-questions/how-to-include-config-json-file-when-publishing/m-p/1600446#M1382</guid>
      <dc:creator>DarrenSmith</dc:creator>
      <dc:date>2025-03-28T15:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to include config.json file when publishing geoprocessing services in ArcGIS Enterprise?</title>
      <link>https://community.esri.com/t5/publishing-and-managing-services-questions/how-to-include-config-json-file-when-publishing/m-p/1600571#M1383</link>
      <description>&lt;P&gt;After a great deal of head scratching and frustration I found a workaround:&lt;/P&gt;&lt;P&gt;I created a config.py that contained a single line and placed it in the same location as my script tool (.pyt file):&lt;/P&gt;&lt;LI-CODE lang="python"&gt;config_file = "config.ini"&lt;/LI-CODE&gt;&lt;P&gt;then in my script tool, I imported the&amp;nbsp;config.py and declared an unused variable referencing config_file attribute in the config.py:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import config as config
script_dir = os.path.dirname(os.path.abspath(__file__))
f_config_path = os.path.join(script_dir, mappingini.config_filepath)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;this was enough for to force the geoprocessing creation service in ArcGIS Pro to include my config.ini in the same folder as the&amp;nbsp;script tool on the server. Then I could use it as intended later in the script tool:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;config = configparser.RawConfigParser()
config.read(pathlib.Path(__file__).parent / "config.ini")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 Mar 2025 20:02:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/publishing-and-managing-services-questions/how-to-include-config-json-file-when-publishing/m-p/1600571#M1383</guid>
      <dc:creator>DarrenSmith</dc:creator>
      <dc:date>2025-03-28T20:02:26Z</dc:date>
    </item>
  </channel>
</rss>

