Answers: <p>I discovered two issues that hindered the pipeline deploying properly.</p>
  <p>First, it appears that the Azure plugin for Eclipse creates an app.war file in the wwwroot folder of the app. Azure, apparently, prioritizes picking up this war, instead of any that might be in wwwroot/webapps.</p>
  <p>Previously I had manually deleted app.war, but then the app would just 404. This leads to the second issue. I was attempting to deploy using the default package name &quot;...SNAPSHOT&quot;; however, Tomcat looks for ROOT.war. I added the following lines to my pom.xml.</p>
  <pre><code>&lt;build&gt;
         &lt;finalName&gt;ROOT&lt;/finalName&gt;
  &lt;/build&gt;
  </code></pre>
  <p>This delivered the appropriately named file, which the &quot;Azure App Service deploy&quot; task places in wwwroot/webapps (where Tomcat looks for it). I then deleted the app.war file and any leftover ...SNAPSHOT folders in webapps, and restarted the app. It booted up with the war from the pipeline, as intended.</p>
  <p>I will not be using the Azure plugin for Eclipse any longer, as it appears incompatible with Azure DevOps pipelines.</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-07-13T19:11:19.807Z
Answers: 2022-07-13T19:15:17.287Z
Answers: 2022-07-13T19:15:17.287Z
Answers: highsilkhat
Body: <p>I am using an Azure DevOps release pipeline to deploy code to an Azure Web App. It pulls my .war file from my most recent build pipeline to deploy. However, it serves old code. For example, the app has referenced an old application.properties file, in the past. It also will reference previously deleted files at runtime, even when the code has no reference to those files.I have attempted to restart, stop and start the app, to no avail. It’s running on a Tomcat 9.0 server.</p>
  <p>In my current position, I'm limited to using TFVC so resorted to using the DevOps pipeline UI, instead of yaml. For my release pipeline, I use the &quot;Azure App Service deploy&quot; task.</p>
  <p>I have seen this previously posted <a href="https://stackoverflow.com/questions/51685496/azure-web-app-serving-old-files">question</a>, but I am confident it is not a personal caching issue. First, I have cleared my browser's cache, and also have used a different browser, which hadn't cached the old site. Second, and more indicative of the issue, I can push code through the Eclipse Azure plugin, which then causes the web app to serve the most recent code. However, I don't get similar functionality from the DevOps release pipeline</p>
  <p>I have snooped around on kudu and still can't find the issue. Similar to the previously linked question, I discover that the code appears to be the most recent. I have also manually deleted the code from webapps folder, then redeployed from the DevOps pipeline, with no luck. I'm trying to discover what the Azure Eclipse does differently in deployment that I'm missing in my DevOps pipeline. Is Tomcat caching content? If so, is there a way to automate a clear cache using Azure Pipelines' UI?</p>
  
Tags: <azure-devops><azure><azure-pipelines><java><tomcat>
Title: Azure Web Apps Serves Old Files
UserDisplayName: highsilkhat
ThreadText: # Azure Web Apps Serves Old Files
  
  (Asked by: username_0 on 2022-07-11)
  
  I am using an Azure DevOps release pipeline to deploy code to an Azure Web App. It pulls my .war file from my most recent build pipeline to deploy. However, it serves old code. For example, the app has referenced an old application.properties file, in the past. It also will reference previously deleted files at runtime, even when the code has no reference to those files.I have attempted to restart, stop and start the app, to no avail. It’s running on a Tomcat 9.0 server.
  
  In my current position, I'm limited to using TFVC so resorted to using the DevOps pipeline UI, instead of yaml. For my release pipeline, I use the "Azure App Service deploy" task.
  
  I have seen this previously posted [question](https://stackoverflow.com/questions/51685496/azure-web-app-serving-old-files), but I am confident it is not a personal caching issue. First, I have cleared my browser's cache, and also have used a different browser, which hadn't cached the old site. Second, and more indicative of the issue, I can push code through the Eclipse Azure plugin, which then causes the web app to serve the most recent code. However, I don't get similar functionality from the DevOps release pipeline
  
  I have snooped around on kudu and still can't find the issue. Similar to the previously linked question, I discover that the code appears to be the most recent. I have also manually deleted the code from webapps folder, then redeployed from the DevOps pipeline, with no luck. I'm trying to discover what the Azure Eclipse does differently in deployment that I'm missing in my DevOps pipeline. Is Tomcat caching content? If so, is there a way to automate a clear cache using Azure Pipelines' UI?
  
  **Tags:** azure-devops, azure, azure-pipelines, java, tomcat
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-07-13. Score: 0 | Accepted answer
  
  I discovered two issues that hindered the pipeline deploying properly.
  
  First, it appears that the Azure plugin for Eclipse creates an app.war file in the wwwroot folder of the app. Azure, apparently, prioritizes picking up this war, instead of any that might be in wwwroot/webapps.
  
  Previously I had manually deleted app.war, but then the app would just 404. This leads to the second issue. I was attempting to deploy using the default package name "...SNAPSHOT"; however, Tomcat looks for ROOT.war. I added the following lines to my pom.xml.
  
  ```
  <build>
         <finalName>ROOT</finalName>
  </build>
  
  ```
  
  This delivered the appropriately named file, which the "Azure App Service deploy" task places in wwwroot/webapps (where Tomcat looks for it). I then deleted the app.war file and any leftover ...SNAPSHOT folders in webapps, and restarted the app. It booted up with the war from the pipeline, as intended.
  
  I will not be using the Azure plugin for Eclipse any longer, as it appears incompatible with Azure DevOps pipelines.
  
  
  ---
  
  