1

I am trying to build an Azure DevOps pipeline to deploy a Springboot Web app with embedded Tomcat packaged as a WAR file, using an Azure Pipeline deployment task. Something like this:

          - task: AzureRmWebAppDeployment@4
            displayName: 'Azure Web App Deploy: $(studioWebAppName)'
            inputs:
              azureSubscription: $(azureSubscription)
              appType: webAppLinux
              WebAppName: $(studioWebAppName)
              package: '$(Pipeline.Workspace)/**/studio.war'
              RuntimeStack: 'JAVA|11-java11'
              StartupCommand: 'java -jar /home/site/wwwroot/studio.war --server.port=80'

However the deployment task insists on mucking about with the WAR file and unpacking ito into a JAR file and a directory containing the various resource and JSP files. The app then won't work.

I've been using a direct FTP Upload task as a workaround, but just now I've run into a problem with that task no longer working - I suspect because now the WAR file is in use.

Any suggestions for a simple solution to this? I can't be the only one with this problem.

Tim
  • 11
  • 1

1 Answers1

0

The workaround I employed, in case this helps someone else, was:

      - task: AzureCLI@2
        displayName: Azure CLI Deploy
        inputs:
          azureSubscription: $(azureSubscription)
          scriptType: pscore
          scriptLocation: inlineScript
          inlineScript: az webapp deploy --name $(studioWebAppName) --type static --src-path $(Pipeline.Workspace)/$(apppath)/build/libs/studio-1.0.war --target-path /home/site/wwwroot/studio.war --resource-group $(myrg)
      - task: AzureAppServiceManage@0
        inputs:
          azureSubscription: $(azureSubscription)
          action:  Restart Azure App Service
          WebAppName: $(studioWebAppName)

i.e. deploy the war file as a static asset, then force a restart. Would still welcome a better answer.

Tim
  • 11
  • 1