Publish a map service to ArcGIS server in a model

522
2
02-15-2018 01:29 PM
LarisaJohnstone
New Contributor II

Does anyone know how I can use scripts in a model to publish a map service to ArcGIS  Server Manger from an mxd? I know that I have been circling around the answer and the correct code for days now, but I have two problems...1) I cannot quite get python script to work and 2) I am not sure how to actually add it to a model. I am new to this.

I have used the code provided from this link: CreateMapSDDraft—Help | ArcGIS for Desktop  and I can get it to run without errors, BUT I have no idea where my sdraft is...or if it has worked. It looks like it does nothing. I am not sure where the files go!  And then to top it off, I need to have this run in a model.

Any help on where (file location) I should be looking for my published service would be great. I know I am missing something small and fundamental.

Thanks

Larisa

0 Kudos
2 Replies
JonathanQuinn
Esri Frequent Contributor

The CreateMapSDDraft tool creates an output file and it's location and name is defined by the out_sddraft parameter:

This is the second parameter within the tool.  Once you have your script working, what's the reason for using it in a model?

0 Kudos
LarisaJohnstone
New Contributor II

We are trying to simplify processes that we do almost on a  daily basis as we have a lot of new staff that will be publishing services. So I was asked to "automate" some updates to a data base which update a mxd, spit out a pdf and it also needs to be published as a service for ArcGIS Sever to be consumed in our Geocortex apps. I have everything working in my model EXCEPT getting it to create the service in Manager.

0 Kudos