Artifact build failure. The build for you artifact has failed please check log stream for details.:
Hi,
I am getting the Artifact build failure when i try and deploy a jar. It started happening 3 days ago even with jars that previously uploaded and deployed ok.
Please help urgently.
Thanks,
Marcus
Azure Container Apps
-
Sai Prabhu Naveen Parimi • 1,150 Reputation points • Microsoft External Staff
2025-04-02T02:44:55.9266667+00:00 To better understand and troubleshoot the artifact build failure, could you please provide more details on the issue.
- Error Details:
- What specific error messages are you seeing in the log stream?
- Are there any stack traces or failure reasons mentioned?
- Deployment Method:
- How are you deploying the JAR? (Azure DevOps, GitHub Actions, FTP, Azure CLI, Terraform, etc.)
- Are you deploying to an Azure Web App or another service?
- Recent Changes:
- Have there been any updates to the JAR file, build pipeline, or Azure configuration in the past few days?
- Have you made any changes to dependencies, Java version, or build tools?
- Environment & Configuration:
- Which Java version is configured on the target environment?
- Does the application run locally without any issues?
- Storage & Permissions:
- Are you storing artifacts in Azure Artifacts, an external repository, or directly uploading the JAR?
- Have there been any changes in permissions or access policies recently?
- Infrastructure Issues:
- Is this issue affecting multiple environments or only a specific one?
- Have you noticed any recent Azure service outages, updates, or region-specific issues?
Once you provide more details, we can work on identifying the root cause and possible solutions.
- Error Details:
-
Marcus • 20 Reputation points
2025-04-02T04:02:42.73+00:00 There is no logstream for that deployment as it never gets deployed. I am using the Azure portal and uploading via the Deployment-Artifact preview page.
I chekced the log stream but there are no suggestions of a failure because it looks like it is not deployed, it seems to fail during the upload somehow. Maybe I am wrong. I can look specifically if you tell me.
I'm deploying to an Azure COntainer app, it is a java project.
I am trying a jar that was deployed before and it won't work. I noticed it a few days ago when I tried to deploy a new jar so thought I should try one that worked.
The pom.xml does have 2 new dependenices in the new code, but in the old code it is as before with what worked before.
It runs perfectly locally in Intellij and I am using the Microsoft JVM 17 , nothing has changed there.
I am uploading the jar. No changes in permissions. When i tried to register this support ticket,, when i clicked oopen solution it said there was a health probe to do with connection refused but it seemed that it was ok because it was to do with the container start/stop process that the connection was being refused so I don't think this is an issue.
Are there any stack traces or failure reasons mentioned? **Deployment Method**: How are you deploying the JAR? (Azure DevOps, GitHub Actions, FTP, Azure CLI, Terraform, etc.) Are you deploying to an Azure Web App or another service? **Recent Changes**: Have there been any updates to the JAR file, build pipeline, or Azure configuration in the past few days? Have you made any changes to dependencies, Java version, or build tools? **Environment & Configuration**: Which Java version is configured on the target environment? Does the application run locally without any issues? **Storage & Permissions**: Are you storing artifacts in Azure Artifacts, an external repository, or directly uploading the JAR? Have there been any changes in permissions or access policies recently? **Infrastructure Issues**: Is this issue affecting multiple environments or only a specific one? Have you noticed any recent Azure service outages, updates, or region-specific issues?
-
Marcus • 20 Reputation points
2025-04-02T04:07:31.92+00:00 here is a screenshot of the page i use to upload
-
Marcus • 20 Reputation points
2025-04-02T04:08:50.01+00:00 this is the page for uploading
-
Sai Prabhu Naveen Parimi • 1,150 Reputation points • Microsoft External Staff
2025-04-02T05:25:38.4133333+00:00 To pinpoint the issue with the JAR upload failure, please follow these specific troubleshooting steps:
Test Uploading an Older JAR
- Try uploading a JAR that previously worked.
- If this also fails → The issue is likely with Azure.
If it succeeds → The issue is with the new JAR (dependencies or build process).
- Check JAR Size & Contents
Compare the new JAR size with the previously working one.
- Run the following command to list the JAR’s contents:
If key files are missing → The issue is with the JAR build process.jar tf yourfile.jar
- Remove New Dependencies & Rebuild
Temporarily remove the new dependencies from
pom.xml
.- Rebuild the JAR using:
Try uploading this modified JAR. If the upload works → One of the new dependencies is causing the issue.mvn clean package
- Try Uploading via Azure CLI Instead of the Portal
- Run the following command:
If this works → The issue is with the Azure Portal UI.az containerapp up --name <app-name> --resource-group <resource-group> --image <image-name>
- Check Azure Health & Logs
- Azure Status Page: https://status.azure.com/
- Azure Portal → Your Container App → Diagnose and Solve Problems → Look for "Failed Uploads" or "Deployment Errors".
Let me know what you find, and we can take the next steps based on the results.
-
Marcus • 20 Reputation points
2025-04-02T05:31:15.95+00:00 I've already said that it doesn't work for an older jar that worked before. Please read my comments.
-
Arko • 1,550 Reputation points • Microsoft External Staff
2025-04-03T16:14:56.0466667+00:00 Since you've confirmed that even previously working JARs now fail during upload, this seems to be an issue with the Deployment Artifact (Preview) experience in the Azure Portal, not with your JARs or build setup. At this point, I'd recommend avoiding the preview upload flow.
First of all, let's isolate this. Let's try with CLI. Try to deploy your Java app using CLI instead, which bypasses the artifact ingestion issue entirely
az containerapp up \ --name <your-app-name> \ --resource-group <your-resource-group> \ --source . \ --runtime java \ --target-port 8080
If this works, then we can narrow down that it is indeed a portal UI issue. Let me know if this CLI way works. Accordingly, we can narrow down on this case. Thanks
-
Marcus • 20 Reputation points
2025-04-03T23:00:16.68+00:00 how do i issue the CLI command, I have only ever use the portal. Can you give me some instructions. Thanks
-
Marcus • 20 Reputation points
2025-04-04T02:03:17.6533333+00:00 I tried to run it after I downloaded the windows CLI and i got this error from your command
PS C:\WINDOWS\system32> az containerapp up --name aiworkerz-0.0.1-SNAPSHOT.jar --resource-group AIWorkerzTest --source . --runtime java --target-port 8080
unrecognized arguments: --runtime java
Examples from AI knowledge base:
Read more about the command in reference docs
-
Arko • 1,550 Reputation points • Microsoft External Staff
2025-04-04T07:59:23.22+00:00 Sure! let me document the steps as an answer for your ease or anyone trying to find a work around for this in the QnA community.
-
Arko • 1,550 Reputation points • Microsoft External Staff
2025-04-04T08:24:58.6933333+00:00 Hello Marcus, As discussed, please find a fully working, end-to-end CLI-based solution that avoids the portal upload bug entirely.
Just for the context, this was the blocker- The Deployment Artifact (Preview) upload flow in Azure Portal for Java JARs is currently unstable. Even valid JARs fail with cryptic errors like
Artifact build failure - the build for your artifact failed. Please try again.
*
How to overcome this blocker? Any Workaround?*Ans- Yes, containerize your JAR and deploy via Azure CLI
Create a Java App, Here I have created one under src/main/java/com/demo/App.java
package com.demo; import static spark.Spark.*; public class App { public static void main(String[] args) { port(8081); // <- Using port 8081 to avoid conflicts with 8080 get("/", (req, res) -> "Hello from Java running on port 8081!"); } }
This is my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.demo</groupId> <artifactId>myapp</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>com.sparkjava</groupId> <artifactId>spark-core</artifactId> <version>2.9.4</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.13.2</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.5.0</version> <executions> <execution> <phase>package</phase> <goals><goal>shade</goal></goals> <configuration> <createDependencyReducedPom>false</createDependencyReducedPom> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>com.demo.App</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
Package the JAR using
mvn clean package
and this createstarget/myapp-1.0-SNAPSHOT.jar
Create Dockerfile for the same
FROM eclipse-temurin:17-jdk-jammy WORKDIR /app COPY target/myapp-1.0-SNAPSHOT.jar app.jar EXPOSE 8081 CMD ["java", "-jar", "app.jar"]
Let's build and test it locally once before deploying to container app.
docker build -t myapp:local . docker run -p 8081:8081 myapp:local
Visit http://localhost:8081 – you should see the message! (I have used 8081, for my example, you can choose your own port based on their availability)
Looks good so far!
Time to push it to the azure container registry so that you can reference it from your container app, but before that you have to create one container registry
# Set values RG="arkorg" SUB="abcd-efg-hijk-lmnop" ACR_NAME="aiworkerzacr" # Set subscription az account set --subscription $SUB # Create ACR az acr create --name $ACR_NAME --resource-group $RG --sku Basic --admin-enabled true # Login & push az acr login --name $ACR_NAME docker tag myapp:local $ACR_NAME.azurecr.io/myapp:latest docker push $ACR_NAME.azurecr.io/myapp:latest
Created an acr
logged into it and pushed my image
So far good. Next need to create a container app but before that need an environment for the container app
Create azure container app environment
az containerapp env create \ --name java-env \ --resource-group $RG \ --location westeurope
Finally deploy your azure container app (on port 8081 in my case. You can use your choice of target port)
az containerapp create \ --name myapp \ --resource-group $RG \ --environment java-env \ --image $ACR_NAME.azurecr.io/myapp:latest \ --target-port 8081 \ --ingress external \ --registry-server $ACR_NAME.azurecr.io
Your container app is up and running. Now go to the URL as highlighted below-
Done! Your application is running on it. You’ve deployed your JAR app to Azure Container Apps without getting stuck on the preview artifact UI.
Hope this was helpful for you Marcus.
-
Marcus • 20 Reputation points
2025-04-06T06:50:43.6966667+00:00 Do you know when azure portal will be fixed.
-
Arko • 1,550 Reputation points • Microsoft External Staff
2025-04-07T04:26:09.7566667+00:00 Hello Marcus, I have already informed the Microsoft Product team to get this addressed asap. They are working on it. Meanwhile it would be great if you could kindly accept and upvote my answer so that anyone else facing similar issue as you can reference my work around and get their work done. Thanks
-
Marcus • 20 Reputation points
2025-04-07T04:32:47.97+00:00 How will I know when it is fixed as this seems like very serious bug for the Azure platform. To be honest I am very surprised a company like Microsoft has allowed this to happen.
-
Arko • 1,550 Reputation points • Microsoft External Staff
2025-04-07T06:11:04.5666667+00:00 I pinged you in private message regarding this. Usually any fix / updates MS does is recorded here- https://azure.microsoft.com/en-us/updates
-
Marcus • 20 Reputation points
2025-04-08T06:11:33.07+00:00 I followed the instructions here https://learn.microsoft.com/en-us/azure/container-apps/deploy-artifact?tabs=powershell as they were easier than following your ones above. Everything seemed to work fine except it seems to be on the last line forever and the seconds keep ticking.
PS C:\WINDOWS\system32> az containerapp up --name $API_NAME --resource-group $RESOURCE_GROUP --location $LOCATION --environment $ENVIRONMENT --artifact c:\aiworkerz-0.0.1-SNAPSHOT-PREVIOUS.jar --ingress external --target-port 8080 --subscription $SUBSCRIPTION Argument '--artifact' is in preview and under development. Reference and support levels: [https://aka.ms/CLI_refstatus]() The behavior of this command has been altered by the following extension: containerapp Using resource group 'AIWorkerzTest' Using ContainerAppEnvironment 'env-aiworkerz' in resource group AIWorkerzTest Using the Cloud Build Service to build container image... Preparing the Azure Container Apps Cloud Build environment (✓) Done: Listing the builders available in the Container Apps environment (1.7s) Builder selected: artifact-builderbc3b (✓) Done: Getting the Container App (1.1s) Building the application (✓) Done: Retrieving the authentication token (1.4s) (✓) Done: Uploading data (36.0s) |=======| Waiting for the Cloud Build agent to report status (1557.9s)
-
Marcus • 20 Reputation points
2025-04-08T06:44:08.7066667+00:00 It finally finished with this error, please help.
Building the application
(✓) Done: Retrieving the authentication token (1.4s) (✓) Done: Uploading data (36.0s) (X) Fail: Waiting for the Cloud Build agent to report status (2338.0s) Service Unavailable({"error":{"code":"ServerTimeout","message":"The request timed out. Diagnostic information: timestamp '20250408T062214Z', subscription id 'c6e29f81-c9a4-40ef-98e7-af897d01eb88', tracking id '311414fc-d11a-4095-b81c-fa3ce4d253d6', request correlation id '311414fc-d11a-4095-b81c-fa3ce4d253d6'."}}) Full logs: C:\Users\marcu\AppData\Local\Temp\build01007aa.txt
Service Unavailable({"error":{"code":"ServerTimeout","message":"The request timed out. Diagnostic information: timestamp '20250408T062214Z', subscription id 'c6e29f81-c9a4-40ef-98e7-af897d01eb88', tracking id '311414fc-d11a-4095-b81c-fa3ce4d253d6', request correlation id '311414fc-d11a-4095-b81c-fa3ce4d253d6'."}})
-
Marcus • 20 Reputation points
2025-04-08T09:59:12.1466667+00:00 When I tried to run it again I got this :
PS C:\WINDOWS\system32> az containerapp up --name $API_NAME --resource-group $RESOURCE_GROUP --location $LOCATION --environment $ENVIRONMENT --artifact c:\aiworkerz-0.0.1-SNAPSHOT-PREVIOUS.jar --ingress external --target-port 8080 --subscription $SUBSCRIPTION Argument '--artifact' is in preview and under development. Reference and support levels: [https://aka.ms/CLI_refstatus]() The behavior of this command has been altered by the following extension: containerapp Using resource group 'AIWorkerzTest' Using ContainerAppEnvironment 'env-aiworkerz' in resource group AIWorkerzTest Using the Cloud Build Service to build container image... Preparing the Azure Container Apps Cloud Build environment (✓) Done: Listing the builders available in the Container Apps environment (1.5s) Builder selected: artifact-builderbc3b (✓) Done: Getting the Container App (1.1s) Building the application (✓) Done: Retrieving the authentication token (1.4s) (✓) Done: Uploading data (38.3s) (X) Fail: Waiting for the Cloud Build agent to report status (689.3s) ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) Full logs: C:\Users\marcu\AppData\Local\Temp\builddeeffd6.txt The command failed with an unexpected error. Here is the traceback: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) Traceback (most recent call last): File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connectionpool.py", line 715, in urlopen File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connectionpool.py", line 467, in _make_request File "<string>", line 3, in raise_from File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connectionpool.py", line 462, in _make_request File "http\client.py", line 1428, in getresponse File "http\client.py", line 331, in begin File "http\client.py", line 300, in _read_status http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/adapters.py", line 667, in send File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connectionpool.py", line 801, in urlopen File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/util/retry.py", line 552, in increment File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/packages/six.py", line 769, in reraise File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connectionpool.py", line 715, in urlopen File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connectionpool.py", line 467, in _make_request File "<string>", line 3, in raise_from File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connectionpool.py", line 462, in _make_request File "http\client.py", line 1428, in getresponse File "http\client.py", line 331, in begin File "http\client.py", line 300, in _read_status urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 666, in execute File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_job File "C:\Users\marcu\.azure\cliextensions\containerapp\azext_containerapp\_client_factory.py", line 28, in _polish_bad_errors raise ex File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 703, in _run_job File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 336, in __call__ File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 120, in handler File "C:\Users\marcu\.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 1322, in containerapp_up force_single_container_updates = app.run_source_to_cloud_flow(source, dockerfile, build_env_vars, can_create_acr_if_needed=True, registry_server=registry_server) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\marcu\.azure\cliextensions\containerapp\azext_containerapp\_up_utils.py", line 747, in run_source_to_cloud_flow self.image = self.build_container_from_source_with_cloud_build_service(source, build_env_vars, location) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\marcu\.azure\cliextensions\containerapp\azext_containerapp\_up_utils.py", line 559, in build_container_from_source_with_cloud_build_service raise exception File "C:\Users\marcu\.azure\cliextensions\containerapp\azext_containerapp\_up_utils.py", line 556, in build_container_from_source_with_cloud_build_service return run_cloud_build(self.cmd, source, build_env_vars, location, resource_group_name, self.env.name, container_app_name, run_full_id, logs_file, logs_file_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\marcu\.azure\cliextensions\containerapp\azext_containerapp\_cloud_build_utils.py", line 277, in run_cloud_build raise error File "C:\Users\marcu\.azure\cliextensions\containerapp\azext_containerapp\_cloud_build_utils.py", line 180, in run_cloud_build build_json_content = BuildClient.get(cmd, builder_name, build_name, resource_group_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\marcu\.azure\cliextensions\containerapp\azext_containerapp\_clients.py", line 1038, in get r = send_raw_request(cmd.cli_ctx, "GET", request_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/util.py", line 1038, in send_raw_request File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/sessions.py", line 703, in send File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/adapters.py", line 682, in send requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) To check existing issues, please visit: [https://github.com/Azure/azure-cli/issues]() PS C:\WINDOWS\system32>
-
Arko • 1,550 Reputation points • Microsoft External Staff
2025-04-08T10:50:55.31+00:00 Hi Marcus, I see you are attempting to deploy a Java JAR file to Azure Container Apps using the --artifact flag. Just to let you know, --artifact flag relies on Azure Container Apps Cloud Build Service which is still in preview, and it can hang or fail with timeouts and is prone to Remote Disconnected, Server Timeout, and silent build agent errors. This is not a user error it's a platform-side issue in Azure's backend. I would still recommend you try my suggested way once. At least your work will not stop and backend the product group will look into it as I already informed you.
-
Arko • 1,550 Reputation points • Microsoft External Staff
2025-04-08T10:52:49.28+00:00 Pinged you on Private Message. Let me know if that works for you.
-
Marcus • 20 Reputation points
2025-04-08T10:58:39.5266667+00:00 I need your help to do it your way. I sent you a private message.
Sign in to comment