Skip to content

Commit

Permalink
Use correct method name in ServiceBus (#1757)
Browse files Browse the repository at this point in the history
* Use correct method name in ServiceBus

* Remove named instances section.
  • Loading branch information
eerhardt authored Oct 4, 2024
1 parent f4f6b9e commit 60944f9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 91 deletions.
33 changes: 3 additions & 30 deletions docs/messaging/azure-service-bus-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,55 +113,28 @@ The Service Bus integration supports <xref:Microsoft.Extensions.Configuration?di
}
```

If you have set up your configurations in the `Aspire:Azure:Messaging:ServiceBus` section of your _:::no-loc text="appsettings.json":::_ file you can just call the method `AddAzureServiceBus` without passing any parameters.
If you have set up your configurations in the `Aspire:Azure:Messaging:ServiceBus` section of your _:::no-loc text="appsettings.json":::_ file you can just call the method `AddAzureServiceBusClient` without passing any parameters.

### Use inline delegates

You can also pass the `Action<AzureMessagingServiceBusSettings>` delegate to set up some or all the options inline, for example to set the `FullyQualifiedNamespace`:

```csharp
builder.AddAzureServiceBus(
builder.AddAzureServiceBusClient(
"messaging",
static settings => settings.FullyQualifiedNamespace = "YOUR_SERVICE_BUS_NAMESPACE");
```

You can also set up the [ServiceBusClientOptions](/dotnet/api/azure.messaging.servicebus.servicebusclientoptions) using `Action<IAzureClientBuilder<ServiceBusClient, ServiceBusClientOptions>>` delegate, the second parameter of the `AddAzureServiceBus` method. For example to set the `ServiceBusClient` ID to identify the client:

```csharp
builder.AddAzureServiceBus(
builder.AddAzureServiceBusClient(
"messaging",
static clientBuilder =>
clientBuilder.ConfigureOptions(
static options => options.Identifier = "CLIENT_ID"));
```

### Named instances

If you want to add more than one [ServiceBusClient](/dotnet/api/azure.messaging.servicebus.servicebusclient) you can use named instances. Load the named configuration section from the JSON config by calling the `AddAzureServiceBus` method and passing in the `INSTANCE_NAME`.

```csharp
builder.AddAzureServiceBus("INSTANCE_NAME");
```

The corresponding configuration JSON is defined as follows:

```json
{
"Aspire": {
"Azure": {
"Messaging": {
"INSTANCE_NAME": {
"FullyQualifiedNamespace": "YOUR_SERVICE_BUS_NAMESPACE",
"ClientOptions": {
"Identifier": "CLIENT_ID"
}
}
}
}
}
}
```

### Configuration options

The following configurable options are exposed through the <xref:Aspire.Azure.Messaging.ServiceBus.AzureMessagingServiceBusSettings> class:
Expand Down
31 changes: 0 additions & 31 deletions docs/security/azure-security-key-vault-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,37 +155,6 @@ builder.AddAzureKeyVaultSecrets(
static options => options.DisableChallengeResourceVerification = true))
```

### Named instances

If you want to add more than one `SecretClient` you can use named instances. Load the named configuration section from the json config by calling the `AddAzureKeyVaultSecrets` method and passing in the `INSTANCE_NAME`.

```csharp
builder.AddAzureKeyVaultSecrets("INSTANCE_NAME");
```

The corresponding configuration JSON is defined as follows:

```json
{
"Aspire": {
"Azure": {
"Security": {
"KeyVault": {
"INSTANCE_NAME": {
"VaultUri": "YOUR_VAULT_URI",
"DisableHealthChecks": false,
"DisableTracing": true,
"ClientOptions": {
"DisableChallengeResourceVerification": true
}
}
}
}
}
}
}
```

### Configuration options

The following configurable options are exposed through the <xref:Aspire.Azure.Security.KeyVault.AzureSecurityKeyVaultSettings> class:
Expand Down
30 changes: 0 additions & 30 deletions docs/storage/azure-storage-tables-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,36 +137,6 @@ builder.AddAzureTableClient(
static options => options.EnableTenantDiscovery = true));
```

### Named instances

If you want to add more than one <xref:Azure.Data.Tables.TableServiceClient> you can use named instances. Load the named configuration section from the json config by calling the `AddAzureTableClient` method and passing in the `INSTANCE_NAME`.

```csharp
builder.AddAzureTableClient("INSTANCE_NAME");
```

The corresponding configuration JSON is defined as follows:

```json
{
"Aspire":{
"Azure": {
"Data": {
"Tables": {
"INSTANCE_NAME": {
"ServiceUri": "YOUR_URI",
"DisableHealthChecks": true,
"ClientOptions": {
"EnableTenantDiscovery": true
}
}
}
}
}
}
}
```

### Configuration options

The following configurable options are exposed through the <xref:Aspire.Azure.Data.Tables.AzureDataTablesSettings> class:
Expand Down

0 comments on commit 60944f9

Please sign in to comment.