Deploying Java Maven Project in Microsoft Azure using Azure CLI

Posted on by By admin, in Java | 0

Prerequisites: Windows Command Prompt, Azure CLI, Azure Portal and Java maven project

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Grab The 30 Days Free Trail

Reference Links:

Download Azure CLI using below link

Download Azure CLI

Deploy Spring Boot Java Application with Maven Plugin

  1. After installing Azure CLI, open windows command prompt and enter az to check the installation of Azure CLI
  2. Azure CLI

  3. If it is installed, then to find your installed version run az –version command
  4. Azure CLI

  5. Sign into your Azure account by using the Azure CLI: az login. Azure portal will open in the browser and enter the credentials to access Azure portal
  6. Now go to Java maven project folder using cd foldername in command prompt
  7. To update the configuration settings like app name, app subscription, app resource group, app service plan name, app service plan resource group, location and run time settings like os and java version, then run the below command and enter the options
  8. mvn azure-webapp:config
    

    This command will update the properties in pom.xml file

    <plugin> 
            <groupId>com.microsoft.azure</groupId>  
            <artifactId>azure-webapp-maven-plugin</artifactId>  
            <version>1.8.0</version>  
            <configuration> 
              <!-- Specify v2 schema -->  
              <schemaVersion>v2</schemaVersion>  
              <!-- App information -->  
              <subscriptionId>18b78924-605f-4cb9-a064-5545687</subscriptionId>  
              <resourceGroup>Test-Resource</resourceGroup>  
              <!-- Deploy Web App to an existing Service Plan which pricing tier is not S3 -->  
              <appServicePlanResourceGroup>Test-Resource</appServicePlanResourceGroup>  
              <appServicePlanName>Test-AppServicePlan</appServicePlanName>  
              <appName>webapp-java-test</appName>  
              <region>Central US</region>  
              <!-- Java Runtime Stack for App Service on Windows-->  
              <runtime> 
                <os>windows</os>  
                <javaVersion>1.8</javaVersion>  
                <webContainer>java 8</webContainer> 
              </runtime>  
              <!-- Begin of App Settings  -->  
              <appSettings> 
                <property> 
                  <name>JAVA_OPTS</name>  
                  <value>-Dserver.port=80;DisplayMessage=Application</value> 
                </property>
              </appSettings>
              <!-- End of App Settings  -->  
              <deployment> 
                <resources> 
                  <resource> 
                    <directory>${project.basedir}/target</directory>  
                    <includes> 
                      <include>*.jar</include> 
                    </includes> 
                  </resource> 
                </resources> 
              </deployment>  
              <pricingTier>B1</pricingTier> 
            </configuration> 
          </plugin>
    
  9. Clean the project and build the new jar with the below command
  10. mvn clean package
    
  11. To deploy the application in Azure use the below command
  12. Make data easy with Helical Insight.
    Helical Insight is the world’s best open source business intelligence tool.

    Claim Your 30 Days Free Trail

    mvn azure-webapp:deploy
    
  13. After successful completion of deploying app service will be visible in the azure app

Thank You
Ramu Vudugula
BI Developer
Helical IT Solutions Pvt Ltd

logo

Best Open Source Business Intelligence Software Helical Insight Here

logo

A Business Intelligence Framework


logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments