Welcome to the Q&A platform! Thank you for reaching out.
I understand you're having some trouble migrating your Spring app to an Azure Container App, especially with deploying the .jar file. You've mentioned getting an "upload failed" error and an "unrecognized argument: --artifact" error when using the az containerapp up
command.
Could you please check if you've followed these steps:
- Installed the latest Azure CLI and the Container Apps extension with:
az extension add --name containerapp --upgrade --allow-preview true
- Set up the necessary environment variables in your bash shell:
RESOURCE_GROUP="your-resource-group"
LOCATION="your-location"
ENVIRONMENT="your-environment"
API_NAME="your-api-name"
SUBSCRIPTION="your-subscription-id"
- Used the
az containerapp up
command to deploy the container app from your local .jar file:
az containerapp up --name $API_NAME --resource-group $RESOURCE_GROUP --location $LOCATION --environment $ENVIRONMENT --source .
Please note that for local builds, you will need a Dockerfile to deploy in the SRC
directory. You can refer to this GitHub repository for an example: https://github.com/Azure-Samples/containerapps-albumapi-csharp/tree/main/src
For more details, you can also review the following documentation:
- https://learn.microsoft.com/en-us/cli/azure/containerapp?view=azure-cli-latest#az-containerapp-up
- https://learn.microsoft.com/en-us/azure/container-apps/quickstart-code-to-cloud?tabs=bash%2Ccsharp#build-and-deploy-the-container-app
- https://learn.microsoft.com/en-us/azure/container-apps/deploy-artifact?tabs=bash#build-a-jar-file
- https://learn.microsoft.com/en-us/azure/container-apps/tutorial-code-to-cloud?tabs=bash%2Cjava&pivots=docker-local#build-your-application-1
Please let me know if you're still facing issues after trying these steps. I'm here to help!