41 writes to Scope
Aspire.Hosting.Azure (3)
AzureProvisioningResource.cs (3)
30roleAssignment.Scope = BicepUtilities.GetExistingResourceScope(this); 107roleAssignment.Scope = scope; 182infrastructure.AspireResource.Scope ??= scope;
Aspire.Hosting.Azure.EntraId.Tests (1)
EntraIdProvisioningTests.cs (1)
158entra.Resource.Scope = tenantScoped
Aspire.Hosting.Azure.Kubernetes (2)
AzureKubernetesEnvironmentExtensions.cs (2)
136controlPlaneIdentity.Resource.Scope = resource.Scope; 137kubeletIdentity.Resource.Scope = resource.Scope;
Aspire.Hosting.Azure.Kubernetes.Tests (8)
AzureKubernetesEnvironmentExtensionsTests.cs (5)
815aks.ConfigureInfrastructure(infrastructure => infrastructure.AspireResource.Scope = scope); 819aks.Resource.Scope = scope; 874registry.Resource.Scope = new AzureBicepResourceScope("explicit-rg", "00000000-0000-0000-0000-000000000001"); 905registry.ConfigureInfrastructure(infrastructure => infrastructure.AspireResource.Scope = registryScope); 906network.ConfigureInfrastructure(infrastructure => infrastructure.AspireResource.Scope = networkScope);
AzureKubernetesInfrastructureTests.cs (3)
565aks.Resource.Scope = new AzureBicepResourceScope( 1687aks.Resource.Scope = new AzureBicepResourceScope(scopeResourceGroup, scopeSubscriptionId); 1757aks.Resource.Scope = AzureBicepResourceScope.CreateForSubscription(subscriptionId);
Aspire.Hosting.Azure.Tests (27)
AzureBicepProvisionerTests.cs (6)
319resource.Scope = AzureBicepResourceScope.CreateForSubscription(subscription.Id.Name); 355resource.Scope = AzureBicepResourceScope.CreateForSubscription(subscription.Id.Name); 388resource.Scope = AzureBicepResourceScope.CreateForTenant(); 422resource.Scope = new AzureBicepResourceScope(existingResourceGroup.Name, scopedSubscriptionId); 520resource.Scope = AzureBicepResourceScope.CreateForSubscription(subscription.Id.Name); 898Scope = AzureBicepResourceScope.CreateForSubscription(subscription.Id.Name)
AzureEnvironmentResourceExtensionsTests.cs (1)
205arm.Resource.Scope = AzureBicepResourceScope.CreateForTenant();
AzureEnvironmentResourceTests.cs (4)
220resourceGroupScoped.Resource.Scope = new(resourceGroup.Resource, subscription.Resource); 230subscriptionScoped.Resource.Scope = AzureBicepResourceScope.CreateForSubscription(subscription.Resource); 240tenantScoped.Resource.Scope = AzureBicepResourceScope.CreateForTenant(); 350module.Resource.Scope = AzureBicepResourceScope.CreateForTenant();
AzureKeyVaultTests.cs (1)
158module2.Resource.Scope = new(existingRg.Resource);
AzureResourcePreparerTests.cs (3)
33storage.Resource.Scope = scope; 70storage.Resource.Scope = new AzureBicepResourceScope("initial-rg"); 71storage.ConfigureInfrastructure(infrastructure => infrastructure.AspireResource.Scope = scope);
BicepUtilitiesTests.cs (10)
251bicep0.Resource.Scope = new("rg0"); 255bicep1.Resource.Scope = new("rg1"); 279bicep0.Resource.Scope = new("rg0"); 283bicep1.Resource.Scope = new("rg0"); 433bicep.Scope = new("test-rg"); 448bicep.Scope = new("test-rg", "12345678-1234-1234-1234-123456789012"); 464bicep.Scope = AzureBicepResourceScope.CreateForSubscription("12345678-1234-1234-1234-123456789012"); 479bicep.Scope = AzureBicepResourceScope.CreateForSubscription("12345678-1234-1234-1234-123456789012"); 498bicep.Scope = AzureBicepResourceScope.CreateForTenant(); 585bicep.Scope = AzureBicepResourceScope.CreateForSubscription("12345678-1234-1234-1234-123456789012");
ExistingAzureResourceTests.cs (2)
588resource.Resource.Scope = AzureBicepResourceScope.CreateForSubscription(existingSubscriptionId.Resource); 607resource.Resource.Scope = AzureBicepResourceScope.CreateForTenant();
43 references to Scope
Aspire.Hosting.Azure (13)
AzureBicepResource.cs (6)
234if (Scope is null) 279if (Scope is not null) 282if (Scope.HasResourceGroup) 284WriteScopeValue(context, "resourceGroup", Scope.ResourceGroup); 286WriteScopeValue(context, "subscription", Scope.Subscription); 287if (Scope.IsTenantScope)
AzureProvisioningResource.cs (2)
228var resourceScope = (aspireResource as AzureBicepResource)?.Scope ?? 231!ScopeEquals(scope, infra.AspireResource.Scope))
AzurePublishingContext.cs (3)
212if (resource.Scope is { } scope) 310if (resource.Scope is null) 315var scope = resource.Scope;
Provisioning\BicepUtilities.cs (2)
183if (resource.Scope is not null) 185return resource.Scope;
Aspire.Hosting.Azure.EntraId (1)
EntraIdApplicationResource.cs (1)
124if (Scope is { HasResourceGroup: false })
Aspire.Hosting.Azure.Kubernetes (8)
AzureKubernetesEnvironmentExtensions.cs (2)
136controlPlaneIdentity.Resource.Scope = resource.Scope; 137kubeletIdentity.Resource.Scope = resource.Scope;
AzureKubernetesEnvironmentResource.AksPipeline.cs (6)
741/// assigned <see cref="AzureBicepResource.Scope"/> (which <c>ConfigureInfrastructure</c> can set) 749if (Scope is not null) 753return Scope.IsTenantScope 755: (Scope.Subscription, Scope.HasResourceGroup ? Scope.ResourceGroup : null);
Aspire.Hosting.Azure.Kubernetes.Tests (15)
AzureKubernetesEnvironmentExtensionsTests.cs (15)
652Assert.NotNull(roles.Scope); 692Assert.Equal("final-rg", provisioningRoles.Scope!.ResourceGroup); 732Assert.Null(roles.Scope); 825Assert.Same(scope, aks.Resource.ControlPlaneIdentity!.Scope); 826Assert.Same(scope, aks.Resource.KubeletIdentity!.Scope); 830Assert.Same(scope, operatorRole.Scope); 834Assert.Null(registryRole.Scope); 882Assert.Same(registry.Resource.Scope, roles.Scope); 917Assert.Same(registryScope, registry.Resource.Scope); 918Assert.Same(registryScope, registryRole.Scope); 920Assert.Same(networkScope, network.Resource.Scope); 921Assert.Same(networkScope, networkRole.Scope); 975Assert.Equal("network-rg", role.Scope!.ResourceGroup); 982Assert.Null(role.Scope);
Aspire.Hosting.Azure.Tests (6)
AzureResourcePreparerTests.cs (6)
42Assert.Same(scope, roles.Scope); 46Assert.Same(scope, storage.Resource.Scope); 47Assert.Same(scope, roles.Scope); 86Assert.Same(scope, storage.Resource.Scope); 87Assert.All(roles, role => Assert.Same(scope, role.Scope)); 92Assert.All(roles, role => Assert.Same(scope, role.Scope));