Skip to content

Commit

Permalink
Fixes #73 - Create 'Deploy an ASP.NET application' example (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem committed Feb 14, 2024
1 parent a78311f commit 04e412f
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SCHEDULE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ _Search for "Week X" to make sure you see all the content to be refreshed for th
| Azure Container Registry exampels | Build and push ASP.NET Hello World application | Week 8 |
| Azure Key Vault examples | Create a self-signed certificate | Week 9 |
| Azure Container App examples | Create an environment | Week 10 |

| | Deploy an ASP.NET application | Week 11 |
1 change: 1 addition & 0 deletions WORKFLOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
| Azure Container Registry examples | Build and push ASP.NET Hello World application | [![acr/create/README.md](https://github.com/mnriem/csharp-on-azure-examples/actions/workflows/acr_aspnet-helloworld_README_md.yml/badge.svg)](https://github.com/mnriem/csharp-on-azure-examples/actions/workflows/acr_aspnet-helloworld_README_md.yml) | 0 8 * * 1 |
| Azure Key Vault examples | Create a self-signed certificate | [![keyvault/create-self-signed-certificate/README.md](https://github.com/mnriem/csharp-on-azure-examples/actions/workflows/keyvault_create-self-signed-certificate_README_md.yml/badge.svg)](https://github.com/mnriem/csharp-on-azure-examples/actions/workflows/keyvault_create-self-signed-certificate_README_md.yml) | 0 9 * * 1 |
| Azure Container App examples | Create an environment | [![containerapp/create-environment/README.md](https://github.com/mnriem/csharp-on-azure-examples/actions/workflows/containerapp_create-environment_README_md.yml/badge.svg)](https://github.com/mnriem/csharp-on-azure-examples/actions/workflows/containerapp_create-environment_README_md.yml) | 0 10 * * 1 |
| Azure Container App examples | Deploy an ASP.NET application | [![containerapp/create-environment/README.md](https://github.com/mnriem/csharp-on-azure-examples/actions/workflows/containerapp_aspnet_README_md.yml/badge.svg)](https://github.com/mnriem/csharp-on-azure-examples/actions/workflows/containerapp_aspnet_README_md.yml) | 0 11 * * 1 |
76 changes: 76 additions & 0 deletions containerapp/aspnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@

# Deploy ASP.NET application

[![appservice/deploy-aspnet-helloworld/README.md](https://github.com/mnriem/csharp-on-azure-examples/actions/workflows/containerapp_aspnet_README_md.yml/badge.svg)](https://github.com/mnriem/csharp-on-azure-examples/actions/workflows/containerapp_aspnet_README_md.yml)

## Prerequisites

This example assumes you have previously completed the following example:

1. [Create an Azure Resource Group](../../group/create/README.md)
1. [Create an Azure Container Apps Environment](../create-environment/)

<!-- workflow.cron(0 11 * * 1) -->
<!-- workflow.include(../create-environment/README.md) -->

## Deploy an ASP.NET application

<!-- workflow.run()
cd containerapp/aspnet
-->

To deploy the ASP.NET container image to Azure Container Apps use the command
line below.

```shell
export ACA_ASPNET=aspnet

az containerapp create \
--name $ACA_ASPNET \
--resource-group $RESOURCE_GROUP \
--environment $ACA_ENVIRONMENT_NAME \
--image $ACR_NAME.azurecr.io/$ACR_HELLOWORLD_IMAGE \
--target-port 8080 \
--ingress 'external' \
--registry-server $ACR_NAME.azurecr.io \
--min-replicas 1

az containerapp show \
--resource-group $RESOURCE_GROUP \
--name $ACA_ASPNET \
--query properties.configuration.ingress.fqdn \
--output tsv
```

Then open your browser to the URL echoed above and you should see:

```text
Hello World!
```

<!-- workflow.run()
cd ../..
-->

## Cleanup

<!-- workflow.directOnly()
sleep 120
export URL=https://$(az containerapp show --resource-group $RESOURCE_GROUP --name $ACA_ASPNET --query properties.configuration.ingress.fqdn --output tsv)
export RESULT=$(curl $URL)
az group delete --name $RESOURCE_GROUP --yes || true
if [[ "$RESULT" != *"custom Glassfish"* ]]; then
echo "Response did not contain 'custom Glassfish'"
exit 1
fi
-->

Do NOT forget to remove the resources once you are done running the example.

1m

0 comments on commit 04e412f

Please sign in to comment.