From 059f8f1efee5e3bb75baff9c8fa3140ed677d936 Mon Sep 17 00:00:00 2001 From: "aspire-repo-bot[bot]" <268009190+aspire-repo-bot[bot]@users.noreply.github.com> Date: Fri, 7 Aug 2026 17:17:37 +0000 Subject: [PATCH 1/2] docs: document AzureBicepResourceScope.CreateForSubscription/CreateForTenant Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../cloud/azure/customize-resources.mdx | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/frontend/src/content/docs/integrations/cloud/azure/customize-resources.mdx b/src/frontend/src/content/docs/integrations/cloud/azure/customize-resources.mdx index 1a3aefc9d..0f0712017 100644 --- a/src/frontend/src/content/docs/integrations/cloud/azure/customize-resources.mdx +++ b/src/frontend/src/content/docs/integrations/cloud/azure/customize-resources.mdx @@ -552,6 +552,44 @@ await builder.build().run(); +### Set the deployment scope + +By default, Aspire deploys Bicep resources at the resource group scope. Some Bicep templates require a different [deployment scope](https://learn.microsoft.com/azure/azure-resource-manager/bicep/deploy-to-subscription), such as the subscription or the tenant. Set the `Scope` property on the Bicep resource using `AzureBicepResourceScope.CreateForSubscription` or `AzureBicepResourceScope.CreateForTenant`: + +```csharp title="AppHost.cs" +var builder = DistributedApplication.CreateBuilder(args); + +var subscriptionId = builder.AddParameter("subscriptionId"); + +var subscriptionScoped = builder.AddBicepTemplateString( + "subscriptionScoped", + """ + targetScope = 'subscription' + + param location string + + output value string = 'subscription' + """); +subscriptionScoped.Resource.Scope = AzureBicepResourceScope.CreateForSubscription(subscriptionId.Resource); + +var tenantScoped = builder.AddBicepTemplateString( + "tenantScoped", + """ + targetScope = 'tenant' + + param location string + + output value string = 'tenant' + """); +tenantScoped.Resource.Scope = AzureBicepResourceScope.CreateForTenant(); + +builder.Build().Run(); +``` + + + ### Inspect generated Bicep After customizing with `ConfigureInfrastructure`, inspect the Bicep that Aspire generates: From 9ec0e8c14efceefdc7a482e13525f98358a05b4f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Aug 2026 20:57:16 +0000 Subject: [PATCH 2/2] docs: clarify TypeScript support for Azure Bicep deployment scope Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> --- .../cloud/azure/customize-resources.mdx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/content/docs/integrations/cloud/azure/customize-resources.mdx b/src/frontend/src/content/docs/integrations/cloud/azure/customize-resources.mdx index 0f0712017..53ff46391 100644 --- a/src/frontend/src/content/docs/integrations/cloud/azure/customize-resources.mdx +++ b/src/frontend/src/content/docs/integrations/cloud/azure/customize-resources.mdx @@ -554,7 +554,12 @@ await builder.build().run(); ### Set the deployment scope -By default, Aspire deploys Bicep resources at the resource group scope. Some Bicep templates require a different [deployment scope](https://learn.microsoft.com/azure/azure-resource-manager/bicep/deploy-to-subscription), such as the subscription or the tenant. Set the `Scope` property on the Bicep resource using `AzureBicepResourceScope.CreateForSubscription` or `AzureBicepResourceScope.CreateForTenant`: +By default, Aspire deploys Bicep resources at the resource group scope. Some Bicep templates require a different [deployment scope](https://learn.microsoft.com/azure/azure-resource-manager/bicep/deploy-to-subscription), such as the subscription or the tenant. + + + + +Set the `Scope` property on the Bicep resource using `AzureBicepResourceScope.CreateForSubscription` or `AzureBicepResourceScope.CreateForTenant`: ```csharp title="AppHost.cs" var builder = DistributedApplication.CreateBuilder(args); @@ -590,6 +595,16 @@ builder.Build().Run(); `targetScope` in the Bicep template must match the scope you assign in C#. `CreateForSubscription` requires a subscription identifier; `CreateForTenant` targets the current tenant and takes no arguments. + + + + + + + + ### Inspect generated Bicep After customizing with `ConfigureInfrastructure`, inspect the Bicep that Aspire generates: