Creating Azure Stream Analytics job using the python SDK gives an error azure.core.exceptions.HttpResponseError: (BadRequest)
. The JSON provided in the request body is invalid. The required property 'datasource type' is missing from the request.
Here is the API call I am using to create the ASA job:
response = client.streaming_jobs.begin_create_or_replace(resource_group_name, job_name123, streaming_job={
"location": "East US",
"properties": {
"sku": {
"name": "standard"
},
"eventsLateArrivalMaxDelayInSeconds": 1,
"jobType": "edge",
"inputs": [
{
"name": "input",
"properties": {
"type": "stream",
"serialization": {
"type": "JSON",
"properties": {
"fieldDelimiter": ",",
"encoding": "UTF8"
}
},
"datasource": {
"type": "GatewayMessageBus",
"properties": {
}
}
}
}
],
"transformation": {
"name": "samplequery",
"properties": {
"query": "select * from input"
}
},
"package": {
"storageAccount" : {
"accountName": "*******",
"accountKey": "*******"
},
"container": "sample"
},
"outputs": [
{
"name": "output",
"properties": {
"serialization": {
"type": "JSON",
"properties": {
"fieldDelimiter": ",",
"encoding": "UTF8"
}
},
"datasource": {
"type": "GatewayMessageBus",
"properties": {
}
}
}
}
]
}
})