question

BoopathyElango-7282 avatar image
0 Votes"
BoopathyElango-7282 asked ·

Azure App service deployment [WAR package]

Hi

I have a Web application (WAR distribution) which has been deployed into Tomcat server. Now we're migrating the web application to Azure using App service.
We have chosen an option of Java 8 and Tomcat 8.5 as platform. Subsequently we have selected the source from Github and Github action for deploying source code.

Unfortunately we are getting error in Github actions under portal. It says No package found with specified pattern.
is it only jar supported ?

Attached for your more reference.

8732-capture.jpg


azure-webapps
capture.jpg (90.8 KiB)
· 2
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

When deploying Java apps, make sure you specify the package name relative from the root directory. Most likely, your deployment artifact will be in the target/ directory.

on: push

jobs:
java-build-and-deploy:
runs-on: ubuntu-latest
steps:

 - uses: actions/checkout@master

 - name: Set up JDK 1.8
   uses: actions/setup-java@v1
   with:
     java-version: 1.8

 # install dependencies, build, and test
 - name: Maven build phase
   run: |
     mvn clean package

 - uses: azure/webapps-deploy@v1
   with:
     app-name: <your-app-name>
     publish-profile: ${
                    { secrets.<publish-profile> }}
     package: target/app.war  # Can also be a jar

Fore more info:
https://azure.github.io/AppService/2019/08/10/Github-actions-for-webapps.html#java

0 Votes 0 ·

@JoaquinVano ,

Thank you so much for your help. Now I can deploy the apps successfully in Azure App services.

Thanks,
Elango Boopathy.

0 Votes 0 ·

1 Answer

ManuPhilip avatar image
0 Votes"
ManuPhilip answered ·

Hello @BoopathyElango-7282,

I think, you need to check 'azure-pipelines.yml' file and edit it. Add one more task at the very end as :
- task: PublishBuildArtifacts@1

https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/publish-build-artifacts?view=azure-devops



Please mark as "Accept the answer" if the above steps helps you. Others with similar issues can also follow the solution as per your suggestion

Regards,

Manu

· 6 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ManuPhilip ,

I have the attached pipeline configuration which was created by Github actions automatically by App services for application deployment.
Not sure where I have to include the steps which has been pointed out .

Could you please specify where i should place the task in this attached file. please assist.

Thanks.8628-master-sparkjava.txt


0 Votes 0 ·
ManuPhilip avatar image ManuPhilip BoopathyElango-7282 ·

Please try adding one more task as follows at the very end:

  • task: PublishBuildArtifacts@1

Regards,
Manu

0 Votes 0 ·

@ManuPhilip

If I try to add the line at end , i am getting Bad indentation of sequence entity. Might be some syntax issue, but not able to fix it.
attached the same for your reference. Please have a look on red highlighted area in snap attached.

8629-capture-2.jpg


0 Votes 0 ·
capture-2.jpg (105.3 KiB)
Show more comments