<?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 do I publish a service using a service definition file (.sd) through the ArcGIS Server REST API? in High Availability and Disaster Recovery Questions</title>
    <link>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805810#M104</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;1) Upload to the Admin API&lt;/BLOCKQUOTE&gt;&lt;P&gt;Could you clarify? Which method of arcpy would that be?&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;2) Get the service configuration&lt;/P&gt;&lt;P&gt;3) Run Publish Service Definition with the service configuration&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Doesn't this require an arcpy connection object? How do we create one when we use an external authentication service?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Oct 2019 11:09:11 GMT</pubDate>
    <dc:creator>ChristopherVirtucio</dc:creator>
    <dc:date>2019-10-07T11:09:11Z</dc:date>
    <item>
      <title>How do I publish a service using a service definition file (.sd) through the ArcGIS Server REST API?</title>
      <link>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805808#M102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I asked a &lt;A href="https://gis.stackexchange.com/q/337709/138666"&gt;question on gis.stackexchange.com&lt;/A&gt; on how I should be publishing a service through the REST API. I'm reproducing the question here for convenience:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;DIV class=""&gt;&lt;P&gt;The algorithm I have so far is basically this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a &lt;CODE&gt;sddraft&lt;/CODE&gt; from a &lt;CODE&gt;mxd&lt;/CODE&gt; file (using &lt;A href="https://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/createmapsddraft.htm" rel="nofollow noreferrer"&gt;arcpy.CreateMapSDDraft()&lt;/A&gt;.&lt;/LI&gt;&lt;LI&gt;Stage &lt;CODE&gt;sddraft&lt;/CODE&gt; into a &lt;CODE&gt;sd&lt;/CODE&gt; file (using &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/server/stage-service.htm" rel="nofollow noreferrer"&gt;arcpy.StageService_server()&lt;/A&gt;.&lt;/LI&gt;&lt;LI&gt;Upload &lt;CODE&gt;sd&lt;/CODE&gt; file to ArcGIS server over REST.&lt;OL&gt;&lt;LI&gt;There's a little dance that has to happen due to the fact that we use &lt;CODE&gt;web-adaptor&lt;/CODE&gt; and have to redirect all requests to a single-sign-on server first for authentication, before forwarding the &lt;EM&gt;intended&lt;/EM&gt; request to the &lt;EM&gt;intended&lt;/EM&gt; destination.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Call &lt;CODE&gt;createService&lt;/CODE&gt; on ArcGIS server's REST API, pointing to the uploaded &lt;CODE&gt;sd&lt;/CODE&gt; file.&lt;OL&gt;&lt;LI&gt;This happens in the same http session, so no need to go through the authentication dance again.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The fourth step manages to create the service, but startup fails due to &lt;CODE&gt;Invalid file&lt;/CODE&gt;. The only documentation for the &lt;CODE&gt;createService&lt;/CODE&gt; endpoint that I could find is &lt;A href="https://developers.arcgis.com/rest/enterprise-administration/server/createservice.htm" rel="nofollow noreferrer"&gt;this&lt;/A&gt;, and I can only surmise that the endpoint only accepts the old and deprecated &lt;CODE&gt;msd&lt;/CODE&gt; file, but not the newer &lt;CODE&gt;sd&lt;/CODE&gt; file. If that's the case, what endpoint am I supposed to hit for creating a service from a &lt;CODE&gt;sd&lt;/CODE&gt; file? Note that &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/server/upload-service-definition.htm" rel="nofollow noreferrer"&gt;arcpy.UploadServiceDefinition()&lt;/A&gt; isn't an option for us due to the fact that authentication is handled elsewhere from the ArcGIS server.&lt;/P&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I was wondering if anyone would happen to know the answer for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2019 17:10:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805808#M102</guid>
      <dc:creator>ChristopherVirtucio</dc:creator>
      <dc:date>2019-10-04T17:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I publish a service using a service definition file (.sd) through the ArcGIS Server REST API?</title>
      <link>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805809#M103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SD file packages the necessary files and folders for the service. It can't be used directly against the createService API. The createService API requires service JSON, which requires a bit of pre-work to create the necessary folders and other metedata. Instead, if you upload the service through Manager, watch the network traffic and re-create the requests in your language of choice. At a high level, its:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Upload to the Admin API&lt;/P&gt;&lt;P&gt;2) Get the service configuration&lt;/P&gt;&lt;P&gt;3) Run Publish Service Definition with the service configuration&lt;/P&gt;&lt;P&gt;4) Check the job status until a success or failure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2019 20:46:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805809#M103</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2019-10-04T20:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I publish a service using a service definition file (.sd) through the ArcGIS Server REST API?</title>
      <link>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805810#M104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;1) Upload to the Admin API&lt;/BLOCKQUOTE&gt;&lt;P&gt;Could you clarify? Which method of arcpy would that be?&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;2) Get the service configuration&lt;/P&gt;&lt;P&gt;3) Run Publish Service Definition with the service configuration&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Doesn't this require an arcpy connection object? How do we create one when we use an external authentication service?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Oct 2019 11:09:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805810#M104</guid>
      <dc:creator>ChristopherVirtucio</dc:creator>
      <dc:date>2019-10-07T11:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I publish a service using a service definition file (.sd) through the ArcGIS Server REST API?</title>
      <link>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805811#M105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The workflow I described won't use any arcpy functions, aside from creating the SDDraft and the SD file.You'd be using straight Python to upload files (an SD file) to a website, (the Admin API), and then publish it using the Publishing Tools GP service. Run through the process manually through ArcGIS Server Manager and watch the network traffic. You'll be re-creating all of those requests within Python. What authentication service are you using? As long as there are libraries to handle the authentication, (requests, requests_ntlm, etc), you shouldn't have a problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Oct 2019 17:07:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805811#M105</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2019-10-07T17:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I publish a service using a service definition file (.sd) through the ArcGIS Server REST API?</title>
      <link>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805812#M106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I got a little confused since I wasn't sure if you were referring to REST calls or the arcpy library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually did manage to write something that's &lt;EM&gt;close&lt;/EM&gt; to what I think you're referring to. We use &lt;A href="https://apereo.github.io/cas/6.0.x/index.html"&gt;CAS&lt;/A&gt; , and I'm already doing the authentication bit per the &lt;A href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fgis.stackexchange.com%2Fq%2F337709%2F138666"&gt;question&lt;/A&gt; I linked above. I upload the file, then call &lt;A href="https://developers.arcgis.com/sign-in?redirect_uri=%2Frest%2Fenterprise-administration%2Fserver%2Fcreateservice.htm"&gt;createService&lt;/A&gt;, which manages to create the service, but startup fails. Your comment did point out something that I admittedly &lt;EM&gt;should&lt;/EM&gt; have been doing, though, which is to see what the &lt;EM&gt;actual&lt;/EM&gt; requests are, so I can mimic those.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Oct 2019 21:17:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805812#M106</guid>
      <dc:creator>ChristopherVirtucio</dc:creator>
      <dc:date>2019-10-07T21:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I publish a service using a service definition file (.sd) through the ArcGIS Server REST API?</title>
      <link>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805813#M107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Managed to inspect the different steps of the manually publishing process. There's a POST request for a job at the path:&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;/rest/services/System/PublishingTools/GPServer/Publish%20Service%20Definition&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;The API seems to take the ff. params:&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;1. in_sdp_id&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;2. in_config_overwrite&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;3. in_publish_options&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;4. out_soap_svc_url&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;5. out_rest_svc_url&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;6. out_results&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;But it's not very clear what each of the params mean, nor is it clear how I'm supposed to generate them.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;edit: seems like in_sdp_id refers to the identifier of the file that the server gives you after uploading it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2019 13:05:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805813#M107</guid>
      <dc:creator>ChristopherVirtucio</dc:creator>
      <dc:date>2019-10-31T13:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I publish a service using a service definition file (.sd) through the ArcGIS Server REST API?</title>
      <link>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805814#M108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Figured it out; solution available &lt;A href="https://gis.stackexchange.com/questions/337709/publishing-service-using-service-definition-file-sd-through-the-arcgis-rest-ap/340667#340667"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Nov 2019 12:56:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/high-availability-and-disaster-recovery-questions/how-do-i-publish-a-service-using-a-service/m-p/805814#M108</guid>
      <dc:creator>ChristopherVirtucio</dc:creator>
      <dc:date>2019-11-04T12:56:08Z</dc:date>
    </item>
  </channel>
</rss>

