Skip to content

Commit c39e3c3

Browse files
Merge pull request #218846 from cebundy/upsize-quickstarts
[Container Apps]: Add Quickstarts using containerapp up command
2 parents 5035fb0 + e43cfe7 commit c39e3c3

File tree

7 files changed

+940
-339
lines changed

7 files changed

+940
-339
lines changed

articles/container-apps/TOC.yml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,14 @@
99
- name: Quickstarts
1010
expanded: true
1111
items:
12-
- name: With a sample container image
12+
- name: Deploy from an existing container image
1313
expanded: true
1414
items:
1515
- name: Azure portal
1616
href: quickstart-portal.md
1717
- name: Command line
1818
href: get-started.md
19-
- name: With an existing container image
20-
expanded: true
21-
items:
22-
- name: Azure portal
23-
href: get-started-existing-container-image-portal.md
24-
- name: Command line
25-
href: get-started-existing-container-image.md
26-
- name: With code on your local machine
19+
- name: Deploy an app from code
2720
expanded: true
2821
items:
2922
- name: Command line
@@ -157,21 +150,26 @@
157150
- name: Plan for disaster recovery
158151
href: disaster-recovery.md
159152
- name: Tutorials
160-
items:
161-
- name: Communicate between microservices
162-
href: communicate-between-microservices.md
163-
- name: Microservices with Dapr using the CLI
164-
href: microservices-dapr.md
165-
- name: Microservices with Dapr using ARM or Bicep
166-
href: microservices-dapr-azure-resource-manager.md
167-
- name: Deploy a Dapr application using GitHub Actions
168-
href: dapr-github-actions.md
169-
- name: Event-driven work using Dapr Bindings
170-
href: microservices-dapr-bindings.md
171-
- name: Microservices communication using Dapr Publish and Subscribe
172-
href: microservices-dapr-pubsub.md
173-
- name: Microservices communication using Dapr Service Invocation
174-
href: microservices-dapr-service-invoke.md
153+
expanded: true
154+
items:
155+
- name: Create and deploy a container app using the CLI
156+
href: tutorial-deploy-first-app-cli.md
157+
- name: Build a multiple app scenario
158+
expanded: true
159+
items:
160+
- name: 1. Deploy a backend microservice app
161+
href: tutorial-code-to-cloud.md
162+
- name: 2. Deploy a frontend microservice app
163+
href: communicate-between-microservices.md
164+
- name: Deploy microservices with Dapr
165+
expanded: true
166+
items:
167+
- name: Microservices with Dapr using the CLI
168+
href: microservices-dapr.md
169+
- name: Microservices with Dapr using ARM or Bicep
170+
href: microservices-dapr-azure-resource-manager.md
171+
- name: Deploy a Dapr application using GitHub Actions
172+
href: dapr-github-actions.md
175173
- name: Background processing
176174
href: background-processing.md
177175
- name: Create an Azure Files storage mount

articles/container-apps/get-started.md

Lines changed: 95 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,171 +1,173 @@
11
---
2-
title: 'Quickstart: Deploy your first container app'
3-
description: Deploy your first application to Azure Container Apps.
2+
title: 'Quickstart: Deploy your first container app with containerapp up'
3+
description: Deploy your first application to Azure Container Apps using the Azure CLI containerapp up command.
44
services: container-apps
5-
author: craigshoemaker
5+
author: cebundy
66
ms.service: container-apps
77
ms.topic: quickstart
8-
ms.date: 03/21/2022
9-
ms.author: cshoe
10-
ms.custom: ignite-fall-2021, mode-api, devx-track-azurecli, event-tier1-build-2022, devx-track-azurepowershell
8+
ms.date: 03/29/2023
9+
ms.author: v-bcatherine
10+
ms.custom: devx-track-azurecli, event-tier1-build-2022
1111
ms.devlang: azurecli
1212
---
1313

14-
# Quickstart: Deploy your first container app
14+
# Quickstart: Deploy your first container app with containerapp up
1515

1616
The Azure Container Apps service enables you to run microservices and containerized applications on a serverless platform. With Container Apps, you enjoy the benefits of running containers while you leave behind the concerns of manually configuring cloud infrastructure and complex container orchestrators.
1717

18-
In this quickstart, you create a secure Container Apps environment and deploy your first container app.
18+
In this quickstart, you create and deploy your first container app using the `az containerapp up` command.
1919

2020
## Prerequisites
2121

2222
- An Azure account with an active subscription.
2323
- If you don't have one, you [can create one for free](https://azure.microsoft.com/free/).
2424
- Install the [Azure CLI](/cli/azure/install-azure-cli).
2525

26-
[!INCLUDE [container-apps-create-cli-steps.md](../../includes/container-apps-create-cli-steps.md)]
26+
## Setup
2727

28-
# [Bash](#tab/bash)
28+
To sign in to Azure from the CLI, run the following command and follow the prompts to complete the authentication process.
2929

30-
To create the environment, run the following command:
30+
# [Bash](#tab/bash)
3131

3232
```azurecli
33-
az containerapp env create \
34-
--name $CONTAINERAPPS_ENVIRONMENT \
35-
--resource-group $RESOURCE_GROUP \
36-
--location $LOCATION
33+
az login
3734
```
3835

3936
# [Azure PowerShell](#tab/azure-powershell)
4037

41-
A Log Analytics workspace is required for the Container Apps environment. The following commands create a Log Analytics workspace and save the workspace ID and primary shared key to variables.
42-
4338
```azurepowershell
44-
$WorkspaceArgs = @{
45-
Name = 'myworkspace'
46-
ResourceGroupName = $ResourceGroupName
47-
Location = $Location
48-
PublicNetworkAccessForIngestion = 'Enabled'
49-
PublicNetworkAccessForQuery = 'Enabled'
50-
}
51-
New-AzOperationalInsightsWorkspace @WorkspaceArgs
52-
$WorkspaceId = (Get-AzOperationalInsightsWorkspace -ResourceGroupName $ResourceGroupName -Name $WorkspaceArgs.Name).CustomerId
53-
$WorkspaceSharedKey = (Get-AzOperationalInsightsWorkspaceSharedKey -ResourceGroupName $ResourceGroupName -Name $WorkspaceArgs.Name).PrimarySharedKey
39+
az login
5440
```
5541

56-
To create the environment, run the following command:
42+
---
43+
44+
Ensure you're running the latest version of the CLI via the upgrade command.
45+
46+
# [Bash](#tab/bash)
47+
48+
```azurecli
49+
az upgrade
50+
```
51+
52+
# [Azure PowerShell](#tab/azure-powershell)
5753

5854
```azurepowershell
59-
$EnvArgs = @{
60-
EnvName = $ContainerAppsEnvironment
61-
ResourceGroupName = $ResourceGroupName
62-
Location = $Location
63-
AppLogConfigurationDestination = 'log-analytics'
64-
LogAnalyticConfigurationCustomerId = $WorkspaceId
65-
LogAnalyticConfigurationSharedKey = $WorkspaceSharedKey
66-
}
67-
68-
New-AzContainerAppManagedEnv @EnvArgs
55+
az upgrade
6956
```
7057

7158
---
7259

73-
## Create a container app
74-
75-
Now that you have an environment created, you can deploy your first container app. With the `containerapp create` command, deploy a container image to Azure Container Apps.
60+
Next, install or update the Azure Container Apps extension for the CLI.
7661

7762
# [Bash](#tab/bash)
7863

7964
```azurecli
80-
az containerapp create \
81-
--name my-container-app \
82-
--resource-group $RESOURCE_GROUP \
83-
--environment $CONTAINERAPPS_ENVIRONMENT \
84-
--image mcr.microsoft.com/azuredocs/containerapps-helloworld:latest \
85-
--target-port 80 \
86-
--ingress 'external' \
87-
--query properties.configuration.ingress.fqdn
65+
az extension add --name containerapp --upgrade
8866
```
8967

90-
> [!NOTE]
91-
> Make sure the value for the `--image` parameter is in lower case.
92-
93-
By setting `--ingress` to `external`, you make the container app available to public requests.
94-
9568
# [Azure PowerShell](#tab/azure-powershell)
9669

70+
9771
```azurepowershell
98-
$ImageParams = @{
99-
Name = 'my-container-app'
100-
Image = 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest'
101-
}
102-
$TemplateObj = New-AzContainerAppTemplateObject @ImageParams
103-
$EnvId = (Get-AzContainerAppManagedEnv -EnvName $ContainerAppsEnvironment -ResourceGroupName $ResourceGroupName).Id
104-
105-
$AppArgs = @{
106-
Name = 'my-container-app'
107-
Location = $Location
108-
ResourceGroupName = $ResourceGroupName
109-
ManagedEnvironmentId = $EnvId
110-
IdentityType = 'SystemAssigned'
111-
TemplateContainer = $TemplateObj
112-
IngressTargetPort = 80
113-
IngressExternal = $true
114-
115-
}
116-
New-AzContainerApp @AppArgs
72+
az extension add --name containerapp --upgrade
11773
```
11874

