Skip to content
Andy Xu(devdiv) edited this page Jan 27, 2021 · 12 revisions

Proxy

All the Azure Maven/Gradle plugins now supports http proxy, if your network requires proxy, you may need to enable it by:

  1. System Proxy
  2. Maven Command Line Arguments
  3. Auth Configuration

System Proxy

The most convenient way to configure proxy is to configure system proxy, if you are using Window 10, you can configure system proxy by:

  1. Press # to show startup menu, type settings and click on the system settings button.
  2. In System Settings page, search proxy and click the 'Proxy settings' button.
  3. Input the proper host name and port and click the save button.
  4. Execute the maven or gradle tasks by adding maven gradle command-line argument:-Djava.net.useSystemProxies=true, you need to change your auth configuration.

image

Note: Only gradle plugins require you to add command argument:-Djava.net.useSystemProxies=true

Maven Command Line Arguments

Execute your maven commands with proxy arguments, eg:-DhttpProxyHost=localhost -DhttpProxyPort=8888, please replace the host and port with your proxy.

Auth Configuration

Add the proxy in your configuration, see the two sample configurations in pom.xml and build.gradle.

Sample configuration for Maven Webapp plugin

<plugin>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-webapp-maven-plugin</artifactId>
    <version>1.13.0</version>
    <configuration>
        <httpProxyHost>localhost</httpProxyHost>
        <httpProxyPort>8888</httpProxyPort>
        <!-- other configurations -->
    </configuration>
</plugin>

Sample configuration for azure functions gradle plugin

azurefunctions {
    httpProxyHost = 'localhost'
    httpProxyPort = 8888
    // ... other configurations
}
Clone this wiki locally