command line creds
This commit is contained in:
parent
921a8b4ffc
commit
c6f9e2ab18
@ -21,6 +21,12 @@ namespace BismNormalizer.CommandLine
|
|||||||
string logFile = null;
|
string logFile = null;
|
||||||
string scriptFile = null;
|
string scriptFile = null;
|
||||||
List<string> skipOptions = null;
|
List<string> skipOptions = null;
|
||||||
|
bool credsProvided = false;
|
||||||
|
string sourceUsername = "";
|
||||||
|
string sourcePassword = "";
|
||||||
|
string targetUsername = "";
|
||||||
|
string targetPassword = "";
|
||||||
|
|
||||||
StreamWriter writer = null;
|
StreamWriter writer = null;
|
||||||
Comparison _comparison = null;
|
Comparison _comparison = null;
|
||||||
|
|
||||||
@ -42,7 +48,7 @@ namespace BismNormalizer.CommandLine
|
|||||||
Console.WriteLine("");
|
Console.WriteLine("");
|
||||||
Console.WriteLine(" USAGE:");
|
Console.WriteLine(" USAGE:");
|
||||||
Console.WriteLine("");
|
Console.WriteLine("");
|
||||||
Console.WriteLine(" BismNormalizer.exe BsmnFile [/Log:LogFile] [/Script:ScriptFile] [/Skip:{MissingInSource | MissingInTarget | DifferentDefinitions}]");
|
Console.WriteLine(" BismNormalizer.exe BsmnFile [/Log:LogFile] [/Script:ScriptFile] [/Skip:{MissingInSource | MissingInTarget | DifferentDefinitions}] [/CredsProvided:True|False] [/SourceUsername:SourceUsername] [/SourcePassword:SourcePassword] [/TargetUsername:TargetUsername] [/TargetPassword:TargetPassword]");
|
||||||
Console.WriteLine("");
|
Console.WriteLine("");
|
||||||
Console.WriteLine(" BsmnFile : Full path to the .bsmn file.");
|
Console.WriteLine(" BsmnFile : Full path to the .bsmn file.");
|
||||||
Console.WriteLine("");
|
Console.WriteLine("");
|
||||||
@ -52,6 +58,16 @@ namespace BismNormalizer.CommandLine
|
|||||||
Console.WriteLine("");
|
Console.WriteLine("");
|
||||||
Console.WriteLine(" /Skip:{MissingInSource | MissingInTarget | DifferentDefinitions} : Skip all objects that are missing in source/missing in target/with different definitions. Can pass a comma separated list of multiple skip options; e.g. 'MissingInSource,MissingInTarget,DifferentDefinitions'.");
|
Console.WriteLine(" /Skip:{MissingInSource | MissingInTarget | DifferentDefinitions} : Skip all objects that are missing in source/missing in target/with different definitions. Can pass a comma separated list of multiple skip options; e.g. 'MissingInSource,MissingInTarget,DifferentDefinitions'.");
|
||||||
Console.WriteLine("");
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine(" /CredsProvided:True|False : User credentials from the command line to connect to Analysis Services.");
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine(" /SourceUsername:SourceUsername : Source database username.");
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine(" /SourcePassword:SourcePassword : Source database password.");
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine(" /TargetUsername:TargetUsername : Target database username.");
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine(" /TargetPassword:TargetPassword : Target database password.");
|
||||||
|
Console.WriteLine("");
|
||||||
|
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -61,6 +77,11 @@ namespace BismNormalizer.CommandLine
|
|||||||
const string logPrefix = "/log:";
|
const string logPrefix = "/log:";
|
||||||
const string scriptPrefix = "/script:";
|
const string scriptPrefix = "/script:";
|
||||||
const string skipPrefix = "/skip:";
|
const string skipPrefix = "/skip:";
|
||||||
|
const string credsProvidedPrefix = "/credsprovided:";
|
||||||
|
const string sourceUsernamePrefix = "/sourceusername:";
|
||||||
|
const string sourcePasswordPrefix = "/sourcepassword:";
|
||||||
|
const string targetUsernamePrefix = "/targetusername:";
|
||||||
|
const string targetPasswordPrefix = "/targetpassword:";
|
||||||
|
|
||||||
for (int i = 1; i < args.Length; i++)
|
for (int i = 1; i < args.Length; i++)
|
||||||
{
|
{
|
||||||
@ -84,6 +105,39 @@ namespace BismNormalizer.CommandLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (args[i].Length >= credsProvidedPrefix.Length && args[i].Substring(0, credsProvidedPrefix.Length).ToLower() == credsProvidedPrefix)
|
||||||
|
{
|
||||||
|
string credsProvidedString = args[i].Substring(credsProvidedPrefix.Length, args[i].Length - credsProvidedPrefix.Length);
|
||||||
|
if (credsProvidedString == "True")
|
||||||
|
{
|
||||||
|
credsProvided = true;
|
||||||
|
}
|
||||||
|
else if (credsProvidedString == "False")
|
||||||
|
{
|
||||||
|
credsProvided = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine($"'{args[i]}' is not a valid argument.");
|
||||||
|
return ERROR_BAD_ARGUMENTS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (args[i].Length >= sourceUsernamePrefix.Length && args[i].Substring(0, sourceUsernamePrefix.Length).ToLower() == sourceUsernamePrefix)
|
||||||
|
{
|
||||||
|
sourceUsername = args[i].Substring(sourceUsernamePrefix.Length, args[i].Length - sourceUsernamePrefix.Length);
|
||||||
|
}
|
||||||
|
else if (args[i].Length >= sourcePasswordPrefix.Length && args[i].Substring(0, sourcePasswordPrefix.Length).ToLower() == sourcePasswordPrefix)
|
||||||
|
{
|
||||||
|
sourcePassword = args[i].Substring(sourcePasswordPrefix.Length, args[i].Length - sourcePasswordPrefix.Length);
|
||||||
|
}
|
||||||
|
else if (args[i].Length >= targetUsernamePrefix.Length && args[i].Substring(0, targetUsernamePrefix.Length).ToLower() == targetUsernamePrefix)
|
||||||
|
{
|
||||||
|
targetUsername = args[i].Substring(targetUsernamePrefix.Length, args[i].Length - targetUsernamePrefix.Length);
|
||||||
|
}
|
||||||
|
else if (args[i].Length >= targetPasswordPrefix.Length && args[i].Substring(0, targetPasswordPrefix.Length).ToLower() == targetPasswordPrefix)
|
||||||
|
{
|
||||||
|
targetPassword = args[i].Substring(targetPasswordPrefix.Length, args[i].Length - targetPasswordPrefix.Length);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine($"'{args[i]}' is not a valid argument.");
|
Console.WriteLine($"'{args[i]}' is not a valid argument.");
|
||||||
@ -129,7 +183,14 @@ namespace BismNormalizer.CommandLine
|
|||||||
|
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
Console.WriteLine("--Comparing ...");
|
Console.WriteLine("--Comparing ...");
|
||||||
_comparison = ComparisonFactory.CreateComparison(comparisonInfo);
|
if (credsProvided)
|
||||||
|
{
|
||||||
|
_comparison = ComparisonFactory.CreateComparison(comparisonInfo, sourceUsername, sourcePassword, targetUsername, targetPassword);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_comparison = ComparisonFactory.CreateComparison(comparisonInfo);
|
||||||
|
}
|
||||||
_comparison.ValidationMessage += HandleValidationMessage;
|
_comparison.ValidationMessage += HandleValidationMessage;
|
||||||
_comparison.Connect();
|
_comparison.Connect();
|
||||||
_comparison.CompareTabularModels();
|
_comparison.CompareTabularModels();
|
||||||
@ -168,7 +229,7 @@ namespace BismNormalizer.CommandLine
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Deployed changes to database {comparisonInfo.ConnectionInfoTarget.DatabaseName}.");
|
Console.WriteLine($"Deployed changes to database {comparisonInfo.ConnectionInfoTarget.DatabaseName}.");
|
||||||
Console.WriteLine("Passwords have not been set for impersonation accounts (setting passwords is not supported in command-line mode). Ensure the passwords are set before processing.");
|
Console.WriteLine("Passwords have not been set for impersonation accounts (setting passwords for data sources is not supported in command-line mode). Ensure the passwords are set before processing.");
|
||||||
if (comparisonInfo.OptionsInfo.OptionProcessingOption != ProcessingOption.DoNotProcess)
|
if (comparisonInfo.OptionsInfo.OptionProcessingOption != ProcessingOption.DoNotProcess)
|
||||||
{
|
{
|
||||||
Console.WriteLine("No processing has been done (processing is not supported in command-line mode).");
|
Console.WriteLine("No processing has been done (processing is not supported in command-line mode).");
|
||||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("4.0.1.1")]
|
[assembly: AssemblyVersion("4.0.1.8")]
|
||||||
[assembly: AssemblyFileVersion("4.0.1.1")]
|
[assembly: AssemblyFileVersion("4.0.1.8")]
|
||||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("4.0.1.1")]
|
[assembly: AssemblyVersion("4.0.1.8")]
|
||||||
[assembly: AssemblyFileVersion("4.0.1.1")]
|
[assembly: AssemblyFileVersion("4.0.1.8")]
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<DelaySign>false</DelaySign>
|
<DelaySign>false</DelaySign>
|
||||||
@ -73,10 +75,13 @@
|
|||||||
<RunRegRiched>true</RunRegRiched>
|
<RunRegRiched>true</RunRegRiched>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<HintPath>..\packages\EnvDTE.8.0.2\lib\net10\EnvDTE.dll</HintPath>
|
||||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="envdte80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<Reference Include="EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<HintPath>..\packages\EnvDTE80.8.0.3\lib\net10\EnvDTE80.dll</HintPath>
|
||||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.AI.Agent.Intercept, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.AI.Agent.Intercept, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
@ -191,6 +196,7 @@
|
|||||||
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<HintPath>..\packages\stdole.7.0.3302\lib\net10\stdole.dll</HintPath>
|
||||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
@ -381,6 +387,14 @@
|
|||||||
<Resource Include="Resources\7.png" />
|
<Resource Include="Resources\7.png" />
|
||||||
<Resource Include="Resources\8.png" />
|
<Resource Include="Resources\8.png" />
|
||||||
<Content Include="BismNormalizer.shfbproj" />
|
<Content Include="BismNormalizer.shfbproj" />
|
||||||
|
<Content Include="EnvDTE.dll">
|
||||||
|
<IncludeInVSIX>true</IncludeInVSIX>
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="EnvDTE80.dll">
|
||||||
|
<IncludeInVSIX>true</IncludeInVSIX>
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="Newtonsoft.Json.dll">
|
<Content Include="Newtonsoft.Json.dll">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
<IncludeInVSIX>true</IncludeInVSIX>
|
<IncludeInVSIX>true</IncludeInVSIX>
|
||||||
@ -555,4 +569,11 @@
|
|||||||
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
|
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||||
<Import Project="..\packages\MSBuild.Extension.Pack.1.8.0\build\net40\MSBuild.Extension.Pack.targets" />
|
<Import Project="..\packages\MSBuild.Extension.Pack.1.8.0\build\net40\MSBuild.Extension.Pack.targets" />
|
||||||
<Import Project="$(MSBuildProjectDirectory)\BismNormalizer.targets" />
|
<Import Project="$(MSBuildProjectDirectory)\BismNormalizer.targets" />
|
||||||
|
<Import Project="..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets')" />
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets'))" />
|
||||||
|
</Target>
|
||||||
</Project>
|
</Project>
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("4.0.1.1")]
|
[assembly: AssemblyVersion("4.0.1.8")]
|
||||||
[assembly: AssemblyFileVersion("4.0.1.1")]
|
[assembly: AssemblyFileVersion("4.0.1.8")]
|
||||||
|
@ -59,6 +59,17 @@ namespace BismNormalizer.TabularCompare
|
|||||||
return CreateComparisonInitialized(comparisonInfo);
|
return CreateComparisonInitialized(comparisonInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Uses factory design pattern to return an object of type Core.Comparison, which is instantiated using MultidimensionalMetadata.Comparison or TabularMeatadata.Comparison depending on SSAS compatibility level.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="comparisonInfo">ComparisonInfo object for the comparison.</param>
|
||||||
|
/// <returns>Core.Comparison object</returns>
|
||||||
|
public static Comparison CreateComparison(ComparisonInfo comparisonInfo, string sourceUsername, string sourcePassword, string targetUsername, string targetPassword)
|
||||||
|
{
|
||||||
|
comparisonInfo.InitializeCompatibilityLevels(sourceUsername, sourcePassword, targetUsername, targetPassword);
|
||||||
|
return CreateComparisonInitialized(comparisonInfo);
|
||||||
|
}
|
||||||
|
|
||||||
private static Comparison CreateComparisonInitialized(ComparisonInfo comparisonInfo)
|
private static Comparison CreateComparisonInitialized(ComparisonInfo comparisonInfo)
|
||||||
{
|
{
|
||||||
Telemetry.TrackEvent("CreateComparisonInitialized", new Dictionary<string, string> { { "App", "BismNormalizer" } });
|
Telemetry.TrackEvent("CreateComparisonInitialized", new Dictionary<string, string> { { "App", "BismNormalizer" } });
|
||||||
|
@ -127,8 +127,6 @@ namespace BismNormalizer.TabularCompare
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finds models' compatibility levels (and preps databases on workspace servers for comparison). This overload to be used when client is not Visual Studio - e.g. command line.
|
/// Finds models' compatibility levels (and preps databases on workspace servers for comparison). This overload to be used when client is not Visual Studio - e.g. command line.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="compatibilityLevelSource"></param>
|
|
||||||
/// <param name="compatibilityLevelTarget"></param>
|
|
||||||
public void InitializeCompatibilityLevels()
|
public void InitializeCompatibilityLevels()
|
||||||
{
|
{
|
||||||
ConnectionInfoSource.InitializeCompatibilityLevel();
|
ConnectionInfoSource.InitializeCompatibilityLevel();
|
||||||
@ -137,6 +135,24 @@ namespace BismNormalizer.TabularCompare
|
|||||||
PopulateDatabaseProperties();
|
PopulateDatabaseProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds models' compatibility levels (and preps databases on workspace servers for comparison). This overload to be used when client is not Visual Studio - e.g. command line.
|
||||||
|
/// </summary>
|
||||||
|
public void InitializeCompatibilityLevels(string sourceUsername, string sourcePassword, string targetUsername, string targetPassword)
|
||||||
|
{
|
||||||
|
ConnectionInfoSource.CredsProvided = true;
|
||||||
|
ConnectionInfoSource.Username = sourceUsername;
|
||||||
|
ConnectionInfoSource.Password = sourcePassword;
|
||||||
|
ConnectionInfoSource.InitializeCompatibilityLevel();
|
||||||
|
|
||||||
|
ConnectionInfoTarget.CredsProvided = true;
|
||||||
|
ConnectionInfoTarget.Username = targetUsername;
|
||||||
|
ConnectionInfoTarget.Password = targetPassword;
|
||||||
|
ConnectionInfoTarget.InitializeCompatibilityLevel();
|
||||||
|
|
||||||
|
PopulateDatabaseProperties();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finds model compatibility levels (and preps databases on workspace servers for comparison). This overload to be used when running in Visual Studio. Allows user to cancel if doesn't want to close .bim file(s).
|
/// Finds model compatibility levels (and preps databases on workspace servers for comparison). This overload to be used when running in Visual Studio. Allows user to cancel if doesn't want to close .bim file(s).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -31,9 +31,14 @@ namespace BismNormalizer.TabularCompare
|
|||||||
private string _deploymentServerDatabase;
|
private string _deploymentServerDatabase;
|
||||||
private string _deploymentServerCubeName;
|
private string _deploymentServerCubeName;
|
||||||
private DirectoryInfo _projectDirectoryInfo;
|
private DirectoryInfo _projectDirectoryInfo;
|
||||||
|
private bool _credsProvided = false;
|
||||||
|
private string _username;
|
||||||
|
private string _password;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the ConnectionInfo class.
|
/// Initializes a new instance of the ConnectionInfo class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -132,6 +137,38 @@ namespace BismNormalizer.TabularCompare
|
|||||||
[XmlIgnore()]
|
[XmlIgnore()]
|
||||||
public string DeploymentServerCubeName => _deploymentServerCubeName;
|
public string DeploymentServerCubeName => _deploymentServerCubeName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use credentials are provided for command line execution.
|
||||||
|
/// </summary>
|
||||||
|
[XmlIgnore()]
|
||||||
|
public bool CredsProvided
|
||||||
|
{
|
||||||
|
get { return _credsProvided; }
|
||||||
|
set { _credsProvided = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Username for command line execution.
|
||||||
|
/// </summary>
|
||||||
|
[XmlIgnore()]
|
||||||
|
public string Username
|
||||||
|
{
|
||||||
|
get { return _username; }
|
||||||
|
set { _username = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Password for command line execution.
|
||||||
|
/// </summary>
|
||||||
|
[XmlIgnore()]
|
||||||
|
public string Password
|
||||||
|
{
|
||||||
|
get { return _password; }
|
||||||
|
set { _password = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
private void ReadSettingsFile()
|
private void ReadSettingsFile()
|
||||||
{
|
{
|
||||||
FileInfo[] files = _projectDirectoryInfo.GetFiles("*.settings", SearchOption.TopDirectoryOnly);
|
FileInfo[] files = _projectDirectoryInfo.GetFiles("*.settings", SearchOption.TopDirectoryOnly);
|
||||||
@ -326,7 +363,7 @@ namespace BismNormalizer.TabularCompare
|
|||||||
Server amoServer = new Server();
|
Server amoServer = new Server();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
amoServer.Connect("Provider=MSOLAP;Data Source=" + this.ServerName);
|
amoServer.Connect(BuildConnectionString());
|
||||||
}
|
}
|
||||||
catch (ConnectionException) when (UseProject)
|
catch (ConnectionException) when (UseProject)
|
||||||
{
|
{
|
||||||
@ -349,7 +386,7 @@ namespace BismNormalizer.TabularCompare
|
|||||||
{
|
{
|
||||||
string port = File.ReadAllText(portFilePath[0]).Replace("\0", "");
|
string port = File.ReadAllText(portFilePath[0]).Replace("\0", "");
|
||||||
this.ServerName = $"localhost:{Convert.ToString(port)}";
|
this.ServerName = $"localhost:{Convert.ToString(port)}";
|
||||||
amoServer.Connect("Provider=MSOLAP;Data Source=" + this.ServerName);
|
amoServer.Connect(BuildConnectionString());
|
||||||
foundServer = true;
|
foundServer = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -496,7 +533,7 @@ $@"{{
|
|||||||
//need next lines in case just created the db using the Execute method
|
//need next lines in case just created the db using the Execute method
|
||||||
//amoServer.Refresh(); //todo workaround for bug 9719887 on 3/10/17 need to disconnect and reconnect
|
//amoServer.Refresh(); //todo workaround for bug 9719887 on 3/10/17 need to disconnect and reconnect
|
||||||
amoServer.Disconnect();
|
amoServer.Disconnect();
|
||||||
amoServer.Connect("Provider=MSOLAP;Data Source=" + this.ServerName);
|
amoServer.Connect(BuildConnectionString());
|
||||||
|
|
||||||
tabularDatabase = amoServer.Databases.FindByName(this.DatabaseName);
|
tabularDatabase = amoServer.Databases.FindByName(this.DatabaseName);
|
||||||
}
|
}
|
||||||
@ -509,5 +546,20 @@ $@"{{
|
|||||||
_directQuery = ((tabularDatabase.Model != null && tabularDatabase.Model.DefaultMode == Microsoft.AnalysisServices.Tabular.ModeType.DirectQuery) ||
|
_directQuery = ((tabularDatabase.Model != null && tabularDatabase.Model.DefaultMode == Microsoft.AnalysisServices.Tabular.ModeType.DirectQuery) ||
|
||||||
tabularDatabase.DirectQueryMode == DirectQueryMode.DirectQuery || tabularDatabase.DirectQueryMode == DirectQueryMode.InMemoryWithDirectQuery || tabularDatabase.DirectQueryMode == DirectQueryMode.DirectQueryWithInMemory);
|
tabularDatabase.DirectQueryMode == DirectQueryMode.DirectQuery || tabularDatabase.DirectQueryMode == DirectQueryMode.InMemoryWithDirectQuery || tabularDatabase.DirectQueryMode == DirectQueryMode.DirectQueryWithInMemory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Build connection string.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string BuildConnectionString()
|
||||||
|
{
|
||||||
|
string connectionString = $"Provider=MSOLAP;Data Source={this.ServerName};";
|
||||||
|
if (this.CredsProvided)
|
||||||
|
{
|
||||||
|
connectionString += $"User ID={this.Username};Password={this.Password};";
|
||||||
|
}
|
||||||
|
|
||||||
|
return connectionString;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ namespace BismNormalizer.TabularCompare.TabularMetadata
|
|||||||
this.Disconnect();
|
this.Disconnect();
|
||||||
|
|
||||||
_server = new Server();
|
_server = new Server();
|
||||||
_server.Connect($"Provider=MSOLAP;Data Source={_connectionInfo.ServerName}");
|
_server.Connect(_connectionInfo.BuildConnectionString());
|
||||||
|
|
||||||
_database = _server.Databases.FindByName(_connectionInfo.DatabaseName);
|
_database = _server.Databases.FindByName(_connectionInfo.DatabaseName);
|
||||||
if (_database == null)
|
if (_database == null)
|
||||||
@ -1648,7 +1648,7 @@ namespace BismNormalizer.TabularCompare.TabularMetadata
|
|||||||
|
|
||||||
_server.Disconnect();
|
_server.Disconnect();
|
||||||
_server = new Server();
|
_server = new Server();
|
||||||
_server.Connect("Provider=MSOLAP;Data Source=" + _connectionInfo.ServerName);
|
_server.Connect(_connectionInfo.BuildConnectionString());
|
||||||
Amo.XmlaResultCollection results = _server.Execute(tmslCommand);
|
Amo.XmlaResultCollection results = _server.Execute(tmslCommand);
|
||||||
if (results.ContainsErrors)
|
if (results.ContainsErrors)
|
||||||
throw new Amo.OperationException(results);
|
throw new Amo.OperationException(results);
|
||||||
|
@ -252,7 +252,7 @@ namespace BismNormalizer.TabularCompare.UI
|
|||||||
{
|
{
|
||||||
projects.Add(derivedProjectName, project);
|
projects.Add(derivedProjectName, project);
|
||||||
}
|
}
|
||||||
else if (project.Kind == EnvDTE80.ProjectKinds.vsProjectKindSolutionFolder)
|
else if (project.Kind == "{66A26720-8FB5-11D2-AA7E-00C04F688DDE}")
|
||||||
{
|
{
|
||||||
foreach (EnvDTE.ProjectItem projectItem in project.ProjectItems)
|
foreach (EnvDTE.ProjectItem projectItem in project.ProjectItems)
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<section name="BismNormalizer.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
|
<section name="BismNormalizer.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
</sectionGroup>
|
</sectionGroup>
|
||||||
</configSections>
|
</configSections>
|
||||||
<userSettings>
|
<userSettings>
|
||||||
@ -11,13 +11,13 @@
|
|||||||
<value>localhost|</value>
|
<value>localhost|</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="TargetCatalog" serializeAs="String">
|
<setting name="TargetCatalog" serializeAs="String">
|
||||||
<value/>
|
<value />
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="SourceServerAutoCompleteEntries" serializeAs="String">
|
<setting name="SourceServerAutoCompleteEntries" serializeAs="String">
|
||||||
<value>localhost|</value>
|
<value>localhost|</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="SourceCatalog" serializeAs="String">
|
<setting name="SourceCatalog" serializeAs="String">
|
||||||
<value/>
|
<value />
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="InformationalMessagesVisible" serializeAs="String">
|
<setting name="InformationalMessagesVisible" serializeAs="String">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
@ -75,24 +75,24 @@
|
|||||||
</setting>
|
</setting>
|
||||||
</BismNormalizer.Settings>
|
</BismNormalizer.Settings>
|
||||||
</userSettings>
|
</userSettings>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
|
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Microsoft.VisualStudio.Utilities" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
<assemblyIdentity name="Microsoft.VisualStudio.Utilities" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Microsoft.VisualStudio.Imaging" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
<assemblyIdentity name="Microsoft.VisualStudio.Imaging" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
|
<package id="EnvDTE" version="8.0.2" targetFramework="net472" />
|
||||||
|
<package id="EnvDTE80" version="8.0.3" targetFramework="net472" />
|
||||||
<package id="Microsoft.AnalysisServices.retail.amd64" version="16.3.0" targetFramework="net461" />
|
<package id="Microsoft.AnalysisServices.retail.amd64" version="16.3.0" targetFramework="net461" />
|
||||||
<package id="Microsoft.ApplicationInsights" version="2.8.1" targetFramework="net461" />
|
<package id="Microsoft.ApplicationInsights" version="2.8.1" targetFramework="net461" />
|
||||||
<package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.4.0" targetFramework="net461" />
|
<package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.4.0" targetFramework="net461" />
|
||||||
@ -10,6 +12,7 @@
|
|||||||
<package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1000" targetFramework="net452" />
|
<package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1000" targetFramework="net452" />
|
||||||
<package id="Microsoft.VisualStudio.Imaging" version="14.3.25407" targetFramework="net461" />
|
<package id="Microsoft.VisualStudio.Imaging" version="14.3.25407" targetFramework="net461" />
|
||||||
<package id="Microsoft.VisualStudio.OLE.Interop" version="7.10.6070" targetFramework="net461" />
|
<package id="Microsoft.VisualStudio.OLE.Interop" version="7.10.6070" targetFramework="net461" />
|
||||||
|
<package id="Microsoft.VisualStudio.SDK.EmbedInteropTypes" version="15.0.16" targetFramework="net472" />
|
||||||
<package id="Microsoft.VisualStudio.Shell.14.0" version="14.3.25407" targetFramework="net461" />
|
<package id="Microsoft.VisualStudio.Shell.14.0" version="14.3.25407" targetFramework="net461" />
|
||||||
<package id="Microsoft.VisualStudio.Shell.Immutable.10.0" version="10.0.30319" targetFramework="net461" />
|
<package id="Microsoft.VisualStudio.Shell.Immutable.10.0" version="10.0.30319" targetFramework="net461" />
|
||||||
<package id="Microsoft.VisualStudio.Shell.Immutable.11.0" version="11.0.50727" targetFramework="net461" />
|
<package id="Microsoft.VisualStudio.Shell.Immutable.11.0" version="11.0.50727" targetFramework="net461" />
|
||||||
@ -25,5 +28,6 @@
|
|||||||
<package id="Microsoft.VisualStudio.Validation" version="14.1.111" targetFramework="net461" />
|
<package id="Microsoft.VisualStudio.Validation" version="14.1.111" targetFramework="net461" />
|
||||||
<package id="MSBuild.Extension.Pack" version="1.8.0" targetFramework="net452" />
|
<package id="MSBuild.Extension.Pack" version="1.8.0" targetFramework="net452" />
|
||||||
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
|
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
|
||||||
|
<package id="stdole" version="7.0.3302" targetFramework="net472" />
|
||||||
<package id="System.Diagnostics.DiagnosticSource" version="4.5.0" targetFramework="net461" />
|
<package id="System.Diagnostics.DiagnosticSource" version="4.5.0" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
||||||
<Metadata>
|
<Metadata>
|
||||||
<Identity Id="BismNormalizer.ea2aeb43-64a6-4dee-8816-099fb44513fa" Version="4.0.1.1" Language="en-US" Publisher="BISM Normalizer" />
|
<Identity Id="BismNormalizer.ea2aeb43-64a6-4dee-8816-099fb44513fa" Version="4.0.1.8" Language="en-US" Publisher="BISM Normalizer" />
|
||||||
<DisplayName>BISM Normalizer</DisplayName>
|
<DisplayName>BISM Normalizer</DisplayName>
|
||||||
<Description xml:space="preserve">BISM Normalizer manages Analysis Services tabular models</Description>
|
<Description xml:space="preserve">BISM Normalizer manages Analysis Services tabular models</Description>
|
||||||
<MoreInfo>http://bism-normalizer.com/</MoreInfo>
|
<MoreInfo>http://bism-normalizer.com/</MoreInfo>
|
||||||
|
@ -22,7 +22,8 @@ namespace RestApiSample
|
|||||||
private static async void CallRefreshAsync()
|
private static async void CallRefreshAsync()
|
||||||
{
|
{
|
||||||
HttpClient client = new HttpClient();
|
HttpClient client = new HttpClient();
|
||||||
client.BaseAddress = new Uri("https://<rollout>.asazure.windows.net/servers/<serverName>/models/<resource>/");
|
//client.BaseAddress = new Uri("https://<rollout>.asazure.windows.net/servers/<serverName>/models/<resource>/");
|
||||||
|
client.BaseAddress = new Uri("https://southcentralus.asazure.windows.net/servers/chwade003/models/AdventureWorks0/");
|
||||||
|
|
||||||
// Send refresh request
|
// Send refresh request
|
||||||
client.DefaultRequestHeaders.Accept.Clear();
|
client.DefaultRequestHeaders.Accept.Clear();
|
||||||
@ -65,7 +66,8 @@ namespace RestApiSample
|
|||||||
{
|
{
|
||||||
string resourceURI = "https://*.asazure.windows.net";
|
string resourceURI = "https://*.asazure.windows.net";
|
||||||
|
|
||||||
string authority = "https://login.windows.net/<TenantID>/oauth2/authorize";
|
//string authority = "https://login.windows.net/<TenantID>/oauth2/authorize";
|
||||||
|
string authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/authorize"; // Authority address can optionally use tenant ID in place of "common". If service principal or B2B enabled, this is a requirement.
|
||||||
AuthenticationContext ac = new AuthenticationContext(authority);
|
AuthenticationContext ac = new AuthenticationContext(authority);
|
||||||
|
|
||||||
#region Interactive or username/password
|
#region Interactive or username/password
|
||||||
@ -82,7 +84,8 @@ namespace RestApiSample
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//Service principal:
|
//Service principal:
|
||||||
ClientCredential cred = new ClientCredential("<App ID>", "<App Key>");
|
//ClientCredential cred = new ClientCredential("<App ID>", "<App Key>");
|
||||||
|
ClientCredential cred = new ClientCredential("99ae7bd1-6b02-425f-928e-97baa957d3f1", "0T8BYov1JciG+q3B4bB4bY8EbBjWpY7aC3OBp0u9tj8=");
|
||||||
AuthenticationResult ar = await ac.AcquireTokenAsync(resourceURI, cred);
|
AuthenticationResult ar = await ac.AcquireTokenAsync(resourceURI, cred);
|
||||||
|
|
||||||
return ar.AccessToken;
|
return ar.AccessToken;
|
||||||
|
Loading…
Reference in New Issue
Block a user