Azure / Azure/azure-cli-extensions

Stream-Analytics Transformation Update doesn't accept multiline query/SAQL

Open
#7,268 1 comment 0 reactions 1 assignee Claimed by @jsntcy View on GitHub
Auto-Assign Azure CLI Team customer-reported question Stream Analytics
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

### Describe the bug

We are updating stream analytics transformation using "az stream-analytics transformation update"
We have multiline query like
```
WITH {TABLENAME} AS (SELECT * FROM {INPUT NAME} TIMESTAMP BY Date)

-- some comment
SELECT {column1}, {column2}, {column3} INTO {OUTPUT1} FROM {TABLENAME}

-- some comment
SELECT {column1}, {column2}, {column3} INTO {OUTPUT2} FROM {TABLENAME}

-- some comment
SELECT {column1}, {column2}, {column3} INTO {OUTPUT3} FROM {TABLENAME}
```

Tried different format like
```
@"
WITH {TABLENAME} AS (SELECT * FROM {INPUT NAME} TIMESTAMP BY Date)

-- some comment
SELECT {column1}, {column2}, {column3} INTO {OUTPUT1} FROM {TABLENAME}

-- some comment
SELECT {column1}, {column2}, {column3} INTO {OUTPUT2} FROM {TABLENAME}

-- some comment
SELECT {column1}, {column2}, {column3} INTO {OUTPUT3} FROM {TABLENAME}
"@
```

And
```
{line1} `n{line2} `n{line3}
```

Still no success.

Used fiddler to check api request payload. Only first line of the query is sent. Remaining lines are ignored.

### Related command
```
az stream-analytics transformation update
--name $TransformationName `
--job-name $JobName `
--resource-group $ResourceGroup `
--streaming-units $StreamingUnits `
--saql $SAQLScript `
--only-show-errors `
| ConvertFrom-Json
```
### Errors

No Errors

### Issue script & Debug output

N/A

### Expected behavior

Multiline query / SAQL should be accepted

### Environment Summary

azure-cli 2.57.0

core 2.57.0
telemetry 1.1.0

Extensions:
azure-devops 0.25.0
stream-analytics 1.0.0

Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\{user}\.azure\cliextensions'

Python (Windows) 3.11.7 (tags/v3.11.7:fa7a6f2, Dec 4 2023, 19:13:08) [MSC v.1937 32 bit (Intel)]

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.