{"id":228285,"date":"2021-09-22T11:00:35","date_gmt":"2021-09-22T18:00:35","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/java\/?p=228285"},"modified":"2021-09-22T08:21:52","modified_gmt":"2021-09-22T15:21:52","slug":"gradle-deploy-java-web-apps-to-azure-in-one-step","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/gradle-deploy-java-web-apps-to-azure-in-one-step\/","title":{"rendered":"Gradle\u00a0 &#8211; Deploy Java web apps to Azure in one step!"},"content":{"rendered":"<p>We are excited to announce a new Gradle plugin for Azure Web Apps. Many Java on Azure developers use Gradle because of its customizable features and other advantages. With this new Gradle plugin, these developers can continue their Gradle journey and deploy Java Web apps to Azure in one single step.<\/p>\n<pre class=\"prettyprint\">gradle azureWebAppDeploy<\/pre>\n<p>Like Maven plugins for Azure services, the new Gradle plugin is:<\/p>\n<ul>\n<li><strong>Simple to use:<\/strong> get infrastructure as code by defining everything in your &#8220;build.gradle&#8221;<span style=\"font-size: 1rem;\"> and applying changes to Azure with a single deploy task.<\/span><\/li>\n<li><strong>Platform agnostic with zero set-up time:<\/strong> regardless Win, Linux, or Mac, declaring this plugin in your &#8220;build.gradle&#8221; will install it immediately.<\/li>\n<li><strong>Flexible with authentication:<\/strong> use Azure CLI, OAuth or Service Principal to authenticate with Azure.<\/li>\n<li><strong>CI\/CD friendly:<\/strong> embed the plugin and task in your DevOps automation platform and tools like Azure Pipelines, Jenkins, or GitHub Actions.<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><iframe src=\"\/\/www.youtube.com\/embed\/wlI6JO100q0\" width=\"560\" height=\"314\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>The new plugin saves developers time by reducing a complex process to just one step. Try out with these simple instructions.<\/p>\n<h2>Try it now!<\/h2>\n<ol>\n<li>Add Gradle plugin for Azure Web App to your &#8220;build.gradle&#8221; file:\n<pre class=\"prettyprint\">plugins {\r\n    id \"com.microsoft.azure.azurewebapp\" version \"1.1.0\"\r\n}     \r\n<\/pre>\n<\/li>\n<li>Configure this plugin in the &#8220;build.gradle&#8221; file or &#8220;gradle.properties&#8221;:\n<pre class=\"prettyprint\">azurewebapp {\r\n    subscription = '&lt;your subscription id&gt;'\r\n    resourceGroup = '&lt;your resource group&gt;'\r\n    appName = '&lt;your app name&gt;'\r\n    pricingTier = 'P1v2' \r\n    region = 'westus' \r\n    runtime {\r\n        os = 'Linux' \r\n        webContainer = 'Tomcat 9.0'\r\n        javaVersion = 'Java 8'\r\n    }\r\n}<\/pre>\n<p>You can customize the task \u2013 for example, you can specify the App Service pricing tier, runtime stack, application settings, Azure regions, etc.<\/li>\n<li>Deploy the app:\n<pre class=\"prettyprint\">gradle azureWebAppDeploy<\/pre>\n<p>Once deployment has completed, your application will be ready at: <strong style=\"font-size: 1rem;\">&lt;your app name&gt;.azurewebsites.net\n<\/strong><\/li>\n<\/ol>\n<p><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/docs.microsoft.com\/azure\/app-service\/configure-language-java?pivots=platform-linux#gradle\" target=\"_blank\">Deploy Java Web app using Gradle<\/a><\/div><\/p>\n<h2>Resources and feedback<\/h2>\n<ul>\n<li>Learn more about advanced <a href=\"https:\/\/github.com\/microsoft\/azure-gradle-plugins\/wiki\/Webapp-Configuration\">configurations<\/a>.<\/li>\n<li>Check out other <a href=\"https:\/\/docs.microsoft.com\/azure\/developer\/java\/#tools\">Azure tools for Java developers<\/a> with IntelliJ, Eclipse, VS Code, Maven, etc.<\/li>\n<li>Report bugs or request new features on <a href=\"https:\/\/github.com\/microsoft\/azure-gradle-plugins\/issues\">GitHub<\/a>.<\/li>\n<li>Ask questions on\u00a0<a href=\"https:\/\/stackoverflow.com\/questions\/tagged\/azure-java-tools\">Stack Overflow with tag [azure-java-tools]<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We are excited to announce a new Gradle plugin for Azure Web Apps. This plugin lets Java developers deploy Gradle projects to Azure Web Apps in one step, without installing any Azure specific tools.<\/p>\n","protected":false},"author":14943,"featured_media":227205,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,1,17],"tags":[785,13,29,248,786],"class_list":["post-228285","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-java","category-web","tag-app-service","tag-azure","tag-gradle","tag-java","tag-web-app"],"acf":[],"blog_post_summary":"<p>We are excited to announce a new Gradle plugin for Azure Web Apps. This plugin lets Java developers deploy Gradle projects to Azure Web Apps in one step, without installing any Azure specific tools.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/228285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/users\/14943"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/comments?post=228285"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/228285\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/227205"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=228285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=228285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=228285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}