@@ -230,8 +230,6 @@ az identity create \
230
230
231
231
1 . Get the identity's resource ID.
232
232
233
- # [ Bash] ( #tab/bash )
234
-
235
233
``` azurecli
236
234
IDENTITY_ID=$(az identity show \
237
235
--name $IDENTITY \
@@ -346,13 +344,13 @@ Now, push the image to your registry.
346
344
347
345
# [ Bash] ( #tab/bash )
348
346
349
- ``` azurecli
347
+ ``` bash
350
348
docker push $ACR_NAME .azurecr.io/$API_NAME
351
349
```
352
350
353
351
# [ Azure PowerShell] ( #tab/azure-powershell )
354
352
355
- ``` powershell
353
+ ``` bash
356
354
docker push " $ACRName .azurecr.io/$APIName "
357
355
```
358
356
@@ -443,60 +441,59 @@ az containerapp create \
443
441
444
442
To create the container app, create template objects that you pass in as arguments to the ` New-AzContainerApp ` command.
445
443
446
- Create a template object to define your container image parameters.
444
+ 1 . Create a template object to define your container image parameters.
447
445
448
- ``` azurepowershell
449
- $ImageParams = @{
450
- Name = $APIName
451
- Image = $ACRName + '.azurecr.io/' + $APIName + ':latest'
452
- }
453
- $TemplateObj = New-AzContainerAppTemplateObject @ImageParams
454
- ```
455
-
456
- Create a registry credential object to define your registry information.
457
-
458
- ``` azurepowershell
459
- $RegistryArgs = @{
460
- Server = $ACRName + '.azurecr.io'
461
- Identity = $IdentityId
462
- }
463
- $RegistryObj = New-AzContainerAppRegistryCredentialObject @RegistryArgs
446
+ ``` azurepowershell
447
+ $ImageParams = @{
448
+ Name = $APIName
449
+ Image = $ACRName + '.azurecr.io/' + $APIName + ':latest'
450
+ }
451
+ $TemplateObj = New-AzContainerAppTemplateObject @ImageParams
452
+ ```
464
453
465
- ```
454
+ 1. Create a registry credential object to define your registry information.
466
455
467
- Get your environment ID.
456
+ ```azurepowershell
457
+ $RegistryArgs = @{
458
+ Server = $ACRName + '.azurecr.io'
459
+ Identity = $IdentityId
460
+ }
461
+ $RegistryObj = New-AzContainerAppRegistryCredentialObject @RegistryArgs
462
+ ```
468
463
469
- ``` azurepowershell
470
- $EnvId = (Get-AzContainerAppManagedEnv -EnvName $Environment -ResourceGroup $ResourceGroup).Id
471
- ```
464
+ 1. Get your environment ID.
472
465
473
- Create the container app.
466
+ ```azurepowershell
467
+ $EnvId = (Get-AzContainerAppManagedEnv -EnvName $Environment -ResourceGroup $ResourceGroup).Id
468
+ ```
474
469
475
- ``` azurepowershell
476
- $AppConfig = @{
477
- IngressTargetPort = 8080
478
- IngressExternal = $true
479
- Registry = $RegistryObj
480
- }
481
- $AppConfigObj = New-AzContainerAppConfigurationObject @AppConfig
470
+ 1. Create the container app.
482
471
483
- $AppArgs = @{
484
- Name = $APIName
485
- Location = $Location
486
- ResourceGroupName = $ResourceGroup
487
- ManagedEnvironmentId = $EnvId
488
- TemplateContainer = $TemplateObj
489
- Configuration = $AppConfigObj
490
- UserAssignedIdentity = @($IdentityId)
491
- }
492
- $MyApp = New-AzContainerApp @AppArgs
472
+ ```azurepowershell
473
+ $AppConfig = @{
474
+ IngressTargetPort = 8080
475
+ IngressExternal = $true
476
+ Registry = $RegistryObj
477
+ }
478
+ $AppConfigObj = New-AzContainerAppConfigurationObject @AppConfig
479
+
480
+ $AppArgs = @{
481
+ Name = $APIName
482
+ Location = $Location
483
+ ResourceGroupName = $ResourceGroup
484
+ ManagedEnvironmentId = $EnvId
485
+ TemplateContainer = $TemplateObj
486
+ Configuration = $AppConfigObj
487
+ UserAssignedIdentity = @($IdentityId)
488
+ }
489
+ $MyApp = New-AzContainerApp @AppArgs
493
490
494
- # Show the app's fully qualified domain name (FQDN).
495
- $MyApp.LatestRevisionFqdn
496
- ```
491
+ # Show the app's fully qualified domain name (FQDN).
492
+ $MyApp.LatestRevisionFqdn
493
+ ```
497
494
498
- * By setting ` IngressExternal ` to ` $true ` , your container app is accessible from the public internet.
499
- * The ` IngressTargetPort ` parameter is set to ` 8080 ` to match the port that the container is listening to for requests.
495
+ * By setting `IngressExternal` to `$true`, your container app is accessible from the public internet.
496
+ * The `IngressTargetPort` parameter is set to `8080` to match the port that the container is listening to for requests.
500
497
501
498
---
502
499
0 commit comments