from azure.mgmt.streamanalytics import StreamAnalyticsManagementClient from azure.identity import AzureCliCredential def main(): client = StreamAnalyticsManagementClient( credential=AzureCliCredential(), subscription_id=, ) response = client.streaming_jobs.begin_create_or_replace( resource_group_name="resource_group_name", job_name="job_name", streaming_job={ "location": "East US", "properties": { # ... other properties ... "inputs": [ { "name": "inputtest", "properties": { "datasource": { "properties": { "serviceBusNamespace": "serviceBusNamespace", "eventHubName": "eventHubName", "sharedAccessPolicyName": "ListenPolicy", "sharedAccessPolicyKey": "sharedAccessPolicyKey", "consumerGroupName": "consumerGroupName" }, "type": "Microsoft.EventHub/EventHub", }, "serialization": {"properties": {"encoding": "UTF8"}, "type": "Json"}, "type": "Stream" }, } ], "outputs": [ { "name": "outputtest", "properties": { "datasource": { "properties": { "storageAccounts": [ {"accountKey": "accountKey", "accountName": "accountName"} ], "container": "stg", "dateFormat": "yyyy/MM/dd", "timeFormat": "HH", "blobPathPrefix": "/ingest_channel=streamanalytics/", "pathPattern": "{datetime:yyyy}-{datetime:MM}-{datetime:dd}-{datetime:HH}" }, "type": "Microsoft.Storage/Blob", }, "serialization": {"properties": {"encoding": "UTF8", "fieldDelimiter": ","},"type": "Parquet"}, "timeWindow": "00:05:00", "sizeWindow": 500 }, } ], "sku": {"name": "Standard"}, "transformation": { "name": "transformationtest", "properties": {"query": "Select * into outputtest from inputtest", "streamingUnits": 1}, }, # ... other properties ... }, "tags": {"key1": "value1", "key3": "value3", "randomKey": "randomValue"}, }, ).result() print(response) if __name__ == "__main__": main()