Skip to content

Commit 8218f01

Browse files
author
Shreya Sangwa
committed
Fix provisioning error reporting, query param merging and bicep baseName default
1 parent 1c7ffc4 commit 8218f01

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

tools/Azure.Mcp.Tools.ManagedCleanroom/src/Services/ManagedCleanroomService.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,16 @@ await armClient.GetGenericResources()
180180

181181
stopwatch.Stop();
182182
var elapsed = stopwatch.Elapsed;
183-
var message = $"Collaboration provisioning {provisioningState.ToLowerInvariant()} after " +
183+
184+
if (provisioningState is "Failed" or "Canceled")
185+
{
186+
throw new InvalidOperationException(
187+
$"Collaboration provisioning {provisioningState.ToLowerInvariant()} after " +
188+
$"{(int)elapsed.TotalMinutes}m {elapsed.Seconds}s. " +
189+
$"Properties: {properties}");
190+
}
191+
192+
var message = $"Collaboration provisioning succeeded after " +
184193
$"{(int)elapsed.TotalMinutes}m {elapsed.Seconds}s " +
185194
"(expected ~25 minutes).";
186195

@@ -211,7 +220,11 @@ private static Uri BuildCollaborationsListUri(Uri endpointUri, bool? activeOnly)
211220

212221
if (activeOnly.HasValue)
213222
{
214-
builder.Query = $"activeOnly={activeOnly.Value.ToString().ToLowerInvariant()}";
223+
var existingQuery = endpointUri.Query.TrimStart('?');
224+
var activeOnlyParam = $"activeOnly={activeOnly.Value.ToString().ToLowerInvariant()}";
225+
builder.Query = string.IsNullOrEmpty(existingQuery)
226+
? activeOnlyParam
227+
: $"{existingQuery}&{activeOnlyParam}";
215228
}
216229

217230
return builder.Uri;

tools/Azure.Mcp.Tools.ManagedCleanroom/tests/test-resources.bicep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ targetScope = 'resourceGroup'
22

33
@minLength(3)
44
@maxLength(24)
5-
@description('The base resource name.')
6-
param baseName string = resourceGroup().name
5+
@description('The base resource name. Must be between 3 and 24 characters.')
6+
param baseName string
77

88
@description('The location of the resource. By default, this is the same as the resource group.')
99
param location string = resourceGroup().location

0 commit comments

Comments
 (0)