55 writes to Scope
Aspire.Hosting.Azure (3)
AzureProvisioningResource.cs (3)
30roleAssignment.Scope = GetResourceReferenceScope(this); 107roleAssignment.Scope = scope; 182infrastructure.AspireResource.Scope ??= scope;
Aspire.Hosting.Azure.EntraId.Tests (1)
EntraIdProvisioningTests.cs (1)
845entra.Resource.Scope = tenantScoped
Aspire.Hosting.Azure.Kubernetes (2)
AzureKubernetesEnvironmentExtensions.cs (2)
164controlPlaneIdentity.Resource.Scope = resource.Scope; 165kubeletIdentity.Resource.Scope = resource.Scope;
Aspire.Hosting.Azure.Kubernetes.Tests (15)
AzureKubernetesEnvironmentExtensionsTests.cs (12)
575aks.Resource.Scope = new AzureBicepResourceScope( 578aks.ConfigureInfrastructure(infrastructure => infrastructure.AspireResource.Scope = supportingScope); 582aks.Resource.Scope = supportingScope; 626aks.Resource.Scope = new AzureBicepResourceScope("initial-rg", "initial-subscription"); 628infrastructure.AspireResource.Scope = new AzureBicepResourceScope("supporting-rg", "cluster-subscription")); 633Scope = new AzureBicepResourceScope("consumer-rg", "consumer-subscription") 1004infrastructure.AspireResource.Scope = new AzureBicepResourceScope( 1110aks.ConfigureInfrastructure(infrastructure => infrastructure.AspireResource.Scope = scope); 1114aks.Resource.Scope = scope; 1169registry.Resource.Scope = new AzureBicepResourceScope("explicit-rg", "00000000-0000-0000-0000-000000000001"); 1200registry.ConfigureInfrastructure(infrastructure => infrastructure.AspireResource.Scope = registryScope); 1201network.ConfigureInfrastructure(infrastructure => infrastructure.AspireResource.Scope = networkScope);
AzureKubernetesInfrastructureTests.cs (3)
620aks.Resource.Scope = new AzureBicepResourceScope( 1752aks.Resource.Scope = new AzureBicepResourceScope(scopeResourceGroup, scopeSubscriptionId); 1830aks.Resource.Scope = AzureBicepResourceScope.CreateForSubscription(subscriptionId);
Aspire.Hosting.Azure.Tests (34)
AzureApiManagementTests.cs (4)
1813account.Resource.Scope = new AzureBicepResourceScope("ai-resources"); 1930apim.Resource.Scope = new AzureBicepResourceScope("gateway-resources"); 1995vault.Resource.Scope = new AzureBicepResourceScope("security-resources"); 2307apim.Resource.Scope = new AzureBicepResourceScope("override-gateway-rg", "override-gateway-subscription");
AzureBicepProvisionerTests.cs (6)
288resource.Scope = AzureBicepResourceScope.CreateForSubscription(subscription.Id.Name); 324resource.Scope = AzureBicepResourceScope.CreateForSubscription(subscription.Id.Name); 357resource.Scope = AzureBicepResourceScope.CreateForTenant(); 391resource.Scope = new AzureBicepResourceScope(existingResourceGroup.Name, scopedSubscriptionId); 489resource.Scope = AzureBicepResourceScope.CreateForSubscription(subscription.Id.Name); 867Scope = AzureBicepResourceScope.CreateForSubscription(subscription.Id.Name)
AzureEnvironmentResourceExtensionsTests.cs (1)
205arm.Resource.Scope = AzureBicepResourceScope.CreateForTenant();
AzureEnvironmentResourceTests.cs (4)
340resourceGroupScoped.Resource.Scope = new(resourceGroup.Resource, subscription.Resource); 350subscriptionScoped.Resource.Scope = AzureBicepResourceScope.CreateForSubscription(subscription.Resource); 360tenantScoped.Resource.Scope = AzureBicepResourceScope.CreateForTenant(); 498module.Resource.Scope = AzureBicepResourceScope.CreateForTenant();
AzureKeyVaultTests.cs (1)
158module2.Resource.Scope = new(existingRg.Resource);
AzureResourcePreparerTests.cs (3)
34storage.Resource.Scope = scope; 71storage.Resource.Scope = new AzureBicepResourceScope("initial-rg"); 72storage.ConfigureInfrastructure(infrastructure => infrastructure.AspireResource.Scope = scope);
BicepUtilitiesTests.cs (13)
34resource.Scope = new AzureBicepResourceScope("module-rg", "module-subscription"); 124resource.Scope = explicitScope; 131Scope = new AzureBicepResourceScope("consumer-rg", "consumer-subscription") 383bicep0.Resource.Scope = new("rg0"); 387bicep1.Resource.Scope = new("rg1"); 411bicep0.Resource.Scope = new("rg0"); 415bicep1.Resource.Scope = new("rg0"); 565bicep.Scope = new("test-rg"); 580bicep.Scope = new("test-rg", "12345678-1234-1234-1234-123456789012"); 596bicep.Scope = AzureBicepResourceScope.CreateForSubscription("12345678-1234-1234-1234-123456789012"); 611bicep.Scope = AzureBicepResourceScope.CreateForSubscription("12345678-1234-1234-1234-123456789012"); 630bicep.Scope = AzureBicepResourceScope.CreateForTenant(); 717bicep.Scope = AzureBicepResourceScope.CreateForSubscription("12345678-1234-1234-1234-123456789012");
ExistingAzureResourceTests.cs (2)
588resource.Resource.Scope = AzureBicepResourceScope.CreateForSubscription(existingSubscriptionId.Resource); 607resource.Resource.Scope = AzureBicepResourceScope.CreateForTenant();
51 references to Scope
Aspire.Hosting.Azure (14)
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)
247(isComputeSourceTemplate || !ScopeEquals(scope, infra.AspireResource.Scope))) 257var moduleScope = (resource as AzureBicepResource)?.Scope;
AzurePublishingContext.cs (3)
212if (resource.Scope is { } scope) 346if (resource.Scope is null) 351var scope = resource.Scope;
Provisioning\BicepUtilities.cs (3)
190return provisioningResource.Scope; 193if (resource.Scope is not null) 195return resource.Scope;
Aspire.Hosting.Azure.EntraId (1)
EntraIdApplicationResource.cs (1)
249if (Scope is { HasResourceGroup: false })
Aspire.Hosting.Azure.Kubernetes (2)
AzureKubernetesEnvironmentExtensions.cs (2)
164controlPlaneIdentity.Resource.Scope = resource.Scope; 165kubeletIdentity.Resource.Scope = resource.Scope;
Aspire.Hosting.Azure.Kubernetes.Tests (20)
AzureKubernetesEnvironmentExtensionsTests.cs (20)
601Assert.Same(supportingScope, aks.Resource.Scope); 602Assert.Same(clusterGroup.Resource, roles.Resource.Scope!.ResourceGroup); 605roles.Resource.Scope.Subscription); 814Assert.NotNull(roles.Scope); 854Assert.Equal("final-rg", provisioningRoles.Scope!.ResourceGroup); 894Assert.Null(roles.Scope); 1069Assert.Equal("final-rg", role.Scope!.ResourceGroup); 1075Assert.Equal("final-rg", role.Scope!.ResourceGroup); 1120Assert.Same(scope, aks.Resource.ControlPlaneIdentity!.Scope); 1121Assert.Same(scope, aks.Resource.KubeletIdentity!.Scope); 1125Assert.Same(scope, operatorRole.Scope); 1129Assert.Null(registryRole.Scope); 1177Assert.Same(registry.Resource.Scope, roles.Scope); 1212Assert.Same(registryScope, registry.Resource.Scope); 1213Assert.Same(registryScope, registryRole.Scope); 1215Assert.Same(networkScope, network.Resource.Scope); 1216Assert.Same(networkScope, networkRole.Scope); 1270Assert.Equal("network-rg", role.Scope!.ResourceGroup); 1277Assert.Null(role.Scope);
Aspire.Hosting.Azure.Tests (14)
AzureApiManagementTests.cs (4)
1835Assert.Equal("ai-resources", roleAssignments.Scope!.ResourceGroup); 1943Assert.Null(roleAssignments.Scope); 1980Assert.Null(roles.Scope); 2018Assert.Equal("security-resources", roleAssignments.Scope!.ResourceGroup);
AzureResourcePreparerTests.cs (6)
43Assert.Same(scope, roles.Scope); 47Assert.Same(scope, storage.Resource.Scope); 48Assert.Same(scope, roles.Scope); 87Assert.Same(scope, storage.Resource.Scope); 88Assert.All(roles, role => Assert.Same(scope, role.Scope)); 93Assert.All(roles, role => Assert.Same(scope, role.Scope));
BicepUtilitiesTests.cs (4)
63Assert.Equal("existing-rg", roles.Scope!.ResourceGroup); 64Assert.Equal("existing-subscription", roles.Scope.Subscription); 141Assert.Same(explicitScope, resource.Scope); 142Assert.Same(explicitScope, roles.Scope);