Skip to content

Azure Web App: Deploy

Andy Xu(devdiv) edited this page Jul 12, 2021 · 3 revisions

azure-webapp:deploy

  • Deploy artifacts or docker container image to an Azure Web App based on your configuration.
    If the specified Web App does not exist, it will be created.

  • Configuration: Common configurations of all Maven Plugins for Azure can be found here.

    Property Required Description Version
    <resourceGroup> true Azure Resource Group for your Web App. 0.1.0+
    <appName> true The name of your Web App. 0.1.0+
    <region> false Specifies the region where your Web App will be hosted; the default value is westeurope. All valid regions at Supported Regions section. 0.1.0+
    <pricingTier> false The pricing tier for your Web App. The default value is P1V2. 0.1.0+
    <deploymentSlot> false The deployment slot to deploy your application. You could find detail samples for deployment slot at here. 1.3.0+
    <appServicePlanResourceGroup> false The resource group of the existing App Service Plan. If not specified, the value defined in <resourceGroup> will be used by default. 1.0.0+
    <appServicePlanName> false The name of the existing App Service Plan. 1.0.0+
    <appSettings> false Specifies the application settings for your Web App. You could find detail samples for appsettings at here. 0.1.0+
    <stopAppDuringDeployment> false To stop the target Web App or not during deployment. This will prevent deployment failure caused by IIS locking files. 0.1.4+
    <runtime> true The runtime environment configuration, you could see the detail here. 0.1.0+
    <deployment> true The deployment configuration, you could see the details here. 0.1.0+
  • Runtime settings

    Supported <os> values are Linux, Windows and Docker.

    The runtime settings of v2 configuration could be omitted if users specify an existing Web App in the configuration and just want to do the deployment directly.

    <configuration>        
        <runtime>
            <os>Linux</os>
            <javaVersion>Java 8</javaVersion>
            <webContainer>Java SE</webContainer>
        </runtime>        
    </configuration>
    <configuration>
        <runtime>
            <os>Docker</os>
            <!-- only image is required -->
            <image>[hub-user/]repo-name[:tag]</image>
            <serverId></serverId>
            <registryUrl></registryUrl>
        </runtime>
    </configuration>
  • Deployment settings

    Configure the resources to deploy to the Web App.

    It will use the zip deploy for fast and easy deploy. But if the artifact(s) are war package(s), war deploy will be used. Mix deploying war packages and other kinds of artifacts is not suggested and will cause errors.

    <configuration>
        ...
        <deployment>
         <resources>
          <resource>
            <directory>${project.basedir}/target</directory>
            <includes>
               <include>*.jar</include>
            </includes>            
          </resource>
         </resources>
        </deployment>
    </configuration>
Clone this wiki locally