title: Create Azure webjobs from Django/python web app
body: <p>I have a Django app deployed on a Azure Web App, and I want to dynamically create webjobs. More precisely, when I save a Django model called Importer, I want to be able to create a new web job, made of 3 files:</p>
  
  <ul>
  <li>run.py : the Python webjob</li>
  <li>settings.job : the cron schedule</li>
  <li>config.ini : a config file for the webjob</li>
  </ul>
  
  <p>The content of the "settings.job" &amp; "config.ini" comes from an admin form and is specific to the webjob.</p>
  
  <p>When I save my model, the code creates a new directory in </p>
  
  <blockquote>
    <p>App_Data\jobs\triggered{my job name}</p>
  </blockquote>
  
  <p>, and copies there the "run.py" from my app directory.</p>
  
  <p>This works. However, when I try to create a new text file called "settings.job" in the job directory and write the cron schedule in it, I got a server error. </p>
  
  <p>I tried many things, but the following basic test causes a failure:</p>
  
  <pre class="lang-python prettyprint-override"><code>file = open('test.txt','w')
  file.write('this is a test')
  file.close()
  </code></pre>
  
  <p>It seems that I don't have the right to write a file to the disk. How can that be solved? 
  Also, I want to be able to modify the content of the config and settings.job files when I update the corresponding Django model. </p>
  
  <p>In addition, I tried to copy another file called "run2.py" to the webjob directory, and that fails too ! I cannot copy another file that run.py in that directory</p>