AzureServiceBusExtensions.WithConfiguration Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Alters the JSON configuration document used by the emulator.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureServiceBusEmulatorResource> WithConfiguration(this Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureServiceBusEmulatorResource> builder, Action<System.Text.Json.Nodes.JsonNode> configJson);
static member WithConfiguration : Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureServiceBusEmulatorResource> * Action<System.Text.Json.Nodes.JsonNode> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureServiceBusEmulatorResource>
<Extension()>
Public Function WithConfiguration (builder As IResourceBuilder(Of AzureServiceBusEmulatorResource), configJson As Action(Of JsonNode)) As IResourceBuilder(Of AzureServiceBusEmulatorResource)
Parameters
The builder for the AzureServiceBusEmulatorResource.
A callback to update the JSON object representation of the configuration.
Returns
A reference to the IResourceBuilder<T>.
Examples
Here is an example of how to configure the emulator to use a different logging mechanism:
var builder = DistributedApplication.CreateBuilder(args);
builder.AddAzureServiceBus("servicebusns")
.RunAsEmulator(configure => configure
.WithConfiguration(document =>
{
document["UserConfig"]!["Logging"] = new JsonObject { ["Type"] = "Console" };
});
);