Migrate spring app to container app, how to deploy new code with .jar in container app

Trey 0 Reputation points
2025-03-03T06:30:42.0533333+00:00

Azure Spring Apps retirement on 31/3/2025, and we need migrate it with container app. And when we click migrate, it create a new container app. But when we want to deploy the code with .jar, it always show upload failed without any error. And we try to use the command 'az containerapp up', but it show that 'unrecognized argument: -- artifact', so how can I deploy with .jar in container app.

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
562 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sai Prabhu Naveen Parimi 320 Reputation points Microsoft External Staff
    2025-03-03T10:54:27.6933333+00:00

    Trey

    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:

    1. Installed the latest Azure CLI and the Container Apps extension with:
    az extension add --name containerapp --upgrade --allow-preview true
    
    1. 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"
    
    1. 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:

    Please let me know if you're still facing issues after trying these steps. I'm here to help!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.