title: Is System.IO.File access allowed in IIS/Azure Cloud?
body: <p>I have a WCF service that gets a CSV file via a WebClient. It works fine on my local machine. However when deployed on Azure cloud, it seems to fail silently. I am not able to find any indication in the log files that it failed.</p>
  
  <p>I assume this code is failing because of this:</p>
  
  <pre><code> public void DownloadStockPriceFromYahoo()
          {
              if (File.Exists(_path))
              {
                  DateTime lastModified = System.IO.File.GetLastWriteTime(_path);
                  if (lastModified.Date &lt; DateTime.Today)
                  {
                      File.Delete(_path);
                      using (WebClient Client = new WebClient())
                      {
                          Client.DownloadFile("http://finance.yahoo.com/d/quotes.csv?s=MSFT+INTC+GM&amp;f=snl1d1ohg", _path);
                      }
                  }
              }
              else
              {
                  using (WebClient Client = new WebClient())
                  {
                      Client.DownloadFile("http://finance.yahoo.com/d/quotes.csv?s=MSFT+INTC+GM&amp;f=snl1d1ohg", _path);
                  }
              }
          }
  </code></pre>
  
  <p>Could it be that IIS doesn't allow File access? What is the alternative?</p>