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:
Kevin Cunnane
2017-10-09 15:45:33 -07:00
committed by GitHub
parent fecf56bce2
commit 7acc668c04
49 changed files with 1844 additions and 556 deletions

View File

@@ -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));