mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-19 01:25:40 -05:00
Create Firewall Rule support with a simple Resource Provider implementation
Implementation of the resource provider APIs in order to support Create Firewall Rule. Provides definition for a ResourceProvider and Authentication service. The ResourceProvider supports firewall rules for now, and since authentication is routed through that method it will call into the auth service to set up the current account to be used. Additional notes: - Fixed deserialization by adding an Accept header. This shouldn't be necessary, but for some reason the firewall rule defaults to XML without this - Use generic server list and parse the ID to get the resource group, avoiding a large number of extra calls for each RG - Errors now include error message from the API
This commit is contained in:
@@ -11,11 +11,11 @@ using Microsoft.SqlTools.Utility;
|
||||
namespace Microsoft.SqlTools.ResourceProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Main application class for Credentials Service Host executable
|
||||
/// Main application class for the executable that supports the resource provider and identity services
|
||||
/// </summary>
|
||||
internal class Program
|
||||
{
|
||||
private const string ServiceName = "SqlToolsAzure.exe";
|
||||
private const string ServiceName = "SqlToolsResourceProviderService.exe";
|
||||
|
||||
/// <summary>
|
||||
/// Main entry point into the Credentials Service Host
|
||||
@@ -31,7 +31,7 @@ namespace Microsoft.SqlTools.ResourceProvider
|
||||
return;
|
||||
}
|
||||
|
||||
string logFilePath = "sqltoolsazure";
|
||||
string logFilePath = "SqlToolsResourceProviderService";
|
||||
if (!string.IsNullOrWhiteSpace(commandOptions.LoggingDirectory))
|
||||
{
|
||||
logFilePath = Path.Combine(commandOptions.LoggingDirectory, logFilePath);
|
||||
@@ -40,11 +40,11 @@ namespace Microsoft.SqlTools.ResourceProvider
|
||||
// turn on Verbose logging during early development
|
||||
// we need to switch to Normal when preparing for public preview
|
||||
Logger.Initialize(logFilePath: logFilePath, minimumLogLevel: LogLevel.Verbose, isEnabled: commandOptions.EnableLogging);
|
||||
Logger.Write(LogLevel.Normal, "Starting SqlTools Azure Provider");
|
||||
Logger.Write(LogLevel.Normal, "Starting SqlTools Resource Provider");
|
||||
|
||||
// set up the host details and profile paths
|
||||
var hostDetails = new HostDetails(
|
||||
name: "SqlTools Azure Provider",
|
||||
name: "SqlTools Resource Provider",
|
||||
profileId: "Microsoft.SqlTools.ResourceProvider",
|
||||
version: new Version(1, 0));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user