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
Copy file name to clipboardExpand all lines: articles/container-apps/get-started-existing-container-image.md
+77-66Lines changed: 77 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,14 +43,15 @@ Now that you have an environment created, you can deploy your first container ap
43
43
44
44
1. Set the environment variables.
45
45
46
-
Replace the \<PLACEHOLDERS\> with your values. Your user principal name will typically be in the format of an email address (for example, `[email protected]`).
46
+
Replace the `<PLACEHOLDERS>` with your values. Your user principal name will typically be in the format of an email address (for example, `[email protected]`).
47
47
48
48
# [Bash](#tab/bash)
49
49
50
50
```bash
51
-
KEY_VAULT_NAME=<KEY_VAULT_NAME>
51
+
CONTAINER_APP_NAME=my-container-app
52
+
KEY_VAULT_NAME=my-key-vault
52
53
USER_PRINCIPAL_NAME=<USER_PRINCIPAL_NAME>
53
-
SECRET_NAME=<SECRET_NAME>
54
+
SECRET_NAME=my-secret-name
54
55
CONTAINER_IMAGE_NAME=<CONTAINER_IMAGE_NAME>
55
56
REGISTRY_SERVER=<REGISTRY_SERVER>
56
57
REGISTRY_USERNAME=<REGISTRY_USERNAME>
@@ -59,9 +60,10 @@ Now that you have an environment created, you can deploy your first container ap
59
60
# [Azure PowerShell](#tab/azure-powershell)
60
61
61
62
```azurepowershell-interactive
62
-
$KeyVaultName = "<KEY_VAULT_NAME>"
63
+
$ContainerAppName = "my-container-app"
64
+
$KeyVaultName = "my-key-vault"
63
65
$UserPrincipalName = "<USER_PRINCIPAL_NAME>"
64
-
$SecretName = "<SECRET_NAME>"
66
+
$SecretName = "my-secret-name"
65
67
$ContainerImageName = "<CONTAINER_IMAGE_NAME>"
66
68
$RegistryServer = "<REGISTRY_SERVER>"
67
69
$RegistryUsername = "<REGISTRY_USERNAME>"
@@ -113,14 +115,10 @@ Now that you have an environment created, you can deploy your first container ap
113
115
114
116
1. Store your container registry password in the key vault.
115
117
116
-
Replace the \<PLACEHOLDERS\> with your values.
117
-
118
-
TODO1 I'm deliberately not using an env var to store the registry password here. You can delete this line with a suggestion.
118
+
Replace `<REGISTRY_PASSWORD>` with your value.
119
119
120
120
# [Bash](#tab/bash)
121
121
122
-
TODO1 Per Copilot there does not seem to be an Azure CLI equivalent for ConvertTo-SecureString (except using Key Vault itself). You can delete this line with a suggestion.
123
-
124
122
```bash
125
123
az keyvault secret set --vault-name $KEY_VAULT_NAME --name $SECRET_NAME --value "<REGISTRY_PASSWORD>"
126
124
```
@@ -142,41 +140,22 @@ Now that you have an environment created, you can deploy your first container ap
142
140
REGISTRY_PASSWORD=$(az keyvault secret show --name $SECRET_NAME --vault-name $KEY_VAULT_NAME --query value --output tsv)
143
141
```
144
142
145
-
For more information, see
146
-
- [Quickstart: Set and retrieve a secret from Azure Key Vault using Azure CLI](/azure/key-vault/secrets/quick-create-cli)
147
-
- [Manage Key Vault using the Azure CLI](/azure/key-vault/general/manage-with-cli2)
- [Quickstart: Set and retrieve a secret from Azure Key Vault using PowerShell](/azure/key-vault/secrets/quick-create-powershell)
157
-
- [Use Azure Key Vault in automation](/powershell/utility-modules/secretmanagement/how-to/using-azure-keyvault)
158
-
159
149
---
160
150
161
-
1. With the `containerapp create` command, deploy a container image to Azure Container Apps.
162
-
163
-
The example shown in this article demonstrates how to use a custom container image with common commands. Your container image might need more parameters for the following items:
164
-
165
-
- Set the revision mode
166
-
- Define secrets
167
-
- Define environment variables
168
-
- Set container CPU or memory requirements
169
-
- Enable and configure Dapr
170
-
- Enable external or internal ingress
171
-
- Provide minimum and maximum replica values or scale rules
151
+
1. Deploy a container image to Azure Container Apps.
172
152
173
153
# [Bash](#tab/bash)
174
154
175
-
For details on how to provide values for any of these parameters to the `create` command, run `az containerapp create --help` or [visit the online reference](/cli/azure/containerapp#az-containerapp-create). To generate credentials for an Azure Container Registry, use [az acr credential show](/cli/azure/acr/credential#az-acr-credential-show).
176
-
177
155
```azurecli-interactive
178
156
az containerapp create \
179
-
--name my-container-app \
157
+
--name $CONTAINER_APP_NAME \
158
+
--location $LOCATION \
180
159
--resource-group $RESOURCE_GROUP \
181
160
--image $CONTAINER_IMAGE_NAME \
182
161
--environment $CONTAINERAPPS_ENVIRONMENT \
@@ -185,33 +164,47 @@ Now that you have an environment created, you can deploy your first container ap
185
164
--registry-password $REGISTRY_PASSWORD
186
165
```
187
166
167
+
If you have enabled ingress on your container app, you can add `--query properties.configuration.ingress.fqdn` to the `create` command to return the public URL for the application.
@@ -221,43 +214,61 @@ Now that you have an environment created, you can deploy your first container ap
221
214
222
215
::: zone pivot="container-apps-public-registry"
223
216
224
-
# [Bash](#tab/bash)
217
+
1. Set the environment variables.
225
218
226
-
```azurecli-interactive
227
-
az containerapp create \
228
-
--image <REGISTRY_CONTAINER_NAME> \
229
-
--name my-container-app \
230
-
--resource-group $RESOURCE_GROUP \
231
-
--environment $CONTAINERAPPS_ENVIRONMENT
219
+
# [Bash](#tab/bash)
232
220
233
-
If you have enabled ingress on your container app, you can add `--query properties.configuration.ingress.fqdn` to the `create` command to return the public URL for the application.
If you have enabled ingress on your container app, you can add `--query properties.configuration.ingress.fqdn` to the `create` command to return the public URL for the application.
Before you run this command, replace `<REGISTRY_CONTAINER_NAME>` with the full name the public container registry location, including the registry path and tag. For example, a valid container name is `mcr.microsoft.com/k8se/quickstart:latest`.
271
+
---
261
272
262
273
::: zone-end
263
274
@@ -274,14 +285,14 @@ LOG_ANALYTICS_WORKSPACE_CLIENT_ID=`az containerapp env show --name $CONTAINERAPP
0 commit comments