{"id":12551,"date":"2022-11-02T15:07:35","date_gmt":"2022-11-02T22:07:35","guid":{"rendered":"https:\/\/threecloud.wpengine.com\/?p=12551"},"modified":"2023-06-05T14:17:46","modified_gmt":"2023-06-05T21:17:46","slug":"migrating-jboss-applications-to-azure-app-service","status":"publish","type":"post","link":"https:\/\/3cloudsolutions.com\/resources\/migrating-jboss-applications-to-azure-app-service\/","title":{"rendered":"Migrating JBOSS Applications to Azure App Service"},"content":{"rendered":"<h5><strong>Synopsis<\/strong><\/h5>\n<p>The following information was discovered while helping a customer migrate JBoss applications from internal on-premises virtual machines to Azure.<\/p>\n<p>This article will discuss differences and adaptations necessary to migrate JBOSS applications to Azure App Service. This includes the configuration of App Service, custom standalone.xml, and useful development tools.<\/p>\n<h5>Initial App Service Configuration<\/h5>\n<p>Azure supports JBOSS on Premium 3. The resource requirements necessary determine the tier level. Determination of increased resource requirements will be discussed later in this article.<\/p>\n<p>First, navigate to the App Service that you would like to configure, select Configurations under settings, select General settings, and change the stack to the appropriate versions of Java and JBOSS.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-12552 aligncenter\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-143552.png\" alt=\"\" width=\"575\" height=\"475\" srcset=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-143552.png 1127w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-143552-300x248.png 300w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-143552-1024x845.png 1024w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-143552-768x634.png 768w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-143552-600x495.png 600w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-143552-992x819.png 992w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-143552-727x600.png 727w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-143552-60x50.png 60w\" sizes=\"auto, (max-width: 575px) 100vw, 575px\" \/><\/p>\n<p>Startup Command can be used to customize the JBOSS implementation. Place a script within the \u2018\/home\/\u2019 directory. The following is the recommended location:<\/p>\n<p>\u201c\/home\/site\/deployment\/tools\/startup.sh\u201d<\/p>\n<p>Place the file path within the Startup Command location. Note: All directories outside of \u2018\/home\/\u2019 do not persist upon restart.<\/p>\n<p>Place the following command in the startup.sh file:<\/p>\n<p>$JBOSS_HOME\/bin\/jboss-cli.sh &#8211;connect &#8211;file=\/home\/site\/deployments\/tools\/jboss-cli-commands.cli<\/p>\n<p>The \u201cConfiguration of Custom standalone.xml File\u201d will go over how to generate the custom environment.<\/p>\n<h5>Configuration of Custom standalone.xml File<\/h5>\n<p>The standalone.xml is the entry point to the custom JBOSS <a href=\"https:\/\/3cloudsolutions.com\/app-experience\/\">application experience<\/a>. The following link is from the official docs of JBOSS and listed below are some useful commands that assisted in migrating JBOSS applications.<\/p>\n<p><a href=\"https:\/\/docs.jboss.org\/author\/display\/WFLY\/Command%20Line%20Interface.html\">https:\/\/docs.jboss.org\/author\/display\/WFLY\/Command%20Line%20Interface.html<\/a><\/p>\n<p><strong><em>Adding Modules<\/em><\/strong><\/p>\n<p>Under site &gt; deployments &gt; tools directory:<\/p>\n<ul>\n<li>Add necessary modules to a module folder<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-12553 aligncenter\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-144155.png\" alt=\"\" width=\"322\" height=\"186\" srcset=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-144155.png 575w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-144155-300x173.png 300w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-144155-60x35.png 60w\" sizes=\"auto, (max-width: 322px) 100vw, 322px\" \/><\/p>\n<ul>\n<li>Add the following command to the jboss-cli-commands.cli\n<ul>\n<li>If jboss-cli-commands.cli does not exist, create a new file with the appropriate name<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>module add &#8211;name=&lt;name of module&gt; &#8211;resources=&lt;location of jar within the \u2018home\u2019 directory&gt; &#8211;module-xml=&lt;location of xml relative to \u2018home directory&gt;<\/p>\n<p><em><strong>Adding System Properties<\/strong><\/em><\/p>\n<ul>\n<li>Add the following command to the jboss-cli-commands.cli to add system properties\n<ul>\n<li>If jboss-cli-commands.cli does not exist, create a new file with the appropriate name<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\/system-property=&lt;Name of Property&gt;:add(value=&#8221;&lt;Value of Property&gt; &#8220;)<\/p>\n<p><em><strong>Adding Data Source<\/strong><\/em><\/p>\n<ul>\n<li>Add the following command to the jboss-cli-commands.cli to add system properties\n<ul>\n<li>If jboss-cli-commands.cli does not exist, create a new file with the appropriate name<\/li>\n<\/ul>\n<\/li>\n<li>Add the jdbc-driver DataSource using the instructions listed above<\/li>\n<\/ul>\n<p>\/subsystem=datasources\/jdbc-driver=&lt;driver name&gt;:add(driver-name=&lt;driver name&gt;,driver-module-name=&lt;driver module name&gt;)<\/p>\n<ul>\n<li>Add the DataSource by inserting the following command into the jboss-cli-commands.cli file<\/li>\n<\/ul>\n<p>data-source add &#8211;name=&lt;name of datasource&gt; &#8211;jndi-name=java:jboss\/datasources\/&lt;name of datasource&gt; &#8211;driver-name=&lt;driver url&gt; &#8211;connection-url=&lt;connection url&gt;;user=&lt;user&gt;;password=&lt;password&gt;;databaseName=&lt;dbname&gt;<\/p>\n<h5>Debugging Tool to Assist in Migration<\/h5>\n<p><em><strong>Application Insights<\/strong><\/em><\/p>\n<p>Select Applications under Settings within the App Service.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12554 aligncenter\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-144921.png\" alt=\"\" width=\"305\" height=\"202\" srcset=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-144921.png 490w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-144921-300x199.png 300w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-144921-60x40.png 60w\" sizes=\"auto, (max-width: 305px) 100vw, 305px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Select Turn on Application Insights Button. Go to the app configuration section and make sure the APPLICATIONINSIGHTS_CONNECTION_STRING is set to the instrumentionKey defined on the app insights resource created.<\/p>\n<p>We need to point to the application insights process agent in the JAVA_OPTS jvm arguments.<\/p>\n<p>See linked Microsoft article for more information.<\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/azure-monitor\/app\/java-in-process-agent\">https:\/\/learn.microsoft.com\/en-us\/azure\/azure-monitor\/app\/java-in-process-agent<\/a><\/p>\n<p>Application insights will give application metrics that can assist in identifying potential problems.<\/p>\n<p><em><strong>Azure Diagnostic Tool<\/strong><\/em><\/p>\n<p>Select Diagnose and solve problems within the App Service.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12555 aligncenter\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-145106.png\" alt=\"\" width=\"324\" height=\"233\" srcset=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-145106.png 557w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-145106-300x215.png 300w, https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-02-145106-60x43.png 60w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Azure\u2019s diagnostic tools show suggestions and potential improvements for performance. This area can assist in deciding whether to re-evaluate the current tier level for the resources being utilized.<\/p>\n<p><em><strong>Notes and Conclusion<\/strong><\/em><\/p>\n<p>As a summary of this article,<\/p>\n<ul>\n<li>Create appropriate resources with the configurations included<\/li>\n<li>Deploy application to the resource<\/li>\n<li>Change appropriate files for a custom JBOSS application<\/li>\n<li>Use various Azure related tools to debug<\/li>\n<\/ul>\n<p>It was found that you cannot inject a properties file when running a \u201cstandalone.sh -p\u201d command. In place of this, the jboss-cli-commands.cli must be leveraged to create the appropriate environment.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Synopsis The following information was discovered while helping a customer migrate JBoss applications from internal&mldr;<\/p>\n","protected":false},"author":95,"featured_media":12556,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[290,291,295],"tags":[314,313],"class_list":["post-12551","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud-platform","category-cloud-roadmap","category-migration","tag-app","tag-jboss","topics-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/12551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/users\/95"}],"replies":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/comments?post=12551"}],"version-history":[{"count":0,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/12551\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media\/12556"}],"wp:attachment":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media?parent=12551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/categories?post=12551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/tags?post=12551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}