Skip to content

[VS IDE] _PublishSingleContainer[CreateNewImage] operation will result in SUCCESS whether target container repository is reachable or un-authorized #645

@anvillan

Description

@anvillan

When publishing a container image through the .NET SDK Containers support "Target:_PublishSingleContainer, Task:CreateNewImage", the result returned to the caller is always SUCCESS (True, no excepction(s) thrown) even:

  • The target container registry is not reachable
  • The credentials passed to the invocation are valid or not (e.g. empty values)
  • Reproduced on .NET 9 and .NET 10 (RC)

Repro steps:

  • In VS, using a ASP.NET Web App project
  1. Create Publish profile
    1.1. Right click on the Project -> Publish
    1.2. In the Publish Wizard Dialog, select "Docker Container Registry" (Next) => "Azure Container Registry" (Next)
    1.3. Select or create an Azure Container Registry (Next)
    1.4. Select ".NET SDK" as the Container Build (Finish)

  2. Edit profile to point a non-existing ACR
    Under the ../<ProjectDir>/Properties/PublishProfiles open the publish profile (.pubxml) just created and edit it to point an incorrect container registry. Edit the properties:

  • "ResourceId"
  • "ResourceName"
  • "RegistrUrl"
    and set to a non-existing instance. I.e. add "x" at the name of the container
  1. Publish the project with the just edited profile (Click Publish button)

EXPECTED:
Tthe .NET SDK Container target (task) is invoked, and it fails as the ACR is not reachable and the credentials are not valid (they are empty as target container does not exist). No image is pushed into the Azure Container Registry.

ACTUAL:
The .NET SDK Container target (task) is invoked, and it result in SUCCESS, with no error/exceptions thrown because of the non-reachable container registry. No image is pushed into the Azure Container Registry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions