41 instantiations of AzureBicepResourceScope
Aspire.Hosting.Azure (5)
AzureBicepResourceScope.cs (4)
67
return new
AzureBicepResourceScope
(ScopeKind.Subscription, subscription);
76
return new
AzureBicepResourceScope
(ScopeKind.Tenant);
115
({ } resourceGroup, { } subscription) => new
AzureBicepResourceScope
(resourceGroup, subscription),
116
({ } resourceGroup, null) => new
AzureBicepResourceScope
(resourceGroup),
AzureProvisioningResource.cs (1)
273
return new
AzureBicepResourceScope
(annotationScope.ResourceGroup, subscription);
Aspire.Hosting.Azure.Kubernetes.Tests (15)
AzureKubernetesEnvironmentExtensionsTests.cs (13)
570
var supportingScope = new
AzureBicepResourceScope
(
575
aks.Resource.Scope = new
AzureBicepResourceScope
(
626
aks.Resource.Scope = new
AzureBicepResourceScope
("initial-rg", "initial-subscription");
628
infrastructure.AspireResource.Scope = new
AzureBicepResourceScope
("supporting-rg", "cluster-subscription"));
633
Scope = new
AzureBicepResourceScope
("consumer-rg", "consumer-subscription")
1004
infrastructure.AspireResource.Scope = new
AzureBicepResourceScope
(
1104
? new
AzureBicepResourceScope
(
1107
: new
AzureBicepResourceScope
("cluster-rg", "00000000-0000-0000-0000-000000000001");
1169
registry.Resource.Scope = new
AzureBicepResourceScope
("explicit-rg", "00000000-0000-0000-0000-000000000001");
1191
? new
AzureBicepResourceScope
(
1194
: new
AzureBicepResourceScope
("registry-rg", "00000000-0000-0000-0000-000000000001");
1196
? new
AzureBicepResourceScope
(
1199
: new
AzureBicepResourceScope
("network-rg", "00000000-0000-0000-0000-000000000002");
AzureKubernetesInfrastructureTests.cs (2)
620
aks.Resource.Scope = new
AzureBicepResourceScope
(
1752
aks.Resource.Scope = new
AzureBicepResourceScope
(scopeResourceGroup, scopeSubscriptionId);
Aspire.Hosting.Azure.Tests (21)
AzureApiManagementTests.cs (4)
1813
account.Resource.Scope = new
AzureBicepResourceScope
("ai-resources");
1930
apim.Resource.Scope = new
AzureBicepResourceScope
("gateway-resources");
1995
vault.Resource.Scope = new
AzureBicepResourceScope
("security-resources");
2307
apim.Resource.Scope = new
AzureBicepResourceScope
("override-gateway-rg", "override-gateway-subscription");
AzureBicepProvisionerTests.cs (1)
391
resource.Scope = new
AzureBicepResourceScope
(existingResourceGroup.Name, scopedSubscriptionId);
AzureBicepResourceScopeTests.cs (1)
11
var scope = new
AzureBicepResourceScope
("test-rg");
AzureEnvironmentResourceTests.cs (1)
340
resourceGroupScoped.Resource.Scope =
new
(resourceGroup.Resource, subscription.Resource);
AzureKeyVaultTests.cs (1)
158
module2.Resource.Scope =
new
(existingRg.Resource);
AzureResourcePreparerTests.cs (4)
33
var scope = new
AzureBicepResourceScope
("explicit-rg", "00000000-0000-0000-0000-000000000001");
67
? new
AzureBicepResourceScope
(
70
: new
AzureBicepResourceScope
("callback-rg", "00000000-0000-0000-0000-000000000001");
71
storage.Resource.Scope = new
AzureBicepResourceScope
("initial-rg");
BicepUtilitiesTests.cs (9)
34
resource.Scope = new
AzureBicepResourceScope
("module-rg", "module-subscription");
123
var explicitScope = new
AzureBicepResourceScope
("module-rg", "module-subscription");
131
Scope = new
AzureBicepResourceScope
("consumer-rg", "consumer-subscription")
383
bicep0.Resource.Scope =
new
("rg0");
387
bicep1.Resource.Scope =
new
("rg1");
411
bicep0.Resource.Scope =
new
("rg0");
415
bicep1.Resource.Scope =
new
("rg0");
565
bicep.Scope =
new
("test-rg");
580
bicep.Scope =
new
("test-rg", "12345678-1234-1234-1234-123456789012");
54 references to AzureBicepResourceScope
Aspire.Hosting.Azure (24)
AzureBicepResource.cs (1)
140
public
AzureBicepResourceScope
? Scope { get; set; }
AzureBicepResourceScope.cs (7)
14
/// Initializes a new instance of the <see cref="
AzureBicepResourceScope
"/> class with a resource group scope.
25
/// Initializes a new instance of the <see cref="
AzureBicepResourceScope
"/> class with a resource group scope in a specific subscription.
62
/// <returns>A new <see cref="
AzureBicepResourceScope
"/> scoped to the subscription.</returns>
63
public static
AzureBicepResourceScope
CreateForSubscription(object subscription)
73
/// <returns>A new <see cref="
AzureBicepResourceScope
"/> scoped to the current tenant.</returns>
74
public static
AzureBicepResourceScope
CreateForTenant()
104
internal static
AzureBicepResourceScope
? FromExistingResourceAnnotation(ExistingAzureResourceAnnotation annotation)
AzureProvisioningResource.cs (11)
104
var
scope = GetResourceReferenceScope(this);
180
if (
AzureBicepResourceScope
.FromExistingResourceAnnotation(existingAnnotation) is { } scope)
243
var
resourceScope = isComputeSourceTemplate
244
?
AzureBicepResourceScope
.FromExistingResourceAnnotation(existingAnnotation)
255
private static
AzureBicepResourceScope
? GetResourceReferenceScope(IAzureResource resource)
257
var
moduleScope = (resource as AzureBicepResource)?.Scope;
258
var
annotationScope = resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var annotation)
259
?
AzureBicepResourceScope
.FromExistingResourceAnnotation(annotation)
279
private static bool ScopeEquals(
AzureBicepResourceScope
expected,
AzureBicepResourceScope
? actual)
298
private static BicepValue<string> CreateScopeExpression(
AzureBicepResourceScope
scope, AzureResourceInfrastructure infra)
AzurePublishingContext.cs (1)
351
var
scope = resource.Scope;
Provisioning\BicepUtilities.cs (3)
101
var
targetScope = GetExistingResourceScope(resource);
181
internal static
AzureBicepResourceScope
? GetExistingResourceScope(AzureBicepResource resource)
203
return
AzureBicepResourceScope
.FromExistingResourceAnnotation(existingResource);
Provisioning\Provisioners\BicepProvisioner.cs (1)
508
var
targetScope = BicepUtilities.GetExistingResourceScope(resource);
Aspire.Hosting.Azure.EntraId.Tests (2)
EntraIdProvisioningTests.cs (2)
846
?
AzureBicepResourceScope
.CreateForTenant()
847
:
AzureBicepResourceScope
.CreateForSubscription("11111111-2222-3333-4444-555555555555");
Aspire.Hosting.Azure.Kubernetes.Tests (5)
AzureKubernetesEnvironmentExtensionsTests.cs (4)
570
var
supportingScope = new AzureBicepResourceScope(
1103
var
scope = configuredScope
1190
var
registryScope = parameterizedScope
1195
var
networkScope = parameterizedScope
AzureKubernetesInfrastructureTests.cs (1)
1830
aks.Resource.Scope =
AzureBicepResourceScope
.CreateForSubscription(subscriptionId);
Aspire.Hosting.Azure.Tests (23)
AzureBicepProvisionerTests.cs (5)
288
resource.Scope =
AzureBicepResourceScope
.CreateForSubscription(subscription.Id.Name);
324
resource.Scope =
AzureBicepResourceScope
.CreateForSubscription(subscription.Id.Name);
357
resource.Scope =
AzureBicepResourceScope
.CreateForTenant();
489
resource.Scope =
AzureBicepResourceScope
.CreateForSubscription(subscription.Id.Name);
867
Scope =
AzureBicepResourceScope
.CreateForSubscription(subscription.Id.Name)
AzureBicepResourceScopeTests.cs (5)
11
var
scope = new AzureBicepResourceScope("test-rg");
19
var
scope =
AzureBicepResourceScope
.CreateForSubscription("12345678-1234-1234-1234-123456789012");
29
var
scope =
AzureBicepResourceScope
.CreateForTenant();
AzureEnvironmentResourceExtensionsTests.cs (1)
205
arm.Resource.Scope =
AzureBicepResourceScope
.CreateForTenant();
AzureEnvironmentResourceTests.cs (3)
350
subscriptionScoped.Resource.Scope =
AzureBicepResourceScope
.CreateForSubscription(subscription.Resource);
360
tenantScoped.Resource.Scope =
AzureBicepResourceScope
.CreateForTenant();
498
module.Resource.Scope =
AzureBicepResourceScope
.CreateForTenant();
AzureResourcePreparerTests.cs (2)
33
var
scope = new AzureBicepResourceScope("explicit-rg", "00000000-0000-0000-0000-000000000001");
66
var
scope = parameterizedScope
BicepUtilitiesTests.cs (5)
123
var
explicitScope = new AzureBicepResourceScope("module-rg", "module-subscription");
596
bicep.Scope =
AzureBicepResourceScope
.CreateForSubscription("12345678-1234-1234-1234-123456789012");
611
bicep.Scope =
AzureBicepResourceScope
.CreateForSubscription("12345678-1234-1234-1234-123456789012");
630
bicep.Scope =
AzureBicepResourceScope
.CreateForTenant();
717
bicep.Scope =
AzureBicepResourceScope
.CreateForSubscription("12345678-1234-1234-1234-123456789012");
ExistingAzureResourceTests.cs (2)
588
resource.Resource.Scope =
AzureBicepResourceScope
.CreateForSubscription(existingSubscriptionId.Resource);
607
resource.Resource.Scope =
AzureBicepResourceScope
.CreateForTenant();