Skip to content

Commit e6c2a2a

Browse files
authored
Merge pull request #202791 from JasonWHowell/94696
Pull in public PR 94696
2 parents fc2b91a + 9263777 commit e6c2a2a

File tree

1 file changed

+35
-36
lines changed

1 file changed

+35
-36
lines changed

articles/stream-analytics/stream-analytics-cicd-api.md

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: su-jie
55
ms.author: sujie
66
ms.service: stream-analytics
77
ms.topic: how-to
8-
ms.date: 12/04/2018
8+
ms.date: 06/24/2022
99
---
1010

1111
# Implement CI/CD for Stream Analytics on IoT Edge using APIs
@@ -27,12 +27,12 @@ curl -u { <username:password> } -H "Content-Type: application/json" -X { <metho
2727
```bash
2828
wget -q -O- --{ <method> } -data="<request body>" --header=Content-Type:application/json --auth-no-challenge --http-user="<Admin>" --http-password="<password>" <url>
2929
```
30-
30+
3131
### Windows
3232
33-
For Windows, use PowerShell:
33+
For Windows, use PowerShell:
3434
35-
```powershell
35+
```powershell
3636
$user = "<username>"
3737
$pass = "<password>"
3838
$encodedCreds = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$pass)))
@@ -44,21 +44,21 @@ $content = "<request body>"
4444
$response = Invoke-RestMethod <url> -Method <method> -Body $content -Headers $Headers
4545
echo $response
4646
```
47-
48-
## Create an ASA job on Edge
49-
47+
48+
## Create an ASA job on IoT Edge
49+
5050
To create Stream Analytics job, call the PUT method using the Stream Analytics API.
5151
5252
|Method|Request URL|
5353
|------|-----------|
54-
|PUT|`https://management.azure.com/subscriptions/{\**subscription-id**}/resourcegroups/{**resource-group-name**}/providers/Microsoft.StreamAnalytics/streamingjobs/{**job-name**}?api-version=2017-04-01-preview`|
55-
54+
|PUT|`https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{resource-group-name}/providers/Microsoft.StreamAnalytics/streamingjobs/{job-name}?api-version=2017-04-01-preview`|
55+
5656
Example of command using **curl**:
5757
5858
```curl
5959
curl -u { <username:password> } -H "Content-Type: application/json" -X { <method> } -d "{ <request body> }" https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{resource-group-name}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobname}?api-version=2017-04-01-preview
60-
```
61-
60+
```
61+
6262
Example of request body in JSON:
6363
6464
```json
@@ -129,43 +129,43 @@ Example of request body in JSON:
129129
  }
