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

[Issue] azd up and azd deploy fail on SDK 9.0.102 with the error publishing container: failed to get dotnet target port: empty dotnet configuration output with dotnet publish output #4713

Open
1 task done
sgtwilko opened this issue Jan 21, 2025 · 3 comments
Labels
customer-reported identify a customer issue .NET Pull requests that update .net code .NET 9.0 question

Comments

@sgtwilko
Copy link

Output from azd version
Run azd version and copy and paste the output here:
azd version 1.11.1 (commit ae08ceba17c7078c547df9ee5f97e9e7ceb2fe53)

Describe the bug
azd up and azd deploy fail with the error:

  (x) Failed: Deploying service serviceName

ERROR: failed deploying service 'serviceName': publishing container: failed to get dotnet target port: empty dotnet configuration output with dotnet publish output '
'
Ensure project 'serviceName.csproj' is enabled for container support and try again. To enable SDK container support, set the 'EnableSdkContainerSupport' property to true in your project file

EnableSdkContainerSupport is enabled, and these commands work with dotnet SDK 9.0.100, but fail with 9.0.102.

The cause seems to be that dotnet publish is not returning the JSON configuration data.

This may be a bug with dotnet publish, but I've spotted that publish seems to now be generating multiple containers with different architectures - which may be why the JSON is missing.
If so it might be possible for azd to instruct publish to the previous behaviour (we probably don't need multiple containers for different architectures uploaded to Azure).

I've raised the issue with dotnet publish here dotnet/sdk#46176 , but felt the multiple arch containers for the same build

To Reproduce
There is a repo here which show the dotnet publish issue, and fails to produce the container information json when using dotnet publish.
I've not tried it (due to azure account restrictions), but it should cause adz deploy to fail.

Expected behavior
azd deploy and azd up should run without erroring, allowing new images to be uploaded and have the container app switched over to the new image.

Environment
Information on your environment:
* C#
* Visual Studio 17.12 & command line

Additional context
Add any other context about the problem here.

@sgtwilko
Copy link
Author

Confirmed here dotnet/sdk#46176 (comment) that the multiple container image being produced is what stops the GeneratedContainerConfiguration from being produced

@jochenvw
Copy link

jochenvw commented Jan 22, 2025

+1 - getting the same error trying to deploy https://github.com/Azure/data-api-builder

@hemarina hemarina added .NET 9.0 .NET Pull requests that update .net code labels Jan 30, 2025
@pukichu
Copy link

pukichu commented Feb 3, 2025

getting the same error trying to deploy .Net Aspire

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported identify a customer issue .NET Pull requests that update .net code .NET 9.0 question
Projects
None yet
Development

No branches or pull requests

4 participants