You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Quickstart: Deploy a Dapr application to Azure Container Apps using the Azure CLI
16
+
# Quickstart: Deploy a Dapr application to Azure Container Apps by using the Azure CLI
17
17
18
18
[Dapr](./dapr-overview.md) (Distributed Application Runtime) helps developers build resilient, reliable microservices. In this quickstart, you learn how to enable Dapr sidecars to run alongside your microservices container apps. You'll:
19
19
@@ -27,6 +27,13 @@ ms.devlang: azurecli
27
27
28
28
This quickstart mirrors the applications you deploy in the open-source Dapr [Hello World](https://github.com/dapr/quickstarts/tree/master/tutorials/hello-world) quickstart.
29
29
30
+
## Prerequisites
31
+
32
+
- An Azure account with an active subscription. If you don't already have one, you can [create an account for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
33
+
- A GitHub account. If you don't already have one, sign up for [free](https://github.com/join).
@@ -39,18 +46,20 @@ This quickstart mirrors the applications you deploy in the open-source Dapr [Hel
39
46
40
47
### Create an Azure Blob Storage account
41
48
42
-
With the environment deployed, deploy an Azure Blob Storage account that is used by the Node.js container app to store data. Before deploying the service, choose a name for the storage account. Storage account names must be _unique within Azure_, from 3 to 24 characters in length and must contain numbers and lowercase letters only.
49
+
With the environment deployed, deploy an Azure Blob Storage account that is used by the Node.js container app to store data. Before deploying the service, choose a name for the storage account.
50
+
51
+
Storage account names must be _unique within Azure_, from 3 to 24 characters in length and must contain numbers and lowercase letters only.
43
52
44
53
# [Bash](#tab/bash)
45
54
46
55
```azurecli
47
-
STORAGE_ACCOUNT_NAME="<storageaccountname>"
56
+
STORAGE_ACCOUNT_NAME="<storage-account-name>"
48
57
```
49
58
50
59
# [PowerShell](#tab/powershell)
51
60
52
61
```azurepowershell
53
-
$StorageAcctName = '<storageaccountname>'
62
+
$StorageAcctName = '<storage-account-name>'
54
63
```
55
64
56
65
---
@@ -63,7 +72,7 @@ Use the following command to create the Azure Storage account.
New-AzRoleAssignment -ObjectId $PrincipalId -RoleDefinitionName 'Storage Blob Data Contributor' -Scope "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Storage/storageAccounts/$StorageAcctName"
172
+
New-AzRoleAssignment -ObjectId $PrincipalId -RoleDefinitionName 'Storage Blob Data Contributor' -Scope "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Storage/storageAccounts/$StorageAcctName"
163
173
```
164
174
165
175
---
@@ -168,19 +178,19 @@ While Container Apps supports both user-assigned and system-assigned managed ide
168
178
169
179
While you have multiple options for authenticating to external resources via Dapr. This example uses an Azure-based state store, so you can provide direct access from the Node.js app to the Blob store using Managed Identity.
170
180
171
-
1. In a text editor, create a file named *statestore.yaml* with the properties that you sourced from the previous steps.
181
+
1. In a text editor, create a file named *statestore.yaml* with the properties that you sourced from the previous steps. Replace the `<placeholders>` with your values.
172
182
173
183
```yaml
174
184
# statestore.yaml for Azure Blob storage component
175
185
componentType: state.azure.blobstorage
176
186
version: v1
177
187
metadata:
178
188
- name: accountName
179
-
value: "<STORAGE_ACCOUNT_NAME>"
189
+
value: "<storage-account-name>"
180
190
- name: containerName
181
191
value: mycontainer
182
192
- name: azureClientId
183
-
value: "<MANAGED_IDENTITY_CLIENT_ID>"
193
+
value: "<managed-identity-client-ID>"
184
194
scopes:
185
195
- nodeapp
186
196
```
@@ -202,11 +212,11 @@ While you have multiple options for authenticating to external resources via Dap
@@ -351,9 +363,9 @@ You can confirm that the services are working correctly by viewing data in your
351
363
352
364
1. Select the **Refresh** button to observe how the data automatically updates.
353
365
354
-
### View Logs
366
+
### View logs
355
367
356
-
Logs from container apps are stored in the `ContainerAppConsoleLogs_CL` custom table in the Log Analytics workspace. You can view logs through the Azure portal or via the CLI. There may be a small delay initially for the table to appear in the workspace.
368
+
Logs from container apps are stored in the `ContainerAppConsoleLogs_CL` custom table in the Log Analytics workspace. You can view logs through the Azure portal or via the CLI. There might be a small delay initially for the table to appear in the workspace.
357
369
358
370
View logs using the command line using the following CLI command.
359
371
@@ -372,7 +384,8 @@ az monitor log-analytics query \
372
384
373
385
```azurepowershell
374
386
375
-
$queryResults = Invoke-AzOperationalInsightsQuery -WorkspaceId $WorkspaceId -Query "ContainerAppConsoleLogs_CL | where ContainerAppName_s == 'nodeapp' and (Log_s contains 'persisted' or Log_s contains 'order') | project ContainerAppName_s, Log_s, TimeGenerated | take 5 "
387
+
$queryResults = Invoke-AzOperationalInsightsQuery -WorkspaceId $WorkspaceId -Query "ContainerAppConsoleLogs_CL | where ContainerAppName_s == 'nodeapp' and (Log_s contains 'persisted' or Log_s contains 'order') | project ContainerAppName_s, Log_s, TimeGenerated | take 5 "
388
+
376
389
$queryResults.Results
377
390
378
391
```
@@ -393,12 +406,12 @@ nodeapp Got a new order! Order ID: 63 PrimaryResult 2021-10-22
393
406
394
407
## Clean up resources
395
408
396
-
Since `pythonapp` continuously makes calls to `nodeapp` with messages that get persisted into your configured state store, it is important to complete these cleanup steps to avoid ongoing billable operations.
409
+
Since `pythonapp` continuously makes calls to `nodeapp` with messages that get persisted into your configured state store, it's important to complete these cleanup steps to avoid ongoing billable operations.
397
410
398
411
If you'd like to delete the resources created as a part of this walkthrough, run the following command.
399
412
400
413
> [!CAUTION]
401
-
> This command deletes the specified resource group and all resources contained within it. If resources outside the scope of this tutorial exist in the specified resource group, they will also be deleted.
414
+
> This command deletes the specified resource group and all resources contained within it. If resources outside the scope of this tutorial exist in the specified resource group, they're also deleted.
0 commit comments