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.47k stars 4.8k forks source link

[BUG] Creation of ImageReference results in NullReferenceException #45989

Closed DavidStorey closed 1 month ago

DavidStorey commented 1 month ago

Library name and version

Microsoft.Azure.Batch (v 16.3.0)

Describe the bug

Creation of an Azure Batch Pool programmatically fails when the setup of VirtualMachineConfiguration is created.

Calling this line fails in v 16.3.0 and is successful in v 16.2.0

return new ImageReference( "0001-com-ubuntu-server-jammy", "canonical", "22_04-lts", "latest");

Confirmed the image is available.

Expected behavior

ImageReference successfully created

Actual behavior

NullReferenceException raised here

Microsoft.Azure.Batch.dll!Microsoft.Azure.Batch.ImageReference.Offer.set(string value) Microsoft.Azure.Batch.dll!Microsoft.Azure.Batch.ImageReference.ImageReference(string offer, string publisher, string sku, string version)

Reproduction Steps

Creation of an Azure Batch Pool programmatically fails when the setup of VirtualMachineConfiguration is created.

Calling this line fails in v 16.3.0 and is successful in v 16.2.0

return new ImageReference( "0001-com-ubuntu-server-jammy", "canonical", "22_04-lts", "latest");

Confirmed the image is available.

Environment

Azure Batch pool created via a C# Azure Function

github-actions[bot] commented 1 month ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dpwatrous @wiboris.

TovTyvold commented 1 month ago

Having the same issue on a .net6.0 project, breaking change.

wiboris commented 1 month ago

Fix should be in shortly

wiboris commented 1 month ago

16.3.1 uploaded with fix https://www.nuget.org/packages/Microsoft.Azure.Batch

wiboris commented 1 month ago

fixed with 16.3.1