119-
> [!NOTE]
120-
> Make sure the value for the `Image` parameter is in lower case.
121-
122-
By setting `IngressExternal` to `$true`, you make the container app available to public requests.
123-
12475
---
12576

126-
## Verify deployment
77+
Register the `Microsoft.App` and `Microsoft.OperationalInsights` namespaces if you haven't already registered them in your Azure subscription.
12778

12879
# [Bash](#tab/bash)
12980

130-
The `create` command returns the fully qualified domain name for the container app. Copy this location to a web browser.
81+
```azurecli
82+
az provider register --namespace Microsoft.App
83+
```
13184

132-
# [Azure PowerShell](#tab/azure-powershell)
85+
```azurecli
86+
az provider register --namespace Microsoft.OperationalInsights
87+
```
13388

134-
Get the fully qualified domain name for the container app.
89+
# [Azure PowerShell](#tab/azure-powershell)
13590

13691
```azurepowershell
137-
(Get-AzContainerApp -Name $AppArgs.Name -ResourceGroupName $ResourceGroupName).IngressFqdn
92+
az provider register --namespace Microsoft.App
13893
```
13994

140-
Copy this location to a web browser.
95+
```azurepowershell
96+
az provider register --namespace Microsoft.OperationalInsights
97+
```
14198

14299
---
143100

144-
The following message is displayed when the container app is deployed:
101+
Now that your Azure CLI setup is complete, you can define the environment variables that are used throughout this article.
145102

146-
:::image type="content" source="media/get-started/azure-container-apps-quickstart.png" alt-text="Your first Azure Container Apps deployment.":::
147103

148-
## Clean up resources
104+
## Create and deploy the container app
149105

150-
If you're not going to continue to use this application, run the following command to delete the resource group along with all the resources created in this quickstart.
106+
Create and deploy your first container app with the `containerapp up` command. This command will:
107+
108+
- Create the resource group
109+
- Create the Container Apps environment
110+
- Create the Log Analytics workspace
111+
- Create and deploy the container app using a public container image
112+
113+
Note that if any of these resources already exist, the command will use them instead of creating new ones.
151114

152-
>[!CAUTION]
153-
> The following command deletes the specified resource group and all resources contained within it. If resources outside the scope of this quickstart exist in the specified resource group, they will also be deleted.
154115

155116
# [Bash](#tab/bash)
156117

157118
```azurecli
158-
az group delete --name $RESOURCE_GROUP
119+
az containerapp up \
120+
--name my-container-app \
121+
--resource-group my-container-apps \
122+
--location centralus \
123+
--environment 'my-container-apps' \
124+
--image mcr.microsoft.com/azuredocs/containerapps-helloworld:latest \
125+
--target-port 80 \
126+
--ingress external \
127+
--query properties.configuration.ingress.fqdn
159128
```
160129

161130
# [Azure PowerShell](#tab/azure-powershell)
162131

163-
```azurepowershell
164-
Remove-AzResourceGroup -Name $ResourceGroupName -Force
132+
```powershell
133+
az containerapp up `
134+
--name my-container-app `
135+
--resource-group my-container-apps `
136+
--location centralus `
137+
--environment my-container-apps `
138+
--image mcr.microsoft.com/azuredocs/containerapps-helloworld:latest `
139+
--target-port 80 `
140+
--ingress external `
141+
--query properties.configuration.ingress.fqdn
165142
```
166143

167144
---
168145

146+
> [!NOTE]
147+
> Make sure the value for the `--image` parameter is in lower case.
148+
149+
By setting `--ingress` to `external`, you make the container app available to public requests.
150+
151+
## Verify deployment
152+
153+
The `up` command returns the fully qualified domain name for the container app. Copy this location to a web browser.
154+
155+
The following message is displayed when the container app is deployed:
156+
157+
:::image type="content" source="media/get-started/azure-container-apps-quickstart.png" alt-text="Screenshot of container app web page.":::
158+
159+
## Clean up resources
160+
161+
If you're not going to continue to use this application, run the following command to delete the resource group along with all the resources created in this quickstart.
162+
163+
>[!CAUTION]
164+
> The following command deletes the specified resource group and all resources contained within it. If resources outside the scope of this quickstart exist in the specified resource group, they will also be deleted.
165+
166+
167+
```azurecli
168+
az group delete --name my-container-apps
169+
```
170+
169171
> [!TIP]
170172
> Having issues? Let us know on GitHub by opening an issue in the [Azure Container Apps repo](https://github.com/microsoft/azure-container-apps).
171173

0 commit comments

Comments
 (0)