Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,60 +205,7 @@ The selected models in the table aren't all no-argument lookup roots:
- **App Service**: Use `getAppServicePlanByIdentifier(...)` with the environment's Bicep identifier followed by `_asplan`. Sites use the Bicep identifier `webapp` and must be accessed in the website publish callback, not the environment callback. Neither plans nor sites have a no-argument root lookup.
- **Child resources**: Use identifier-based lookup for resources such as Kusto databases. Don't assume the parent resource's no-argument lookup selects a child.

For example, add a tag to the App Configuration store that Aspire creates. The infrastructure callback runs before Aspire emits the resource's Bicep; the lookup selects the store within that callback, rather than querying an existing Azure deployment.

<Tabs syncKey="aspire-lang">
<TabItem id="typescript" label="TypeScript">

Add the App Configuration provisioning package from your AppHost directory:

```bash title="Add typed App Configuration customization"
aspire add Aspire.Hosting.Azure.Provisioning.AppConfiguration
```

```typescript title="apphost.mts" twoslash
import { createBuilder } from './.aspire/modules/aspire.mjs';

const builder = await createBuilder();
const configuration = await builder.addAzureAppConfiguration('configuration');

await configuration.configureInfrastructure(async (infrastructure) => {
const store = await infrastructure.getAppConfigurationStore();
const tags = await store.tags.get();
await tags.set('environment', 'production');
});

await builder.build().run();
```

</TabItem>
<TabItem id="csharp" label="C#">

Add the hosting integration; C# accesses the Azure Provisioning SDK directly:

```bash title="Add App Configuration hosting integration"
aspire add Aspire.Hosting.Azure.AppConfiguration
```

```csharp title="AppHost.cs"
using Azure.Provisioning.AppConfiguration;

var builder = DistributedApplication.CreateBuilder(args);
var configuration = builder.AddAzureAppConfiguration("configuration");

configuration.ConfigureInfrastructure(infrastructure =>
{
var store = infrastructure.GetProvisionableResources()
.OfType<AppConfigurationStore>()
.Single();
store.Tags["environment"] = "production";
});

builder.Build().Run();
```

</TabItem>
</Tabs>
For a complete TypeScript and C# example using Azure Storage, see [Basic infrastructure customization](#basic-infrastructure-customization). The example looks up the storage account inside its infrastructure callback and adds tags. The callback runs before Aspire emits the resource's Bicep; the lookup selects a generated resource rather than querying an existing Azure deployment.

### IP address collections and projection limits

Expand Down
Loading