0

I am trying to deploy via ARM Template an existing .war compiled java application (jhipster), into my azure webapp. I managed to deploy the .war file manually, without ARM template and everything it is working just fine, but it has been a lot of struggle 'till now and I did not manage to get it working via ARM template.

For a short background of my manual .war deploy: I followed the answer from here: Can I deploy a jhipster 5.0.0-beta.0 application in azure?

This question was asked by my work colleague, and the answer from @Peter Pan was just great! Now I am trying to make a deploy script which can deploy my entire solution with all its services.

Beside the .war file, which must be deployed in wwwroot, I actually need to deploy the web.config as well (described in the link above), in the same folder as the .war file, both in wwwroot. I don't know how can I do this, and also my current webapp deployment code is not copying my .war file in the webapp host. The deploy succeeds but its just an empty default webapp and the .war file does not exist on the file browser / FTP of the webapp.

This is the JSON describing my webapp:

    {
        "type": "Microsoft.Web/sites",
        "apiVersion": "2016-08-01",
        "name": "[variables('webAppName')]",
        "location": "West Europe",
        "dependsOn": [
            "[resourceId('Microsoft.Web/serverfarms', variables('serverfarms'))]"
        ],
        "kind": "app",
        "properties": {
            "enabled": true,
            "hostNameSslStates": [
                {
                    "name": "[concat(variables('webAppName'), '.azurewebsites.net')]",
                    "sslState": "Disabled",
                    "hostType": "Standard"
                },
                {
                    "name": "[concat(variables('webAppName'), '.scm.azurewebsites.net')]",
                    "sslState": "Disabled",
                    "hostType": "Repository"
                }
            ],
            "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('serverfarms'))]",
            "reserved": false,
            "scmSiteAlsoStopped": false,
            "clientAffinityEnabled": true,
            "clientCertEnabled": false,
            "hostNamesDisabled": false,
            "containerSize": 0,
            "dailyMemoryTimeQuota": 0,
            "httpsOnly": false,
            "resources": [
                {
                    "apiVersion": "2014-06-01",
                    "name": "MSDeploy",
                    "type": "Extensions",
                    "dependsOn": [
                        "[concat('Microsoft.Web/Sites/', variables('webAppName'))]",
                        "[concat('Microsoft.Web/Sites/', variables('webAppName'), '/config/web')]"
                    ],
                    "properties": {
                      "packageUri": "[variables('pathToWarFile')]"
                    }
                }
            ]
        }

Any help would be so much appreciated. Thank you!

  • Have you checked out https://www.jhipster.tech/azure/ ? I don't use Azure so I'm not sure if that is what you are looking for – Jon Ruddell Jul 18 '19 at 16:31
  • Thanks for your answer @JonRuddell, but that link does not help me. Azure Resource Manager templates reffer to automatically deploying azure resources via deploy scripts. I need to deploy a .war via this deploy scripts. The link from jhipster describes a way to manually deploy the application onto azure. – Justinian Taga Jul 22 '19 at 06:03

1 Answers1

0

Take a look at this template: https://github.com/Azure/azure-quickstart-templates/blob/master/201-web-app-github-deploy/azuredeploy.json

What you need its to tell the application from witch repository to pull de application files. For this you can use GitHub, Azure DevOps or any other repository. In case that the repository its secured , more settings are required.

Other solution its to deploy the template using AzureDev Ops and when the teplate its deployed to release your application.

  • Create a release pipeline.
  • Deploy in step one the template
  • When the template its done, in step 2 release the application.

I hope this helps