130130
}
131131
```
132-
132+
133133
For more information, see the [API documentation](/rest/api/streamanalytics/).
134-
135-
## Publish Edge package
136-
137-
To publish a Stream Analytics job on IoT Edge, call the POST method using the Edge Package Publish API.
134+
135+
## Publish IoT Edge package
136+
137+
To publish a Stream Analytics job on IoT Edge, call the POST method using the IoT Edge Package Publish API.
138138
139139
|Method|Request URL|
140140
|------|-----------|
141-
|POST|`https://management.azure.com/subscriptions/{\**subscriptionid**}/resourceGroups/{**resourcegroupname**}/providers/Microsoft.StreamAnalytics/streamingjobs/{**jobname**}/publishedgepackage?api-version=2017-04-01-preview`|
141+
|POST|`https://management.azure.com/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobname}/publishedgepackage?api-version=2017-04-01-preview`|
142142
143-
This asynchronous operation returns a status of 202 until the job has been successfully published. The location response header contains the URI used to get the status of the process. While the process is running, a call to the URI in the location header returns a status of 202. When the process finishes, the URI in the location header returns a status of 200.
143+
The previous call to the IoT Edge Package Publish API triggers an asynchronous operation and returns a status of 202. The **location** response header contains the URI used to get the status of that asynchronous operation. A call to the URI in the **location** header returns a status of 202 to indicate the asynchronous operation is still in progress. When the operation is completed, the call to the URI in the **location** header returns a status of 200.
144144
145-
Example of an Edge package publish call using **curl**:
145+
Example of an IoT Edge package publish call using **curl**:
146146
147147
```bash
148148
curl -d -X POST https://management.azure.com/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobname}/publishedgepackage?api-version=2017-04-01-preview
149149
```
150-
151-
After making the POST call, you should expect a response with an empty body. Look for the URL located in the HEAD of the response and record it for further use.
152-
153-
Example of the URL from the HEAD of response:
154150
151+
After making the POST call, you should expect a response with an empty body. Look for the URI in the **location** header of the response, and record it for further use.
152+
153+
Example of the URI from the **location** header of response:
154+
155+
```rest
156+
https://management.azure.com/subscriptions/{subscriptionid}/resourcegroups/{resourcegroupname}/providers/Microsoft.StreamAnalytics/StreamingJobs/{resourcename}/OperationResults/{guidAssignedToTheAsynchronousOperation}?api-version=2017-04-01-preview
155157
```
156-
https://management.azure.com/subscriptions/{**subscriptionid**}/resourcegroups/{**resourcegroupname**}/providers/Microsoft.StreamAnalytics/StreamingJobs/{**resourcename**}/OperationResults/023a4d68-ffaf-4e16-8414-cb6f2e14fe23?api-version=2017-04-01-preview
157-
```
158-
A
159-
Wait for one to two minutes before running the following command to make an API call with the URL you found in the HEAD of the response. Retry the command if you do not get a 200 response.
160-
158+
159+
Wait from a few seconds to a couple of minutes before making a call to the API whose URI you found in the **location** header of the response to the IoT Edge Package Publish API, and repeat the cycle of waiting and retrying until you get a 200 response.
160+
161161
Example of making API call with returned URL with **curl**:
162162
163163
```bash
164-
curl -d –X GET https://management.azure.com/subscriptions/{subscriptionid}/resourceGroups/{resourcegroupname}/providers/Microsoft.StreamAnalytics/streamingjobs/{resourcename}/publishedgepackage?api-version=2017-04-01-preview
164+
curl -d –X GET https://management.azure.com/subscriptions/{subscriptionid}/resourcegroups/{resourcegroupname}/providers/Microsoft.StreamAnalytics/StreamingJobs/{resourcename}/OperationResults/{guidAssignedToTheAsynchronousOperation}?api-version=2017-04-01-preview
165165
```
166166
167-
The response includes the information you need to add to the Edge deployment script. The examples below show what information you need to collect and where to add it in the deployment manifest.
168-
167+
The response includes the information you need to add to the IoT Edge deployment script. The examples below show what information you need to collect and where to add it in the deployment manifest.
168+
169169
Sample response body after publishing successfully:
170170
171171
```json
@@ -177,7 +177,7 @@ Sample response body after publishing successfully:
177177
}
178178
```
179179
180-
Sample of Deployment Manifest:
180+
Sample of Deployment Manifest:
181181
182182
```json
183183
{
@@ -247,11 +247,10 @@ Sample of Deployment Manifest:
247247
}
248248
```
249249
250-
After the configuration of the deployment manifest, refer to [Deploy Azure IoT Edge modules with Azure CLI](../iot-edge/how-to-deploy-modules-cli.md) for deployment.
250+
After you configure the deployment manifest, refer to [Deploy Azure IoT Edge modules with Azure CLI](../iot-edge/how-to-deploy-modules-cli.md) for deployment.
251251
252+
## Next steps
252253
253-
## Next steps
254-
255254
* [Azure Stream Analytics on IoT Edge](stream-analytics-edge.md)
256255
* [ASA on IoT Edge tutorial](../iot-edge/tutorial-deploy-stream-analytics.md)
257-
* [Develop Stream Analytics Edge jobs using Visual Studio tools](stream-analytics-tools-for-visual-studio-edge-jobs.md)
256+
* [Develop Stream Analytics IoT Edge jobs using Visual Studio tools](stream-analytics-tools-for-visual-studio-edge-jobs.md)

0 commit comments

Comments
 (0)