Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

pipe "microsoft/azure-web-apps-deploy" doesn't deploy spring boot executable jar

I want to deploy my spring boot project to Azure app service. I setup the bitbucket side as per the document. I have the bitbucket-pipelines.yml step as follows.

- step:
name: deploy to Azure cloud
image: maven:3.5.2
trigger: manual
deployment: production
- mvn clean compile package
- pipe: microsoft/azure-web-apps-deploy:1.0.1
AZURE_APP_ID: xxxxxxxxxxxxxxxxxx
AZURE_PASSWORD: xxxxxxxxxxxxxxxxx
AZURE_TENANT_ID: xxxxxxxxxxxxxxxx
AZURE_RESOURCE_GROUP: 'xxxxxxxxxxxx'
AZURE_APP_NAME: 'xxxxxxxx'
ZIP_FILE: 'app.jar'

Now when I push my code to bitbucket, it sends the app.jar to azure. But it is in exploded (unzipped) version in the D:\home\site\wwwroot> directory of the azure container. So I see all my updated code in the wwwroot, but not in a jar file.  Basically the jar file is unzipped in to directories (BOOT-INF,META-INF, org etc). But my web.config is looking for the app.jar file to execute the spring boot app. This is how web.config look like.

<?xml version="1.0" encoding="UTF-8"?>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
<httpPlatform processPath="%JAVA_HOME%\bin\java.exe"
arguments=" -Dserver.port=%HTTP_PLATFORM_PORT% -jar &quot;%HOME%\site\wwwroot\app.jar&quot;">

so how can I get the app.jar file in the wwwroot directory of azure container? I can manually create the app.jar using the unzipped (exploded) folders. But it is too much manual process then. Else I should be able to modify the web.config file to run the unzipped version of my spring boot app. I really need help for this. Thank you.

1 answer

When you deploy the zip file, you’re engaging Kudu’s deploy­ment mechanism, which will add the files in the .jar to the site/wwwroot folder of your site in App Service. For more information on Kudu, see the Kudu wiki There are some resources there including contacts and some paths to follow such as You could also look at the azure-cli-run pipe to do some bespoke tasks.

Hi David, 

The problem is, it is not adding the .jar to /wwwroot folder. It is adding the unzip folders of the jar, to the /wwwroot. So my question is, are there any parameters or configuration in the bitbucket-pipelines.yml to instruct Kudu, to not to unzip the jar? Thanks for your help

Hi Shehan. I understand where you are coming from. Im no Kudu expert.. hence the link to the Kudu team.. The documentation from the web app deploy is here. there isnt anything there that seems to suggest not unpacking. Hence my thoughts on CLI or post action. Try the Kudu wiki for some ideas?  I guess you could put the jar in a zip file if thats what you need?

Hi, if you don't want to unzip the file, you may try Run From Package by setting WEBSITE_RUN_FROM_PACKAGE=1 in your Azure Web App and then do the Zip Deploy. More information can be found here: Run your Azure Functions from a package file. It also applies to Web Apps as they explain here: Announcing zipdeploy integration with Run From Package.

Hi David, 

thanks for your guide. Yes finally I put the jar file inside the zip file. It worked. But it would be great if it also works for jar file, as it is an additional step in maven to generate a zip file. but all good now :-)

Hi. Simen. Could you show me the solution in detail? I still have a problem the same as yours... 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,439 views 4 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you