Azure Container Apps now supports Buildpacks and Patching for .NET 7 (preview)
Published May 23 2023 08:00 AM 3,038 Views
Microsoft

Testing application changes rapidly is often a catalyst to delivering on business requirements quickly. That’s why we so often spend so much effort to optimize the time between “File Save” and “Browser Reload”. A lot of time this loop happens entirely on our workstations, and we forgo the true end-to-end test of reviewing our changes on the platform that will later run the application -- doing so usually takes too long.

 

This gap between developing and running an application is often also the reason we rarely keep our applications up to date. Once an app is running and we’ve moved on to the next project, it’s often too tedious to come back. We need to switch context, reopen an old project we barely remember, just to check if there’s been an update to any of the components we’ve used. If there are updates, we rarely apply them because of the risk involved and our inability to test them effectively.

 

What we are releasing into public preview today aims to address both of these issues and make it quicker and easier than ever to develop and run your application on Azure Container Apps (ACA). We’re launching this capability for .NET 7 with Node.js and Python to follow shortly. You won't even need a Dockerfile, instead, true to ACA’s roots we’re using Cloud Native Buildpacks based on CBL-Mariner. 

 

To get started building and deploying your .NET 7 application using Buildpacks:

# Make sure you update your container app extension to at least 0.3.31
az extension update --name containerapp

# Set some basic environment variables
export RESOURCE_GROUP="dotnet-sample-app"
export LOCATION="southcentralus"
export ENVIRONMENT="env-dotnet-containerapps"
export APP_NAME="dotnet-web"
export REGISTRY_NAME="myaz-registry"

# Authenticate to both Azure and your container registry
az login
az acr login --name $REGISTRY_NAME

# Build and launch your application on Azure Container Apps
# Important: Adjust you target-port setting to the port your application is listening on
az containerapp up --name $APP_NAME \
--location $LOCATION \
--environment $ENVIRONMENT \
-g $RESOURCE_GROUP \
--registry-server $REGISTRY_NAME.azurecr.io \
--ingress external \
--target-port 8080 \
--source .

The log shown should appear during he build and if you're seeing the highlighted log messages, you're using our new Buildpacks.

build-output.png

 

To list and apply patches to your application:

# To see if there are patches available for your application
# Since this is a freshly build application, you won't see anything here
az containerapp patch list -g $RESOURCE_GROUP

# In order to show all applications (regardless of their patch status)
az containerapp patch list -g $RESOURCE_GROUP --show-all

# Once a patch becomes available you can apply them via the following command:
az containerapp patch interactive -g $RESOURCE_GROUP

patch-list.png

We hope you like this new experience please don't hesitate to reach out via comments or our Github.

Co-Authors
Version history
Last update:
‎May 24 2023 03:34 PM
Updated by: