Skip to content

Commit

Permalink
Remove obsolete APIs. (dotnet#3329)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchdenny authored and radical committed Apr 3, 2024
1 parent 2de4678 commit cbcc9f9
Show file tree
Hide file tree
Showing 17 changed files with 0 additions and 460 deletions.
24 changes: 0 additions & 24 deletions src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,30 +110,6 @@ public static IResourceBuilder<AzureStorageResource> RunAsEmulator(this IResourc
return builder;
}

/// <summary>
/// Configures an Azure Storage resource to be emulated using Azurite. This resource requires an <see cref="AzureStorageResource"/> to be added to the application model. This version the package defaults to version 3.29.0 of the mcr.microsoft.com/azure-storage/azurite container image.
/// </summary>
/// <param name="builder">The Azure storage resource builder.</param>
/// <param name="configureContainer">Callback that exposes underlying container used for emulation to allow for customization.</param>
/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
[Obsolete("Renamed to RunAsEmulator. Will be removed in next preview.")]
public static IResourceBuilder<AzureStorageResource> UseEmulator(this IResourceBuilder<AzureStorageResource> builder, Action<IResourceBuilder<AzureStorageEmulatorResource>>? configureContainer = null)
{
return builder.RunAsEmulator(configureContainer);
}

/// <summary>
/// Enables persistence in the Azure Storage emulator.
/// </summary>
/// <param name="builder">The builder for the <see cref="AzureStorageEmulatorResource"/>.</param>
/// <param name="path">Relative path to the AppHost where emulator storage is persisted between runs.</param>
/// <returns>A builder for the <see cref="AzureStorageEmulatorResource"/>.</returns>
[Obsolete("Use WithDataBindMount or WithDataVolume instead. Will be removed in next preview.")]
public static IResourceBuilder<AzureStorageEmulatorResource> UsePersistence(this IResourceBuilder<AzureStorageEmulatorResource> builder, string? path = null)
{
return builder.WithDataBindMount(path);
}

/// <summary>
/// Adds a bind mount for the data folder to an Azure Storage emulator resource.
/// </summary>
Expand Down
8 changes: 0 additions & 8 deletions src/Aspire.Hosting.Azure/AzureBicepResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,6 @@ public virtual string GetBicepTemplateString()
return File.ReadAllText(TemplateFile);
}

/// TODO: Remove this method once AppInsights CDK is removed.
/// <summary>
/// Create a Bicep identifier safe version of the resource name.
/// </summary>
/// <returns>A string which is safe to use as a Bicep identifier.</returns>
[Obsolete("This method is obsolete and will be removed before release.")]
public string CreateBicepResourceName() => Name.ToLower(); // Insufficient but we don't care because its going to be deleted.

/// <summary>
/// Writes the resource to the manifest.
/// </summary>
Expand Down
15 changes: 0 additions & 15 deletions src/Aspire.Hosting.Oracle/OracleDatabaseBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,6 @@ public static class OracleDatabaseBuilderExtensions
{
private const string PasswordEnvVarName = "ORACLE_PWD";

/// <summary>
/// Adds a Oracle Database resource to the application model. A container is used for local development. This version the package defaults to the 23.3.0.0 tag of the container-registry.oracle.com/database/free container image
/// </summary>
/// <param name="builder">The <see cref="IDistributedApplicationBuilder"/>.</param>
/// <param name="name">The name of the resource. This name will be used as the connection string name when referenced in a dependency.</param>
/// <param name="port">The host port for Oracle Database.</param>
/// <param name="password">The password for the Oracle Database container. Defaults to a random password.</param>
/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
[Obsolete("Use AddOracle instead", error: true)]
public static IResourceBuilder<OracleDatabaseServerResource> AddOracleDatabase(this IDistributedApplicationBuilder builder, string name, int? port = null, string? password = null)
{
// can't simulate the old behavior with taking a string password and converting it to a Parameter
throw new NotSupportedException();
}

/// <summary>
/// Adds a Oracle Server resource to the application model. A container is used for local development. This version the package defaults to the 23.3.0.0 tag of the container-registry.oracle.com/database/free container image
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ namespace Aspire.Hosting.ApplicationModel;
/// <param name="cancellationToken">A <see cref="CancellationToken"/>.</param>
public class EnvironmentCallbackContext(DistributedApplicationExecutionContext executionContext, Dictionary<string, object>? environmentVariables = null, CancellationToken cancellationToken = default)
{
/// <summary>
/// Obsolete. Use ExecutionContext instead. Will be removed in next preview.
/// </summary>
[Obsolete("Use ExecutionContext instead")]
public string PublisherName => ExecutionContext.IsPublishMode ? "manifest" : "dcp";

/// <summary>
/// Gets the environment variables associated with the callback context.
/// </summary>
Expand Down
12 changes: 0 additions & 12 deletions src/Aspire.Hosting/ExecutableResourceBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@ public static IResourceBuilder<ExecutableResource> AddExecutable(this IDistribut
});
}

/// <summary>
/// Adds annotation to <see cref="ExecutableResource" /> to support containerization during deployment.
/// </summary>
/// <typeparam name="T">Type of executable resource</typeparam>
/// <param name="builder">Resource builder</param>
/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
[Obsolete("Use PublishAsDockerFile instead")]
public static IResourceBuilder<T> AsDockerfileInManifest<T>(this IResourceBuilder<T> builder) where T : ExecutableResource
{
return builder.PublishAsDockerFile();
}

/// <summary>
/// Adds annotation to <see cref="ExecutableResource" /> to support containerization during deployment.
/// The resulting container image is built, and when the optional <paramref name="buildArgs"/> are provided
Expand Down
23 changes: 0 additions & 23 deletions src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,29 +200,6 @@ public static IResourceBuilder<ExecutableResource> WithReplicas(this IResourceBu
return builder;
}

/// <summary>
/// Configures which launch profile should be used when running the project.
/// </summary>
/// <param name="builder">The project resource builder.</param>
/// <param name="launchProfileName">The name of the launch profile to use for execution.</param>
/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
[Obsolete("This API is replaced by the AddProject overload that accepts a launchProfileName. Method will be removed by GA.")]
public static IResourceBuilder<ProjectResource> WithLaunchProfile(this IResourceBuilder<ProjectResource> builder, string launchProfileName)
{
throw new InvalidOperationException("This API is replaced by the AddProject overload that accepts a launchProfileName. Method will be removed by GA.");
}

/// <summary>
/// Configures the project to exclude launch profile settings when running.
/// </summary>
/// <param name="builder">The project resource builder.</param>
/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
[Obsolete("This API is replaced by the AddProject overload that accepts a launchProfileName. Null means exclude launch profile. Method will be removed by GA.")]
public static IResourceBuilder<ProjectResource> ExcludeLaunchProfile(this IResourceBuilder<ProjectResource> builder)
{
throw new InvalidOperationException("This API is replaced by the AddProject overload that accepts a launchProfileName. Null means exclude launch profile. Method will be removed by GA.");
}

