title: Unable to deploy Azure Function in Java onto Azure cloud
body: <p>I have been trying to deploy an Azure function I developed in Java and built using Maven. But running the command <code>mvn azure-functions:deploy</code> does not work. Even though I have configured proxies on my system, it fails to get deployed and ends with the error below.</p>
  <p>Some other points:</p>
  <ol>
  <li>It's a free account</li>
  <li>Commands like <code>mvn azure-functions:package</code> and <code>azure-functions:run</code> are successful</li>
  </ol>
  <p><code>Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.4.1:deploy (default-cli) on project satya: java.net.UnknownHostException: No such host is known (management.azure.com)</code></p>
  <p>I am not sure where I am going wrong.</p>
  <p><strong>Updating with POM.XML</strong></p>
  
  
      4.0.0
  <pre><code>&lt;groupId&gt;az.xz.as&lt;/groupId&gt;
  &lt;artifactId&gt;satya&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  
  &lt;name&gt;Azure Java Functions&lt;/name&gt;
  
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
      &lt;azure.functions.maven.plugin.version&gt;1.4.1&lt;/azure.functions.maven.plugin.version&gt;
      &lt;azure.functions.java.library.version&gt;1.3.1&lt;/azure.functions.java.library.version&gt;
      &lt;functionAppName&gt;satya-29042020&lt;/functionAppName&gt;
      &lt;stagingDirectory&gt;${project.build.directory}/azure-functions/${functionAppName}&lt;/stagingDirectory&gt;
  &lt;/properties&gt;
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;maven.snapshots&lt;/id&gt;
          &lt;name&gt;Maven Central Snapshot Repository&lt;/name&gt;
          &lt;url&gt;https://oss.sonatype.org/content/repositories/snapshots/&lt;/url&gt;
          &lt;releases&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;maven.snapshots&lt;/id&gt;
          &lt;name&gt;Maven Central Snapshot Repository&lt;/name&gt;
          &lt;url&gt;https://oss.sonatype.org/content/repositories/snapshots/&lt;/url&gt;
          &lt;releases&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  
  &lt;dependencyManagement&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter&lt;/artifactId&gt;
              &lt;version&gt;5.4.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mockito&lt;/groupId&gt;
              &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
              &lt;version&gt;2.23.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.microsoft.azure.functions&lt;/groupId&gt;
              &lt;artifactId&gt;azure-functions-java-library&lt;/artifactId&gt;
              &lt;version&gt;${azure.functions.java.library.version}&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/dependencyManagement&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.microsoft.azure.functions&lt;/groupId&gt;
          &lt;artifactId&gt;azure-functions-java-library&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;com.microsoft.sqlserver&lt;/groupId&gt;
        &lt;artifactId&gt;mssql-jdbc&lt;/artifactId&gt;
        &lt;version&gt;6.2.2.jre8&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- Test --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
          &lt;artifactId&gt;junit-jupiter&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.mockito&lt;/groupId&gt;
          &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;pluginManagement&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;com.microsoft.azure&lt;/groupId&gt;
                  &lt;artifactId&gt;azure-functions-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${azure.functions.maven.plugin.version}&lt;/version&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1.0&lt;/version&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1.1&lt;/version&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1.0&lt;/version&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
  
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;com.microsoft.azure&lt;/groupId&gt;
              &lt;artifactId&gt;azure-functions-maven-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;!-- function app name --&gt;
                  &lt;appName&gt;${functionAppName}&lt;/appName&gt;
                  &lt;!-- function app resource group --&gt;
                  &lt;resourceGroup&gt;vfs_data_lake_demo&lt;/resourceGroup&gt;
                  &lt;!-- function app service plan name --&gt;
                  &lt;appServicePlanName&gt;ASP-vfsdatalakedemo-b909&lt;/appServicePlanName&gt;
                  &lt;!-- function app region--&gt;
                  &lt;!-- refers https://github.com/microsoft/azure-maven-plugins/tree/develop/azure-functions-maven-plugin#supported-regions for all valid values --&gt;
                  &lt;region&gt;eastus2&lt;/region&gt;
                  &lt;!-- function pricingTier, default to be consumption if not specified --&gt;
                  &lt;!-- refers https://github.com/microsoft/azure-maven-plugins/tree/develop/azure-functions-maven-plugin#supported-pricing-tiers for all valid values --&gt;
                  &lt;!-- &lt;pricingTier&gt;&lt;/pricingTier&gt; --&gt;
                  &lt;runtime&gt;
                      &lt;!-- runtime os, could be windows, linux or docker--&gt;
                      &lt;os&gt;windows&lt;/os&gt;
                      &lt;!-- for docker function, please set the following parameters --&gt;
                      &lt;!-- &lt;image&gt;[hub-user/]repo-name[:tag]&lt;/image&gt; --&gt;
                      &lt;!-- &lt;serverId&gt;&lt;/serverId&gt; --&gt;
                      &lt;!-- &lt;registryUrl&gt;&lt;/registryUrl&gt;  --&gt;
                  &lt;/runtime&gt;
                  &lt;appSettings&gt;
                      &lt;property&gt;
                          &lt;name&gt;FUNCTIONS_EXTENSION_VERSION&lt;/name&gt;
                          &lt;value&gt;~3&lt;/value&gt;
                      &lt;/property&gt;                        
                  &lt;/appSettings&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;package-functions&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;package&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;copy-resources&lt;/id&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;copy-resources&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;overwrite&gt;true&lt;/overwrite&gt;
                          &lt;outputDirectory&gt;${stagingDirectory}&lt;/outputDirectory&gt;
                          &lt;resources&gt;
                              &lt;resource&gt;
                                  &lt;directory&gt;${project.basedir}&lt;/directory&gt;
                                  &lt;includes&gt;
                                      &lt;include&gt;host.json&lt;/include&gt;
                                      &lt;include&gt;local.settings.json&lt;/include&gt;
                                  &lt;/includes&gt;
                              &lt;/resource&gt;
                          &lt;/resources&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;copy-dependencies&lt;/id&gt;
                      &lt;phase&gt;prepare-package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;copy-dependencies&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;outputDirectory&gt;${stagingDirectory}/lib&lt;/outputDirectory&gt;
                          &lt;overWriteReleases&gt;false&lt;/overWriteReleases&gt;
                          &lt;overWriteSnapshots&gt;false&lt;/overWriteSnapshots&gt;
                          &lt;overWriteIfNewer&gt;true&lt;/overWriteIfNewer&gt;
                          &lt;includeScope&gt;runtime&lt;/includeScope&gt;
                          &lt;excludeArtifactIds&gt;azure-functions-java-library&lt;/excludeArtifactIds&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
          &lt;!--Remove obj folder generated by .NET SDK in maven clean--&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.1.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;filesets&gt;
                      &lt;fileset&gt;
                          &lt;directory&gt;obj&lt;/directory&gt;
                      &lt;/fileset&gt;
                  &lt;/filesets&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>