Desired State Configuration 扩展与 Azure 资源管理器模板Desired State Configuration extension with Azure Resource Manager templates

本文介绍 Desired State Configuration (DSC) 扩展处理程序的 Azure 资源管理器模板。This article describes the Azure Resource Manager template for the Desired State Configuration (DSC) extension handler. 许多示例使用 RegistrationURL(以字符串形式提供)和 RegistrationKey(以 PSCredential 形式提供)来通过 Azure 自动化进行加入。Many of the examples use RegistrationURL (provided as a String) and RegistrationKey (provided as a PSCredential to onboard with Azure Automation. 有关获取这些值的详细信息,请参阅登记由 Azure 自动化状态配置管理的计算机 - 安全注册For details about obtaining those values, see Onboarding machines for management by Azure Automation State Configuration - Secure registration.

备注

你可能会遇到略有不同的架构示例。You might encounter slightly different schema examples. 2016 年 10 月发行版中发生了架构更改。The change in schema occurred in the October 2016 release. 有关详细信息,请参阅从以前的格式更新For details, see Update from a previous format.

Windows VM 模板示例Template example for a Windows VM

将以下代码片段放入模板的 Resource 节。The following snippet goes in the Resource section of the template. DSC 扩展继承默认扩展属性。The DSC extension inherits default extension properties. 有关详细信息,请参阅 VirtualMachineExtension 类For more information, see VirtualMachineExtension class.

{
  "type": "Microsoft.Compute/virtualMachines/extensions",
  "name": "Microsoft.Powershell.DSC",
  "apiVersion": "2018-06-30",
  "location": "[parameters('location')]",
  "dependsOn": [
    "[concat('Microsoft.Compute/virtualMachines/', parameters('VMName'))]"
  ],
  "properties": {
    "publisher": "Microsoft.Powershell",
    "type": "DSC",
    "typeHandlerVersion": "2.77",
    "autoUpgradeMinorVersion": true,
    "protectedSettings": {
      "Items": {
        "registrationKeyPrivate": "[listKeys(resourceId('Microsoft.Automation/automationAccounts/', parameters('automationAccountName')), '2018-06-30').Keys[0].value]"
      }
    },
    "settings": {
      "Properties": [
        {
          "Name": "RegistrationKey",
          "Value": {
            "UserName": "PLACEHOLDER_DONOTUSE",
            "Password": "PrivateSettingsRef:registrationKeyPrivate"
          },
          "TypeName": "System.Management.Automation.PSCredential"
        },
        {
          "Name": "RegistrationUrl",
          "Value": "[reference(concat('Microsoft.Automation/automationAccounts/', parameters('automationAccountName'))).registrationUrl]",
          "TypeName": "System.String"
        },
        {
          "Name": "NodeConfigurationName",
          "Value": "[parameters('nodeConfigurationName')]",
          "TypeName": "System.String"
        }
      ]
    }
  }
}

Windows 虚拟机规模集的模板示例Template example for Windows virtual machine scale sets

虚拟机规模集节点具有 properties 节,其中包含 VirtualMachineProfile, extensionProfile 属性。A virtual machine scale set node has a properties section that has a VirtualMachineProfile, extensionProfile attribute. 在“扩展”下,添加 DSC 扩展的详细信息。Under extensions, add the details for DSC Extension.

DSC 扩展继承默认扩展属性。The DSC extension inherits default extension properties. 有关详细信息,请参阅 VirtualMachineScaleSetExtension 类For more information, see VirtualMachineScaleSetExtension class.

"extensionProfile": {
    "extensions": [
      {
        "name": "Microsoft.Powershell.DSC",
        "properties": {
          "publisher": "Microsoft.Powershell",
          "type": "DSC",
          "typeHandlerVersion": "2.77",
          "autoUpgradeMinorVersion": true,
          "protectedSettings": {
            "Items": {
              "registrationKeyPrivate": "[listKeys(resourceId('Microsoft.Automation/automationAccounts/', parameters('automationAccountName')), '2018-06-30').Keys[0].value]"
            }
          },
          "settings": {
            "Properties": [
              {
                "Name": "RegistrationKey",
                "Value": {
                  "UserName": "PLACEHOLDER_DONOTUSE",
                  "Password": "PrivateSettingsRef:registrationKeyPrivate"
                },
                "TypeName": "System.Management.Automation.PSCredential"
              },
              {
                "Name": "RegistrationUrl",
                "Value": "[reference(concat('Microsoft.Automation/automationAccounts/', parameters('automationAccountName'))).registrationUrl]",
                "TypeName": "System.String"
              },
              {
                "Name": "NodeConfigurationName",
                "Value": "[parameters('nodeConfigurationName')]",
                "TypeName": "System.String"
              }
            ]
          }
        }
      }
    ]
  }

详细设置信息Detailed settings information

在资源管理器模板 Azure DSC 扩展的 settings 节中使用以下架构。Use the following schema in the settings section of the Azure DSC extension in a Resource Manager template.

有关可用于默认配置脚本的参数列表,请参阅默认配置脚本For a list of the arguments that are available for the default configuration script, see Default configuration script.

"settings": {
    "wmfVersion": "latest",
    "configuration": {
        "url": "http://validURLToConfigLocation",
        "script": "ConfigurationScript.ps1",
        "function": "ConfigurationFunction"
    },
    "configurationArguments": {
        "argument1": "Value1",
        "argument2": "Value2"
    },
    "configurationData": {
        "url": "https://foo.psd1"
    },
    "privacy": {
        "dataCollection": "enable"
    },
    "advancedOptions": {
        "downloadMappings": {
            "customWmfLocation": "http://myWMFlocation"
        }
    }
},
"protectedSettings": {
    "configurationArguments": {
        "parameterOfTypePSCredential1": {
            "userName": "UsernameValue1",
            "password": "PasswordValue1"
        },
        "parameterOfTypePSCredential2": {
            "userName": "UsernameValue2",
            "password": "PasswordValue2"
        }
    },
    "configurationUrlSasToken": "?g!bber1sht0k3n",
    "configurationDataUrlSasToken": "?dataAcC355T0k3N"
}

详细信息Details

属性名称Property name 类型Type 说明Description
settings.wmfVersionsettings.wmfVersion 字符串string 指定应在 VM 上安装的 Windows Management Framework (WMF) 版本。Specifies the version of Windows Management Framework (WMF) that should be installed on your VM. 将此属性设置为 latest 可安装最新版本的 WMF。Setting this property to latest installs the most recent version of WMF. 目前,此属性的可能值只有“4.0”、“5.0”、“5.1”和“latest” 。Currently, the only possible values for this property are 4.0, 5.0, 5.1, and latest. 这些可能值将来可能会更新。These possible values are subject to updates. 默认值为 latestThe default value is latest.
settings.configuration.urlsettings.configuration.url 字符串string 指定要从中下载 DSC 配置 .zip 文件的 URL 位置。Specifies the URL location from which to download your DSC configuration .zip file. 如果提供的 URL 需要 SAS 令牌才能访问,请将 protectedSettings.configurationUrlSasToken 属性设置为 SAS 令牌的值。If the URL provided requires an SAS token for access, set the protectedSettings.configurationUrlSasToken property to the value of your SAS token. 如果已定义 settings.configuration.scriptsettings.configuration.function,则需要此属性。This property is required if settings.configuration.script or settings.configuration.function are defined. 如果未为这些属性指定任何值,则扩展将调用默认配置脚本设置位置配置管理器 (LCM) 元数据,并应提供参数。If no value is given for these properties, the extension calls the default configuration script to set Location Configuration Manager (LCM) metadata, and arguments should be supplied.
settings.configuration.scriptsettings.configuration.script 字符串string 指定包含 DSC 配置定义的脚本的文件名。Specifies the file name of the script that contains the definition of your DSC configuration. 此脚本必须位于从 settings.configuration.url 属性所指定的 URL 下载的 zip 文件的根文件夹中。This script must be in the root folder of the .zip file that's downloaded from the URL specified by the settings.configuration.url property. 如果已定义 settings.configuration.urlsettings.configuration.script,则需要此属性。This property is required if settings.configuration.url or settings.configuration.script are defined. 如果未为这些属性指定任何值,则扩展将调用默认配置脚本设置 LCM 元数据,并应提供参数。If no value is given for these properties, the extension calls the default configuration script to set LCM metadata, and arguments should be supplied.
settings.configuration.functionsettings.configuration.function 字符串string 指定 DSC 配置的名称。Specifies the name of your DSC configuration. 命名的配置必须包含在 settings.configuration.script 定义的脚本中。The configuration that is named must be included in the script that settings.configuration.script defines. 如果已定义 settings.configuration.urlsettings.configuration.function,则需要此属性。This property is required if settings.configuration.url or settings.configuration.function are defined. 如果未为这些属性指定任何值,则扩展将调用默认配置脚本设置 LCM 元数据,并应提供参数。If no value is given for these properties, the extension calls the default configuration script to set LCM metadata, and arguments should be supplied.
settings.configurationArgumentssettings.configurationArguments 集合Collection 定义想要传递到 DSC 配置的任何参数。Defines any parameters that you want to pass to your DSC configuration. 此属性未加密。This property is not encrypted.
settings.configurationData.urlsettings.configurationData.url 字符串string 指定 URL,将从中下载配置数据 (.pds1) 文件用作 DSC 配置的输入。Specifies the URL from which to download your configuration data (.psd1) file to use as input for your DSC configuration. 如果提供的 URL 需要 SAS 令牌才能访问,请将 protectedSettings.configurationDataUrlSasToken 属性设置为 SAS 令牌的值。If the URL provided requires an SAS token for access, set the protectedSettings.configurationDataUrlSasToken property to the value of your SAS token.
settings.privacy.dataCollectionsettings.privacy.dataCollection 字符串string 启用或禁用遥测数据收集。Enables or disables telemetry collection. 此属性的可能值只有 EnableDisable''$nullThe only possible values for this property are Enable, Disable, '', or $null. 将此属性留空或 null 可启用遥测。Leaving this property blank or null enables telemetry. 默认值为 ''The default value is ''. 有关详细信息,请参阅 Azure DSC 扩展数据集合For more information, see Azure DSC extension data collection.
settings.advancedOptions.downloadMappingssettings.advancedOptions.downloadMappings 集合Collection 定义要从中下载 WMF 的备选位置。Defines alternate locations from which to download WMF. 有关详细信息,请参阅 Azure DSC 扩展 2.8 以及如何将扩展依赖项下载内容映射到自己的位置For more information, see Azure DSC extension 2.8 and how to map downloads of the extension dependencies to your own location.
protectedSettings.configurationArgumentsprotectedSettings.configurationArguments 集合Collection 定义想要传递到 DSC 配置的任何参数。Defines any parameters that you want to pass to your DSC configuration. 此属性已加密。This property is encrypted.
protectedSettings.configurationUrlSasTokenprotectedSettings.configurationUrlSasToken 字符串string 指定用于访问 settings.configuration.url 所定义的 URL 的 SAS 令牌。Specifies the SAS token to use to access the URL that settings.configuration.url defines. 此属性已加密。This property is encrypted.
protectedSettings.configurationDataUrlSasTokenprotectedSettings.configurationDataUrlSasToken 字符串string 指定用于访问 settings.configurationData.url 所定义的 URL 的 SAS 令牌。Specifies the SAS token to use to access the URL that settings.configurationData.url defines. 此属性已加密。This property is encrypted.

默认配置脚本Default configuration script

有关以下值的详细信息,请参阅本地配置管理器基本设置For more information about the following values, see Local Configuration Manager basic settings. 使用 DSC 扩展默认配置脚本只能配置下表中列出的 LCM 属性。You can use the DSC extension default configuration script to configure only the LCM properties that are listed in the following table.

属性名称Property name 类型Type 说明Description
protectedSettings.configurationArguments.RegistrationKeyprotectedSettings.configurationArguments.RegistrationKey PSCredentialPSCredential 必需的属性。Required property. 指定节点用于注册到 Azure 自动化服务的密钥作为 PowerShell 凭据对象的密码。Specifies the key that's used for a node to register with the Azure Automation service as the password of a PowerShell credential object. 可以使用 listkeys 方法针对自动化帐户自动发现此值。This value can be automatically discovered by using the listkeys method against the Automation account. 请参阅示例See the example.
settings.configurationArguments.RegistrationUrlsettings.configurationArguments.RegistrationUrl 字符串string 必需的属性。Required property. 指定节点将尝试注册的自动化终结点的 URL。Specifies the URL of the Automation endpoint where the node attempts to register. 可以使用 reference 方法针对自动化帐户自动发现此值。This value can be automatically discovered by using the reference method against the Automation account.
settings.configurationArguments.NodeConfigurationNamesettings.configurationArguments.NodeConfigurationName 字符串string 必需的属性。Required property. 在自动化帐户中指定要分配给节点的节点配置。Specifies the node configuration in the Automation account to assign to the node.
settings.configurationArguments.ConfigurationModesettings.configurationArguments.ConfigurationMode 字符串string 指定 LCM 的模式。Specifies the mode for LCM. 有效选项包括 ApplyOnlyApplyandMonitorApplyandAutoCorrectValid options include ApplyOnly, ApplyandMonitor, and ApplyandAutoCorrect. 默认值为 ApplyandMonitorThe default value is ApplyandMonitor.
settings.configurationArguments.RefreshFrequencyMinssettings.configurationArguments.RefreshFrequencyMins uint32uint32 指定 LCM 将尝试向自动化帐户查询更新的频率。Specifies how often LCM attempts to check with the Automation account for updates. 默认值为 30Default value is 30. 最小值为 15Minimum value is 15.
settings.configurationArguments.ConfigurationModeFrequencyMinssettings.configurationArguments.ConfigurationModeFrequencyMins uint32uint32 指定 LCM 将验证当前配置的频率。Specifies how often LCM validates the current configuration. 默认值为 15Default value is 15. 最小值为 15Minimum value is 15.
settings.configurationArguments.RebootNodeIfNeededsettings.configurationArguments.RebootNodeIfNeeded booleanboolean 指定在 DSC 操作请求时是否可能会自动重新启动节点。Specifies whether a node can be automatically rebooted if a DSC operation requests it. 默认值为“false”。Default value is false.
settings.configurationArguments.ActionAfterRebootsettings.configurationArguments.ActionAfterReboot 字符串string 指定在应用配置时重新启动后会发生什么情况。Specifies what happens after a reboot when applying a configuration. 有效选项为 ContinueConfigurationStopConfigurationValid options are ContinueConfiguration and StopConfiguration. 默认值为 ContinueConfigurationDefault value is ContinueConfiguration.
settings.configurationArguments.AllowModuleOverwritesettings.configurationArguments.AllowModuleOverwrite booleanboolean 指定 LCM 是否会覆盖节点上的现有模块。Specifies whether LCM overwrites existing modules on the node. 默认值为“false”。Default value is false.

settings 与 protectedSettingssettings vs. protectedSettings

所有设置保存在 VM 上的 settings 文本文件中。All settings are saved in a settings text file on the VM. settings 下面列出的属性是公共属性。Properties listed under settings are public properties. 公共属性未在 settings 文本文件中加密。Public properties aren't encrypted in the settings text file. protectedSettings 下面列出的属性已使用证书加密,因此不会在 VM 上的 settings 文件中以明文显示。Properties listed under protectedSettings are encrypted with a certificate and are not shown in plain text in the settings file on the VM.

如果配置需要凭据,可将凭据包含在 protectedSettings 中:If the configuration needs credentials, you can include the credentials in protectedSettings:

"protectedSettings": {
    "configurationArguments": {
        "parameterOfTypePSCredential1": {
               "userName": "UsernameValue1",
               "password": "PasswordValue1"
        }
    }
}

示例配置脚本Example configuration script

以下示例演示 DSC 扩展的默认行为,其目的是为 LCM 提供元数据设置,并注册到 Automation DSC 服务。The following example shows the default behavior for the DSC extension, which is to provide metadata settings to LCM and register with the Automation DSC service. 必须指定配置参数。Configuration arguments are required. 将配置参数传递给默认配置脚本以设置 LCM 元数据。Configuration arguments are passed to the default configuration script to set LCM metadata.

"settings": {
    "configurationArguments": {
        "RegistrationUrl" : "[parameters('registrationUrl1')]",
        "NodeConfigurationName" : "nodeConfigurationNameValue1"
    }
},
"protectedSettings": {
    "configurationArguments": {
        "RegistrationKey": {
            "userName": "NOT_USED",
            "Password": "registrationKey"
        }
    }
}

在 Azure 存储中使用配置脚本的示例Example using the configuration script in Azure Storage

以下示例摘自 DSC 扩展处理程序概述The following example is from the DSC extension handler overview. 此示例使用 Resource Manager 模板而不是cmdlet 来部署该扩展。This example uses Resource Manager templates instead of cmdlets to deploy the extension. 保存 IisInstall.ps1 配置,将它放在 .zip 文件(例如 iisinstall.zip)中,并将该文件上传到可访问的 URL 中。Save the IisInstall.ps1 configuration, place it in a .zip file (example: iisinstall.zip), and then upload the file in an accessible URL. 此示例使用 Azure Blob 存储,但可以从任意位置下载 .zip 文件。This example uses Azure Blob storage, but you can download .zip files from any arbitrary location.

在资源管理器模板中,以下代码指示 VM 下载正确的文件并运行适当的 PowerShell 函数:In the Resource Manager template, the following code instructs the VM to download the correct file, and then run the appropriate PowerShell function:

"settings": {
    "configuration": {
        "url": "https://demo.blob.core.chinacloudapi.cn/iisinstall.zip",
        "script": "IisInstall.ps1",
        "function": "IISInstall"
    }
},
"protectedSettings": {
    "configurationUrlSasToken": "odLPL/U1p9lvcnp..."
}

使用引用的 Azure 自动化注册值的示例Example using referenced Azure Automation registration values

以下示例通过引用 Azure 自动化帐户属性并使用 listkeys 方法检索主键 (0) 来获取 RegistrationUrlRegistrationKeyThe following example gets the RegistrationUrl and RegistrationKey by referencing the Azure Automation account properties and using the listkeys method to retrieve the Primary Key (0). 在此示例中,参数 automationAccountNameNodeConfigName 已提供给模板。In this example, the parameters automationAccountName and NodeConfigName were provided to the template.

"settings": {
    "RegistrationUrl" : "[reference(concat('Microsoft.Automation/automationAccounts/', parameters('automationAccountName'))).registrationUrl]",
    "NodeConfigurationName" : "[parameters('NodeConfigName')]"
},
"protectedSettings": {
    "configurationArguments": {
        "RegistrationKey": {
            "userName": "NOT_USED",
            "Password": "[listKeys(resourceId('Microsoft.Automation/automationAccounts/', parameters('automationAccountName')), '2018-01-15').Keys[0].value]"
        }
    }
}

从以前的格式更新Update from a previous format

以前扩展格式中的所有设置(包含公共属性 ModulesUrlModuleSourceModuleVersionConfigurationFunctionSasTokenProperties)会自动调整为当前扩展格式。Any settings in a previous format of the extension (and which have the public properties ModulesUrl, ModuleSource, ModuleVersion, ConfigurationFunction, SasToken, or Properties) automatically adapt to the current format of the extension. 它们按以前的相同方式运行。They run just as they did before.

以下架构显示了以前的 settings 架构的大致形式:The following schema shows what the previous settings schema looked like:

"settings": {
    "WMFVersion": "latest",
    "ModulesUrl": "https://UrlToZipContainingConfigurationScript.ps1.zip",
    "SasToken": "SAS Token if ModulesUrl points to private Azure Blob Storage",
    "ConfigurationFunction": "ConfigurationScript.ps1\\ConfigurationFunction",
    "Properties": {
        "ParameterToConfigurationFunction1": "Value1",
        "ParameterToConfigurationFunction2": "Value2",
        "ParameterOfTypePSCredential1": {
            "UserName": "UsernameValue1",
            "Password": "PrivateSettingsRef:Key1"
        },
        "ParameterOfTypePSCredential2": {
            "UserName": "UsernameValue2",
            "Password": "PrivateSettingsRef:Key2"
        }
    }
},
"protectedSettings": {
    "Items": {
        "Key1": "PasswordValue1",
        "Key2": "PasswordValue2"
    },
    "DataBlobUri": "https://UrlToConfigurationDataWithOptionalSasToken.psd1"
}

以前的格式调整为当前格式后的情况如下所示:Here's how the previous format adapts to the current format:

当前属性名称Current Property name 以前架构的等效值Previous schema equivalent
settings.wmfVersionsettings.wmfVersion settings.WMFVersionsettings.WMFVersion
settings.configuration.urlsettings.configuration.url settings.ModulesUrlsettings.ModulesUrl
settings.configuration.scriptsettings.configuration.script settings.ConfigurationFunction 的第 1 个部分(在 \\ 前面)First part of settings.ConfigurationFunction (before \\)
settings.configuration.functionsettings.configuration.function settings.ConfigurationFunction 的第 2 个部分(在 \\ 后面)Second part of settings.ConfigurationFunction (after \\)
settings.configuration.module.namesettings.configuration.module.name settings.ModuleSourcesettings.ModuleSource
settings.configuration.module.versionsettings.configuration.module.version settings.ModuleVersionsettings.ModuleVersion
settings.configurationArgumentssettings.configurationArguments settings.Propertiessettings.Properties
settings.configurationData.urlsettings.configurationData.url protectedSettings.DataBlobUri(没有 SAS 令牌)protectedSettings.DataBlobUri (without SAS token)
settings.privacy.dataCollectionsettings.privacy.dataCollection settings.Privacy.dataCollectionsettings.Privacy.dataCollection
settings.advancedOptions.downloadMappingssettings.advancedOptions.downloadMappings settings.AdvancedOptions.DownloadMappingssettings.AdvancedOptions.DownloadMappings
protectedSettings.configurationArgumentsprotectedSettings.configurationArguments protectedSettings.PropertiesprotectedSettings.Properties
protectedSettings.configurationUrlSasTokenprotectedSettings.configurationUrlSasToken settings.SasTokensettings.SasToken
protectedSettings.configurationDataUrlSasTokenprotectedSettings.configurationDataUrlSasToken protectedSettings.DataBlobUri 中的 SAS 令牌SAS token from protectedSettings.DataBlobUri

疑难解答Troubleshooting

下面是可能会遇到的一些错误及其解决方法。Here are some of the errors you might run into and how you can fix them.

无效值Invalid values

“Privacy.dataCollection 为‘{0}’。"Privacy.dataCollection is '{0}'. 可能的值只有 ''、'Enable' 和 'Disable'”。The only possible values are '', 'Enable', and 'Disable'". “WmfVersion 为‘{0}’。"WmfVersion is '{0}'. 唯一的可能值为 ...Only possible values are … 和 'latest'”。and 'latest'".

问题:不允许使用提供的值。Problem: A provided value is not allowed.

解决方案;将无效值更改为有效值。Solution: Change the invalid value to a valid value. 有关详细信息,请参阅详细信息中的表格。For more information, see the table in Details.

无效的 URLInvalid URL

“ConfigurationData.url 为‘{0}’。"ConfigurationData.url is '{0}'. 这不是有效的 URL”。“DataBlobUri 为‘{0}’。This is not a valid URL" "DataBlobUri is '{0}'. 这不是有效的 URL”。“Configuration.url 为‘{0}’。This is not a valid URL" "Configuration.url is '{0}'. 这不是有效的 URL”This is not a valid URL"

问题:提供的 URL 无效。Problem: A provided URL is not valid.

解决方案;检查提供的所有 URL。Solution: Check all your provided URLs. 确保所有 URL 都解析为扩展可在远程计算机上访问的有效位置。Ensure that all URLs resolve to valid locations that the extension can access on the remote machine.

无效 RegistrationKey 类型Invalid RegistrationKey type

“PSCredential 类型的参数 RegistrationKey 的类型无效。”"Invalid type for parameter RegistrationKey of type PSCredential."

问题:protectedSettings.configurationArguments 中的 RegistrationKey 值不能以 PSCredential 以外的任何类型提供。Problem: The RegistrationKey value in protectedSettings.configurationArguments cannot be provided as any type other than a PSCredential.

解决方案;使用以下格式将 RegistrationKey 的 protectedSettings.configurationArguments 条目更改为 PSCredential 类型:Solution: Change your protectedSettings.configurationArguments entry for RegistrationKey to a PSCredential type using the following format:

"configurationArguments": {
    "RegistrationKey": {
        "userName": "NOT_USED",
        "Password": "RegistrationKey"
    }
}

无效的 ConfigurationArgument 类型Invalid ConfigurationArgument type

“无效的 configurationArguments 类型 {0}”"Invalid configurationArguments type {0}"

问题:ConfigurationArguments 属性无法解析为哈希表对象。Problem: The ConfigurationArguments property can't resolve to a Hash table object.

解决方案;将 ConfigurationArguments 属性设置为哈希表。Solution: Make your ConfigurationArguments property a Hash table. 遵循上述示例中提供的格式。Follow the format provided in the preceding examples. 请注意引号、逗号和括号。Watch for quotes, commas, and braces.

重复的 ConfigurationArgumentsDuplicate ConfigurationArguments

“在公共和受保护的 configurationArguments 中发现重复的参数‘{0}’”"Found duplicate arguments '{0}' in both public and protected configurationArguments"

问题:公共设置中的 ConfigurationArguments 和受保护设置中的 ConfigurationArguments 包含同名属性。Problem: The ConfigurationArguments in public settings and the ConfigurationArguments in protected settings have properties with the same name.

解决方案;删除其中一个重复的属性。Solution: Remove one of the duplicate properties.

缺少属性Missing properties

“settings.Configuration.function 要求指定 settings.configuration.url 或 settings.configuration.module”"settings.Configuration.function requires that settings.configuration.url or settings.configuration.module is specified"

“settings.Configuration.url 要求指定 settings.configuration.script”"settings.Configuration.url requires that settings.configuration.script is specified"

“settings.Configuration.script 要求指定 settings.configuration.url”"settings.Configuration.script requires that settings.configuration.url is specified"

“settings.Configuration.url 要求指定 settings.configuration.function”"settings.Configuration.url requires that settings.configuration.function is specified"

“protectedSettings.ConfigurationUrlSasToken 要求指定 settings.configuration.url”"protectedSettings.ConfigurationUrlSasToken requires that settings.configuration.url is specified"

“protectedSettings.ConfigurationDataUrlSasToken 要求指定 settings.configurationData.url”"protectedSettings.ConfigurationDataUrlSasToken requires that settings.configurationData.url is specified"

问题:定义的属性需要另一个缺少的属性。Problem: A defined property needs another property, which is missing.

解决方法Solutions:

  • 提供缺少的属性。Provide the missing property.
  • 删除需要缺失属性的属性。Remove the property that needs the missing property.

后续步骤Next steps