Skip to content

Commit 96829db

Browse files
Apply suggestions from code review
Co-authored-by: Craig Shoemaker <[email protected]>
1 parent 0c1bdd5 commit 96829db

File tree

1 file changed

+30
-24
lines changed

1 file changed

+30
-24
lines changed

articles/container-apps/tutorial-scaling.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,19 @@ az provider register --namespace Microsoft.OperationalInsights
102102

103103
## Prepare the GitHub repository
104104

105-
In a browser window, go to the GitHub repository and fork the repository. For this tutorial, we will simply use the C# repository, because the programming language does not matter to the tutorial.
105+
Go to the [sample code repository](https://github.com/azure-samples/containerapps-albumapi-csharp) on GitHub to fork the repository. This article uses a C# code sample, but the programming language and environment doesn't matter for the reason of the tutorial.
106106

107-
Select the **Fork** button at the top of the [album API repo](https://github.com/azure-samples/containerapps-albumapi-csharp) to fork the repo to your account.
107+
Select the **Fork** button at the top of the album API repo to fork the repo to your account.
108108

109109
## Create and deploy the container app
110110

111-
Create and deploy your container app with the `containerapp up` command. This command creates:
111+
Create and deploy your container app with the `containerapp up` command. This command creates a:
112112

113-
- A resource group
114-
- The Container Apps environment
115-
- The Log Analytics workspace
113+
- Resource group
114+
- Container Apps environment
115+
- Log Analytics workspace
116116

117-
If any of these resources already exist, the command uses them instead of creating new ones.
117+
If any of these resources already exist, the command uses the existing resources rather than creating new ones.
118118

119119
Lastly, the command creates and deploys the container app using a public container image.
120120

@@ -157,7 +157,7 @@ az containerapp up `
157157
158158
By setting `--ingress` to `external`, you make the container app available to public requests.
159159

160-
The `up` command returns the fully qualified domain name (FQDN) for the container app. Copy this FQDN to a text file. You'll use it in the [Send requests](#send-requests) section. The FQDN looks like the following.
160+
The `up` command returns the fully qualified domain name (FQDN) for the container app. Copy this FQDN to a text file. You'll use it in the [Send requests](#send-requests) section. An example FQDN looks like the following:
161161

162162
```text
163163
https://my-container-app.icydune-96848328.centralus.azurecontainerapps.io
@@ -280,11 +280,14 @@ seq 1 50 | xargs -Iname -P5 curl "<YOUR_CONTAINER_APP_FQDN>"
280280

281281
These commands send 50 requests to your container app in concurrent batches of five requests each.
282282

283-
- `seq 1 50` generates a sequence from one to 50.
284-
- The pipe operator `|` sends this sequence to the `xargs` command.
285-
- `xargs` then runs `curl` with the specified URL.
286-
- The `-Iname` argument to `xargs` acts as a placeholder for the output of `seq`. This prevents the return value from being sent to the `curl` command.
287-
- The `-P5` argument instructs `xargs` to run up to five processes at a time.
283+
| Command or argument | Description |
284+
|---|---|
285+
| `seq 1 50` | Generates a sequence of numbers from 1 to 50. |
286+
| `|` | The pipe operator sends the sequence to the `xargs` command. |
287+
| `xargs` | Runs `curl` with the specified URL |
288+
| `-Iname` | Acts as a placeholder for the output of `seq`. This prevents the return value from being sent to the `curl` command. |
289+
| `curl` | Calls the given URL. |
290+
| `-P5` | Instructs `xargs` to run up to five processes at a time. |
288291

289292
For more information, see the documentation for:
290293
- [seq](https://www.man7.org/linux/man-pages/man1/seq.1.html)
@@ -309,15 +312,18 @@ $Runspace.Open()
309312

310313
These commands send 50 requests to your container app in asynchronous batches of five requests each.
311314

312-
- `[runspacefactory]::CreateRunspacePool(1,5)` creates a `RunspacePool` that allows up to five runspaces to run concurrently.
313-
- `1..50 | % { }` runs the code enclosed in the curly braces 50 times.
314-
- `$ps = [powershell]::Create()` creates a new PowerShell instance.
315-
- `$ps.RunspacePool = $Runspace` tells the PowerShell instance to run in the `RunspacePool`.
316-
- `[void]$ps.AddCommand("Invoke-WebRequest").AddParameter("UseBasicParsing",$true).AddParameter("Uri",$url)` tells the PowerShell instance to send a request to your container app.
317-
- `[void]$ps.BeginInvoke()` tells the PowerShell instance to run asynchronously.
315+
| Command or argument | Description |
316+
|---|---|
317+
| `[runspacefactory]::CreateRunspacePool(1,5)` | Creates a `RunspacePool` that allows up to five runspaces to run concurrently. |
318+
| `1..50 | % { }` | Runs the code enclosed in the curly braces 50 times. |
319+
| `$ps = [powershell]::Create()` | Creates a new PowerShell instance. |
320+
| `$ps.RunspacePool = $Runspace` | Tells the PowerShell instance to run in the `RunspacePool`. |
321+
| `[void]$ps.AddCommand("Invoke-WebRequest")` | Sends a request to your container app. |
322+
| `.AddParameter("UseBasicParsing", $true)` | Sends a request to your container app. |
323+
| `.AddParameter("Uri", $url)` | Sends a request to your container app. |
324+
| `[void]$ps.BeginInvoke()` | Tells the PowerShell instance to run asynchronously. |
318325

319-
For more information, see:
320-
[Beginning Use of PowerShell Runspaces: Part 3](https://devblogs.microsoft.com/scripting/beginning-use-of-powershell-runspaces-part-3/)
326+
For more information, refer to [Beginning Use of PowerShell Runspaces](https://devblogs.microsoft.com/scripting/beginning-use-of-powershell-runspaces-part-3/)
321327

322328
---
323329

@@ -337,7 +343,7 @@ In the first shell, where you ran the `az containerapp logs show` command, the o
337343
}
338344
```
339345

340-
## View scaling in Azure Portal (optional)
346+
## View scaling in Azure portal (optional)
341347

342348
1. Sign in to the [Azure portal](https://portal.azure.com).
343349
1. In the *Search* bar at the top, enter **my-container-app**.
@@ -348,7 +354,7 @@ In the first shell, where you ran the `az containerapp logs show` command, the o
348354

349355
:::image type="content" source="media/scale-app/azure-container-apps-scale-replicas.png" alt-text="Container app replicas.":::
350356

351-
Note you might need to click *Refresh* to see the new replicas.
357+
You may need to select **Refresh** to see the new replicas.
352358

353359
1. In the navigation bar at the left, expand *Monitoring* and select *Metrics*.
354360
1. In the *Metrics* page, set *Metric* to *Requests*.
@@ -364,7 +370,7 @@ Note you might need to click *Refresh* to see the new replicas.
364370

365371
:::image type="content" source="media/scale-app/azure-container-apps-scale-replicas-metrics-2.png" alt-text="Container app metrics graph.":::
366372

367-
The resulting zoomed view shows how the requests received by your container app are divided among the replicas.
373+
The following screenshot shows a zoomed view of how the requests received by your container app are divided among replicas.
368374

369375
:::image type="content" source="media/scale-app/azure-container-apps-scale-replicas-metrics-3.png" alt-text="Container app metrics graph.":::
370376

0 commit comments

Comments
 (0)