简体   繁体   中英

Can I Pass MSDeploy Parameters to Azure Web App MSDeploy Extension?

There is an MSDeploy extension available for Azure Web Apps; this can be used with Azure Resource Manager (ARM) Templates as well ( example ). I'd like to pass additional command-line arguments to MSDeploy, such as -enableRule:AppOffline ( example ).

Is there documentation for the MSDeploy Web App extension for passing additional arguments, etc.?

Support was recently added to the MSDeploy section of ARM Templates adding appOffline support.

(...)
"resources": [
    {
        "apiVersion": "2016-03-01",
        "name": "MSDeploy",
        "type": "Extensions",
        "dependsOn": [
            "[concat('Microsoft.Web/Sites/', parameters('appName'))]"
        ],
        "properties": {
            "packageUri": "https://mystorageblob.blob.core.windows.net/package/my_webdeploy_package.zip",
            "dbType": "None",
            "connectionString": "",
            "AppOffline": true,
            "SkipAppData": true,
            "setParameters": {
                "IIS Web Application Name": "[parameters('appName')]"
            }
        }
    }
],
(...)

It is actually supported, but there are some things you need to know.

  • when you only update the parameters, the changes aren't pushed through. You'll need to touch the web.config. Msdeploy doesn't see this as a change.
  • it doesn't support configSource in web.config, you'll need to patch each file separately.

parameters.xml

<parameters> <parameter name="SmtpHost" defaultValue="" tags="" > <parameterEntry kind="XmlFile" scope="Web.config" match="/configuration/system.net/mailSettings/smtp/network/@host" /> </parameter> </parameters>

arm-template { "name": "MSDeploy", "type": "extensions", "location": "[resourceGroup().location]", "apiVersion": "2015-08-01", "dependsOn": [ "[resourceId('Microsoft.Web/sites', parameters('siteName'))]" ], "properties": { "packageUri": "[concat(parameters('_artifactsLocation'), '/', parameters('folder'), '/', parameters('filename'), parameters('_artifactsLocationSasToken'))]", "dbType": "None", "setParameters": { "IIS Web Application Name": "[parameters('cmsSiteName')]", "SmtpHost": "[parameters('smtpHost')]" } } }

https://social.msdn.microsoft.com/Forums/azure/en-US/3a07e809-d452-463a-b1bf-d84d48415302/azure-resource-manager-msdeploy-extension-parameters?forum=windowsazurewebsitespreview

Based on the latest schema definition for Azure Web App MSDeploy extension as below, it does not support the passing of MSDeploy command line switches or flags as parameters.

http://schema.management.azure.com/schemas/2015-08-01/Microsoft.Web.json#/resourceDefinitions/sitesextensions

You can refer to the link below for passing parameters for ARM Web App MSDeploy extension as below.

Documentation link for MSDeploy Web App extension passing parameters

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM