locked
New-AzureRmStreamAnalyticsOutput returning invalid json error when trying to create Azure function output RRS feed

  • Question

  • Hi,

    I have created an event hub and a stream analytics job. Have created an input whose source is the event hub and created a query. Now when I am trying to create an Azure Function as an output to this job - I am getting the following error:

    New-AzureRmStreamAnalyticsOutput : HTTP Status Code: BadRequest
    Error Code: BadRequest
    Error Message: The JSON provided in the request body is invalid. Required property 'properties' not found in JSON. Path '', line 1, position 2.
    Request Id: 98d152af-83a5-4fc4-8e05-b4284ccab957
    Timestamp (Utc):08/29/2018 08:06:27

    My output json template is this:

    {
    "Name": "AzureFunctionOutput",
    "Properties": {
    "datasource": {
    "type": "Microsoft.AzureFunction",
    "properties": {
    "functionAppName": "",
    "functionName": "",
    "maxBatchSize": 100,
    "apiKey": "",
    "maxBatchCount": 100
    }
    }

    },
    "Serialization": {
    "Properties": {
    "Encoding": "UTF8"
    },
    "Type": "Json"
    },
    "Type": "Stream"
    }

    Could anyone help me out here as what might be the issue?

    Also on side note, has anyone has tried creating a stream analytics job with azure function as output via powershell? 

    Thanks much!

    Wednesday, August 29, 2018 8:51 AM

All replies

  • We are tracking a bug on our side where latest version of TLS setting (1.2) is causing failures while writing to Azure functions. Please update the TLS setting to 1.0 / 1.1 and try it. I am hoping it should work.
    Wednesday, August 29, 2018 4:05 PM
  • Hi,

    I tried changing the TLS setting to 1.0/1.1 for the function App Service under which I am trying to create this function - but still getting same error. Is there anything else I can try out? Am I doing the right thing - I mean this is where you wanted me to change the setting, I hope?

    I am trying to set output of a stream analytics job to an Azure function - which I am trying to create using the above given template and command.

    Thanks Much!


    Deepika Adike

    Monday, September 3, 2018 9:26 AM
  • Anyone who can help me here?

    Deepika Adike

    Thursday, September 6, 2018 10:43 AM
  •  I have faced an issue while creating Azure Function as an output to a Stream Analytics Job. As per feature team, powershell deployment is not yet supported to do so, and hence they suggested to go for ARM template or REST API deployments. 

    Since my project we have many ARM deployments - I went ahead with ARM template deployment in this case. This is the template which I have used.



    {
     "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
     "contentVersion": "1.0.0.0",
     "parameters": {
      "resourcegroupname": {
                "type": "String"
            },
            "streamingjobsname": {
                "type": "String"
            },
            "streamingjobsoutputsname": {
                "type": "String"
            },  
            "functionAppName": {
                "type": "String"
            },  
            "functionName": {
                "type": "String"
            },  
            "apiKey": {
                "type": "String"
            }
     },
     "variables": {},
     "resources": [{
      "name": "[concat(parameters('streamingjobsname'),'/', parameters('streamingjobsoutputsname'))]",
      "type": "Microsoft.StreamAnalytics/streamingjobs/outputs",
      "apiVersion": "2016-03-01",
            "location": "East US",
      "properties": {
       "datasource": {
        "type": "Microsoft.AzureFunction",
        "properties": {
         "functionAppName": "[parameters('functionAppName')]",
         "functionName": "[parameters('functionName')]",
         "apiKey": "[parameters('apiKey')]"
        }
       },
       "serialization": {
        "type": "Json",
        "properties": {
         "encoding": "UTF8"
        }
       }
      },
      "dependsOn": []
     }]
    }

    But it would be better if we can PS support also here.



    Deepika Adike

    Wednesday, September 19, 2018 11:11 AM