Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #76 - Fix 'Deploy ASP.NET Hello World application' example #77

Merged
merged 3 commits into from Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -51,7 +51,7 @@ Set your default subscription for this session using the subscription id from th
## Examples

1. [Azure App Service examples](appservice/README.md)
1. [Azure Container Apps examples](containerapp/README.md)
1. [Azure Container Registry examples](acr/README.md)
1. [Azure Key Vault examples](keyvault/README.md)
1. [Azure Resource Group examples](group/README.md)

2 changes: 1 addition & 1 deletion SCHEDULE.md
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
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 |
2 changes: 1 addition & 1 deletion appservice/create-plan/README.md
Expand Up @@ -37,7 +37,7 @@ Then, create the App Service Plan using the following command line:
--location $REGION \
--name $APPSERVICE_PLAN \
--is-linux \
--sku P1v3
--sku P2v3
```

<!-- workflow.directOnly()
Expand Down
11 changes: 11 additions & 0 deletions containerapp/README.md
@@ -0,0 +1,11 @@
### Azure Container Apps examples

| Name | Link | Status
| ---- | ---- | ------
| 1. [Create an environment](create-environment/README.md) | [Workflow](../.github/workflows/containerapp_create-environment_README_md.yml) | [![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)

<!-- workflow.run()

exit 0

-->
76 changes: 76 additions & 0 deletions containerapp/aspnet/README.md
@@ -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
1 change: 1 addition & 0 deletions group/create/README.md
Expand Up @@ -15,6 +15,7 @@ To setup the environment variables needed to create the Resource Group execute
the command lines below:

<!-- workflow.run()

if [[ -z $REGION ]]; then
export REGION=westus
fi
Expand Down