Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.37k stars 4.78k forks source link

[QUERY] Unable to find stable package Azure.AI.OpenAI during Docker build #45254

Closed ThorstenBruegge closed 2 months ago

ThorstenBruegge commented 2 months ago

Library name and version

Azure.AI.OpenAI 2.0.0-beta.2

Query/Question

Hello,

I am encountering an issue while building a Docker image for my .NET 8.0 project that includes the Azure.AI.OpenAI package. Despite having the 2.0.0-beta.2 version specified and allowing for pre-release versions, the Docker build fails with the following error:

[...]Detection.Api.csproj : error NU1103: Unable to find a stable package Azure.AI.OpenAI with version
[...]Detection.Api.csproj : error NU1103:   - Found 19 version(s) in nuget [ Nearest version: 2.0.0-beta.2 ]

Steps to Reproduce:

  1. The Azure.AI.OpenAI package in Directory.Packages.props:

    [...]
    <PackageVersion Include="Azure.AI.OpenAI" Version="2.0.0-beta.2" />
    [...]
  2. The nuget.config:

    
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    
    <config>
    <add key="globalPackagesFolder" value=".\packages\nuget" />
    </config>
    
    <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
    </packageRestore>
    
    <packageSources>
    <clear />
    <add key="nuget" value="https://api.nuget.org/v3/index.json" />
    </packageSources>
    
    [...]


3. The Docker image using the following Dockerfile:

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base USER app WORKDIR /app EXPOSE 8080 EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["nuget.config", "."] COPY ["[...]Detection.Api.csproj", "src/cmt.Detection.Api/"] RUN dotnet restore "[...]Detection.Api.csproj" --configfile "./nuget.config" COPY . . WORKDIR "[...]Detection.Api" RUN dotnet build "[...]Detection.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish ARG BUILD_CONFIGURATION=Release RUN dotnet publish "[...]Detection.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "[...]Detection.Api.dll"]



### Observed Behavior:
The Docker build fails with error NU1103 stating that it is unable to find a stable package for Azure.AI.OpenAI, even though the specified version is a pre-release.

### Expected Behavior:
The Docker build should succeed, allowing the usage of the pre-release version 2.0.0-beta.2 of Azure.AI.OpenAI.

### Additional Information:

- Local build and restore processes outside Docker work correctly, recognizing and using the specified pre-release version.
- The issue appears to be specific to the Docker build environment.
- All packages are managed centrally via Directory.Packages.props.

<br/>
Any guidance or suggestions to resolve this issue would be greatly appreciated. **Thank you!**

### Environment

- .NET version: 8.0
- Docker base images: mcr.microsoft.com/dotnet/sdk:8.0 and mcr.microsoft.com/dotnet/aspnet:8.0
github-actions[bot] commented 2 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jpalvarezl @ralph-msft @trrwilson.

jsquire commented 2 months ago

Hi @ThorstenBruegge. Thanks for reaching out and we regret that you're experiencing difficulties. Since there has not yet been a stable release of Azure.OpenAI the failure to find one is expected. The behavior that you're seeing is not something that the Azure.OpenAI package has insight into nor influence over. Unfortunately, that's as much assistance as we can provide from this repository. The maintainers of the Azure SDK libraries are unable to provide assistance for other products.

I can't say whether this would be related to the dotnet CLI or docker integration, or both. I would suggest engaging the .NET team in their repository or opening a support request for .NET.

github-actions[bot] commented 2 months ago

Hi @ThorstenBruegge. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

github-actions[bot] commented 2 months ago

Hi @ThorstenBruegge, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.