diff --git a/sdk/provisioning/Azure.Provisioning.Storage/tests/BasicStorageTests.cs b/sdk/provisioning/Azure.Provisioning.Storage/tests/BasicStorageTests.cs index 2f076916fbf44..85272cbda4251 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/tests/BasicStorageTests.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/tests/BasicStorageTests.cs @@ -270,11 +270,12 @@ await test.Define( infra.Add(new ProvisioningOutput("blobs_endpoint", typeof(string)) { Value = storage.PrimaryEndpoints.Value!.BlobUri }); // Manually compute the public Azure endpoint + string? nothing = null; BicepValue computed = new BicepStringBuilder() .Append("https://") .Append($"{storage.Name}") - .Append(".blob.core.windows.net"); + .Append($".blob.core.windows.net{nothing}"); infra.Add(new ProvisioningOutput("computed_endpoint", typeof(string)) { Value = computed }); return infra; diff --git a/sdk/provisioning/Azure.Provisioning/src/Expressions/BicepStringBuilder.cs b/sdk/provisioning/Azure.Provisioning/src/Expressions/BicepStringBuilder.cs index 575bf7f6803f4..6e0f194ae6fe8 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Expressions/BicepStringBuilder.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Expressions/BicepStringBuilder.cs @@ -102,10 +102,11 @@ public void AppendFormatted(T t) } else { - _expressions.Add( - t is null ? - BicepSyntax.Null() : - BicepSyntax.Value(t.ToString() ?? "")); + string? s = t?.ToString(); + if (s is not null) + { + _expressions.Add(BicepSyntax.Value(s)); + } } }