title: Azure Resource Template Dependencies / Application Insights
body: <p>I have a chicken and egg problem deploying Application Insights with my web application to Azure.  In the ARM template, the Application Insights module is dependent upon the web site for the application id (see dependencies in the ARM templates below).  On the other hand, in order to fully instrument the web application, I need the instrumentation key from the Application Insights Module.  How does one get around this?</p>
  
  <p><strong>Application Insights View From the Portal</strong></p>
  
  <p><a href="https://i.stack.imgur.com/1sEgm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1sEgm.png" alt="Application Insights module in the portal"></a></p>
  
  <p><strong>ARM Template for Web App</strong></p>
  
  <p><a href="https://i.stack.imgur.com/zlkND.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zlkND.png" alt="Web App ARM Template"></a></p>
  
  <p><strong>ARM Template for Application Insights</strong></p>
  
  <p><a href="https://i.stack.imgur.com/fMDpq.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fMDpq.png" alt="app insights arm template"></a></p>