/// <summary>
/// Configures the project to disable forwarded headers when being published.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,6 @@ public static class AspireAzureOpenAIExtensions
{
private const string DefaultConfigSectionName = "Aspire:Azure:AI:OpenAI";

/// <summary>
/// Registers <see cref="OpenAIClient"/> as a singleton in the services provided by the <paramref name="builder"/>.
/// </summary>
/// <param name="builder">The <see cref="IHostApplicationBuilder" /> to read config from and add services to.</param>
/// <param name="connectionName">A name used to retrieve the connection string from the ConnectionStrings configuration section.</param>
/// <param name="configureSettings">An optional method that can be used for customizing the <see cref="AzureOpenAISettings"/>. It's invoked after the settings are read from the configuration.</param>
/// <param name="configureClientBuilder">An optional method that can be used for customizing the <see cref="IAzureClientBuilder{OpenAIClient, OpenAIClientOptions}"/>.</param>
/// <remarks>Reads the configuration from "Aspire.Azure.AI.OpenAI" section.</remarks>
[Obsolete($"This method is obsolete and will be removed in a future version. Use {nameof(AddAzureOpenAIClient)} instead.")]
public static void AddAzureOpenAI(
this IHostApplicationBuilder builder,
string connectionName,
Action<AzureOpenAISettings>? configureSettings = null,
Action<IAzureClientBuilder<OpenAIClient, OpenAIClientOptions>>? configureClientBuilder = null)
=> AddAzureOpenAIClient(builder, connectionName, configureSettings, configureClientBuilder);

/// <summary>
/// Registers <see cref="OpenAIClient"/> as a singleton in the services provided by the <paramref name="builder"/>.
/// </summary>
Expand All @@ -55,22 +39,6 @@ public static void AddAzureOpenAIClient(
new OpenAIComponent().AddClient(builder, DefaultConfigSectionName, configureSettings, configureClientBuilder, connectionName, serviceKey: null);
}

/// <summary>
/// Registers <see cref="OpenAIClient"/> as a singleton for given <paramref name="name"/> in the services provided by the <paramref name="builder"/>.
/// </summary>
/// <param name="builder">The <see cref="IHostApplicationBuilder" /> to read config from and add services to.</param>
/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
/// <param name="configureSettings">An optional method that can be used for customizing the <see cref="AzureOpenAISettings"/>. It's invoked after the settings are read from the configuration.</param>
/// <param name="configureClientBuilder">An optional method that can be used for customizing the <see cref="IAzureClientBuilder{OpenAIClient, OpenAIClientOptions}"/>.</param>
/// <remarks>Reads the configuration from "Aspire.Azure.AI.OpenAI:{name}" section.</remarks>
[Obsolete($"This method is obsolete and will be removed in a future version. Use {nameof(AddKeyedAzureOpenAIClient)} instead.")]
public static void AddKeyedAzureOpenAI(
this IHostApplicationBuilder builder,
string name,
Action<AzureOpenAISettings>? configureSettings = null,
Action<IAzureClientBuilder<OpenAIClient, OpenAIClientOptions>>? configureClientBuilder = null)
=> AddKeyedAzureOpenAIClient(builder, name, configureSettings, configureClientBuilder);

/// <summary>
/// Registers <see cref="OpenAIClient"/> as a singleton for given <paramref name="name"/> in the services provided by the <paramref name="builder"/>.
/// </summary>
Expand Down
36 changes: 0 additions & 36 deletions src/Components/Aspire.Azure.Data.Tables/AspireTablesExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,6 @@ public static class AspireTablesExtensions
{
private const string DefaultConfigSectionName = "Aspire:Azure:Data:Tables";

/// <summary>
/// Registers <see cref="TableServiceClient"/> as a singleton in the services provided by the <paramref name="builder"/>.
/// Enables retries, corresponding health check, logging and telemetry.
/// </summary>
/// <param name="builder">The <see cref="IHostApplicationBuilder" /> to read config from and add services to.</param>
/// <param name="connectionName">A name used to retrieve the connection string from the ConnectionStrings configuration section.</param>
/// <param name="configureSettings">An optional method that can be used for customizing the <see cref="AzureDataTablesSettings"/>. It's invoked after the settings are read from the configuration.</param>
/// <param name="configureClientBuilder">An optional method that can be used for customizing the <see cref="IAzureClientBuilder{TClient, TOptions}"/>.</param>
/// <remarks>Reads the configuration from "Aspire:Azure:Data:Tables" section.</remarks>
/// <exception cref="InvalidOperationException">Thrown when neither <see cref="AzureDataTablesSettings.ConnectionString"/> nor <see cref="AzureDataTablesSettings.ServiceUri"/> is provided.</exception>
[Obsolete($"This method is obsolete and will be removed in a future version. Use {nameof(AddAzureTableClient)} instead.")]
public static void AddAzureTableService(
this IHostApplicationBuilder builder,
string connectionName,
Action<AzureDataTablesSettings>? configureSettings = null,
Action<IAzureClientBuilder<TableServiceClient, TableClientOptions>>? configureClientBuilder = null)
=> AddAzureTableClient(builder, connectionName, configureSettings, configureClientBuilder);

/// <summary>
/// Registers <see cref="TableServiceClient"/> as a singleton in the services provided by the <paramref name="builder"/>.
/// Enables retries, corresponding health check, logging and telemetry.
Expand All @@ -58,24 +40,6 @@ public static void AddAzureTableClient(
new TableServiceComponent().AddClient(builder, DefaultConfigSectionName, configureSettings, configureClientBuilder, connectionName, serviceKey: null);
}

/// <summary>
/// Registers <see cref="TableServiceClient"/> as a singleton for given <paramref name="name"/> in the services provided by the <paramref name="builder"/>.
/// Enables retries, corresponding health check, logging and telemetry.
/// </summary>
/// <param name="builder">The <see cref="IHostApplicationBuilder" /> to read config from and add services to.</param>
/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
/// <param name="configureSettings">An optional method that can be used for customizing the <see cref="AzureDataTablesSettings"/>. It's invoked after the settings are read from the configuration.</param>
/// <param name="configureClientBuilder">An optional method that can be used for customizing the <see cref="IAzureClientBuilder{TClient, TOptions}"/>.</param>
/// <remarks>Reads the configuration from "Aspire:Azure:Data:Tables:{name}" section.</remarks>
/// <exception cref="InvalidOperationException">Thrown when neither <see cref="AzureDataTablesSettings.ConnectionString"/> nor <see cref="AzureDataTablesSettings.ServiceUri"/> is provided.</exception>
[Obsolete($"This method is obsolete and will be removed in a future version. Use {nameof(AddKeyedAzureTableClient)} instead.")]
public static void AddKeyedAzureTableService(
this IHostApplicationBuilder builder,
string name,
Action<AzureDataTablesSettings>? configureSettings = null,
Action<IAzureClientBuilder<TableServiceClient, TableClientOptions>>? configureClientBuilder = null)
=> AddKeyedAzureTableClient(builder, name, configureSettings, configureClientBuilder);

/// <summary>
/// Registers <see cref="TableServiceClient"/> as a singleton for given <paramref name="name"/> in the services provided by the <paramref name="builder"/>.
/// Enables retries, corresponding health check, logging and telemetry.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,6 @@ public static class AspireServiceBusExtensions
{
private const string DefaultConfigSectionName = "Aspire:Azure:Messaging:ServiceBus";

/// <summary>
/// Registers <see cref="ServiceBusClient"/> as a singleton in the services provided by the <paramref name="builder"/>.
/// </summary>
/// <param name="builder">The <see cref="IHostApplicationBuilder" /> to read config from and add services to.</param>
/// <param name="connectionName">A name used to retrieve the connection string from the ConnectionStrings configuration section.</param>
/// <param name="configureSettings">An optional method that can be used for customizing the <see cref="AzureMessagingServiceBusSettings"/>. It's invoked after the settings are read from the configuration.</param>
/// <param name="configureClientBuilder">An optional method that can be used for customizing the <see cref="IAzureClientBuilder{TClient, TOptions}"/>.</param>
/// <remarks>Reads the configuration from "Aspire:Azure:Messaging:ServiceBus" section.</remarks>
/// <exception cref="InvalidOperationException">Thrown when neither <see cref="AzureMessagingServiceBusSettings.ConnectionString"/> nor <see cref="AzureMessagingServiceBusSettings.Namespace"/> is provided.</exception>
[Obsolete($"This method is obsolete and will be removed in a future version. Use {nameof(AddAzureServiceBusClient)} instead.")]
public static void AddAzureServiceBus(
this IHostApplicationBuilder builder,
string connectionName,
Action<AzureMessagingServiceBusSettings>? configureSettings = null,
Action<IAzureClientBuilder<ServiceBusClient, ServiceBusClientOptions>>? configureClientBuilder = null)
=> AddAzureServiceBusClient(builder, connectionName, configureSettings, configureClientBuilder);

/// <summary>
/// Registers <see cref="ServiceBusClient"/> as a singleton in the services provided by the <paramref name="builder"/>.
/// </summary>
Expand All @@ -57,23 +40,6 @@ public static void AddAzureServiceBusClient(
new MessageBusComponent().AddClient(builder, DefaultConfigSectionName, configureSettings, configureClientBuilder, connectionName, serviceKey: null);
}

/// <summary>
/// Registers <see cref="ServiceBusClient"/> as a singleton for given <paramref name="name"/> in the services provided by the <paramref name="builder"/>.
/// </summary>
/// <param name="builder">The <see cref="IHostApplicationBuilder" /> to read config from and add services to.</param>
/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
/// <param name="configureSettings">An optional method that can be used for customizing the <see cref="AzureMessagingServiceBusSettings"/>. It's invoked after the settings are read from the configuration.</param>
/// <param name="configureClientBuilder">An optional method that can be used for customizing the <see cref="IAzureClientBuilder{TClient, TOptions}"/>.</param>
/// <remarks>Reads the configuration from "Aspire:Azure:Messaging:ServiceBus:{name}" section.</remarks>
/// <exception cref="InvalidOperationException">Thrown when neither <see cref="AzureMessagingServiceBusSettings.ConnectionString"/> nor <see cref="AzureMessagingServiceBusSettings.Namespace"/> is provided.</exception>
[Obsolete($"This method is obsolete and will be removed in a future version. Use {nameof(AddKeyedAzureServiceBusClient)} instead.")]
public static void AddKeyedAzureServiceBus(
this IHostApplicationBuilder builder,
string name,
Action<AzureMessagingServiceBusSettings>? configureSettings = null,
Action<IAzureClientBuilder<ServiceBusClient, ServiceBusClientOptions>>? configureClientBuilder = null)
=> AddKeyedAzureServiceBusClient(builder, name, configureSettings, configureClientBuilder);

/// <summary>
/// Registers <see cref="ServiceBusClient"/> as a singleton for given <paramref name="name"/> in the services provided by the <paramref name="builder"/>.
/// </summary>
Expand Down
Loading

0 comments on commit cbcc9f9

Please sign in to comment.