Azure-LogicApp:解析值时遇到意外字符

时间:2018-11-07 04:53:37

标签: json azure-logic-apps

我正在尝试通过Powershell部署Azure Logic App。 我通过Visual Studio 2017创建了JSON模板。出现以下错误:任何想法,这是怎么回事?

New-AzureRmLogicApp : Unexpected character encountered while parsing value: h. Path '', line 0, position 0.

POWERSHELL命令

New-AzureRmLogicApp -ResourceGroupName "resourcegroupforutptesting123" -Name "LogicApp05" -Location "West US 2" -State "Enabled" -DefinitionFilePath "C:\Powershell\Definition03.json" -ParameterFilePath "C:\Powershell\Parameters03.json"

Definition03.json

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {},
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {},
        "triggers": {}
    }
}

2 个答案:

答案 0 :(得分:0)

我建议您使用Azure资源管理器模板来部署Logic App。

  1. 登录到您的Azure帐户。

    Connect-AzureRmAccount

  2. 创建模板文件,然后可以定义Logic App的名称和位置。

    { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "variables": {}, "resources": [ { "name": "LogicApp4", "type": "Microsoft.Logic/workflows", "location": "Southeast Asia", "tags": { "displayName": "LogicApp" }, "apiVersion": "2016-06-01", "properties": { "definition": { "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", "contentVersion": "1.0.0.0", "actions": {}, "outputs": {}, "parameters": {}, "triggers": {} }, "parameters": {} } } ], "outputs": {} }

  3. 将定义要创建的资源的模板部署到资源组。

New-AzureRmResourceGroupDeployment -Name NorasForDeployment -ResourceGroupName NorasForTest -TemplateFile C:\Users\v-wehan\source\repos\AzureResourceGroup1\AzureResourceGroup1\LogicApp.json

对我有用。有关更多详细信息,请参阅doc

enter image description here

答案 1 :(得分:0)

替换json文件中的内容

{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", "actions": {}, "contentVersion":"1.0.0.0","outputs": {},"parameters": {},"triggers": {}} 

它将添加空白逻辑应用程序。请注意,您在json文件中的json字符串中不应包含任何空格。