command line creds

This commit is contained in:
christianwade 2019-07-24 23:18:15 -07:00
parent 921a8b4ffc
commit c6f9e2ab18
14 changed files with 204 additions and 36 deletions

View File

@ -21,6 +21,12 @@ namespace BismNormalizer.CommandLine
string logFile = null;
string scriptFile = null;
List<string> skipOptions = null;
bool credsProvided = false;
string sourceUsername = "";
string sourcePassword = "";
string targetUsername = "";
string targetPassword = "";
StreamWriter writer = null;
Comparison _comparison = null;
@ -42,7 +48,7 @@ namespace BismNormalizer.CommandLine
Console.WriteLine("");
Console.WriteLine(" USAGE:");
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(" BsmnFile : Full path to the .bsmn file.");
Console.WriteLine("");
@ -52,6 +58,16 @@ namespace BismNormalizer.CommandLine
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("");
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;
}
@ -61,6 +77,11 @@ namespace BismNormalizer.CommandLine
const string logPrefix = "/log:";
const string scriptPrefix = "/script:";
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++)
{
@ -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
{
Console.WriteLine($"'{args[i]}' is not a valid argument.");
@ -129,7 +183,14 @@ namespace BismNormalizer.CommandLine
Console.WriteLine();
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.Connect();
_comparison.CompareTabularModels();
@ -168,7 +229,7 @@ namespace BismNormalizer.CommandLine
else
{
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)
{
Console.WriteLine("No processing has been done (processing is not supported in command-line mode).");

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.1.1")]
[assembly: AssemblyFileVersion("4.0.1.1")]
[assembly: AssemblyVersion("4.0.1.8")]
[assembly: AssemblyFileVersion("4.0.1.8")]

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.1.1")]
[assembly: AssemblyFileVersion("4.0.1.1")]
[assembly: AssemblyVersion("4.0.1.8")]
[assembly: AssemblyFileVersion("4.0.1.8")]

View File

@ -29,6 +29,8 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup>
<DelaySign>false</DelaySign>
@ -73,10 +75,13 @@
<RunRegRiched>true</RunRegRiched>
</PropertyGroup>
<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>
<Private>True</Private>
</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>
</Reference>
<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>
</Reference>
<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>
</Reference>
<Reference Include="System" />
@ -381,6 +387,14 @@
<Resource Include="Resources\7.png" />
<Resource Include="Resources\8.png" />
<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">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
@ -555,4 +569,11 @@
<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="$(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>

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.1.1")]
[assembly: AssemblyFileVersion("4.0.1.1")]
[assembly: AssemblyVersion("4.0.1.8")]
[assembly: AssemblyFileVersion("4.0.1.8")]

View File

@ -59,6 +59,17 @@ namespace BismNormalizer.TabularCompare
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)
{
Telemetry.TrackEvent("CreateComparisonInitialized", new Dictionary<string, string> { { "App", "BismNormalizer" } });

View File

@ -127,8 +127,6 @@ namespace BismNormalizer.TabularCompare
/// <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>
/// <param name="compatibilityLevelSource"></param>
/// <param name="compatibilityLevelTarget"></param>
public void InitializeCompatibilityLevels()
{
ConnectionInfoSource.InitializeCompatibilityLevel();
@ -137,6 +135,24 @@ namespace BismNormalizer.TabularCompare
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>
/// 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>

View File

@ -31,9 +31,14 @@ namespace BismNormalizer.TabularCompare
private string _deploymentServerDatabase;
private string _deploymentServerCubeName;
private DirectoryInfo _projectDirectoryInfo;
private bool _credsProvided = false;
private string _username;
private string _password;
#endregion
#region Properties
/// <summary>
/// Initializes a new instance of the ConnectionInfo class.
/// </summary>
@ -132,6 +137,38 @@ namespace BismNormalizer.TabularCompare
[XmlIgnore()]
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()
{
FileInfo[] files = _projectDirectoryInfo.GetFiles("*.settings", SearchOption.TopDirectoryOnly);
@ -326,7 +363,7 @@ namespace BismNormalizer.TabularCompare
Server amoServer = new Server();
try
{
amoServer.Connect("Provider=MSOLAP;Data Source=" + this.ServerName);
amoServer.Connect(BuildConnectionString());
}
catch (ConnectionException) when (UseProject)
{
@ -349,7 +386,7 @@ namespace BismNormalizer.TabularCompare
{
string port = File.ReadAllText(portFilePath[0]).Replace("\0", "");
this.ServerName = $"localhost:{Convert.ToString(port)}";
amoServer.Connect("Provider=MSOLAP;Data Source=" + this.ServerName);
amoServer.Connect(BuildConnectionString());
foundServer = true;
break;
}
@ -496,7 +533,7 @@ $@"{{
//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.Disconnect();
amoServer.Connect("Provider=MSOLAP;Data Source=" + this.ServerName);
amoServer.Connect(BuildConnectionString());
tabularDatabase = amoServer.Databases.FindByName(this.DatabaseName);
}
@ -509,5 +546,20 @@ $@"{{
_directQuery = ((tabularDatabase.Model != null && tabularDatabase.Model.DefaultMode == Microsoft.AnalysisServices.Tabular.ModeType.DirectQuery) ||
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;
}
}
}

View File

@ -57,7 +57,7 @@ namespace BismNormalizer.TabularCompare.TabularMetadata
this.Disconnect();
_server = new Server();
_server.Connect($"Provider=MSOLAP;Data Source={_connectionInfo.ServerName}");
_server.Connect(_connectionInfo.BuildConnectionString());
_database = _server.Databases.FindByName(_connectionInfo.DatabaseName);
if (_database == null)
@ -1648,7 +1648,7 @@ namespace BismNormalizer.TabularCompare.TabularMetadata
_server.Disconnect();
_server = new Server();
_server.Connect("Provider=MSOLAP;Data Source=" + _connectionInfo.ServerName);
_server.Connect(_connectionInfo.BuildConnectionString());
Amo.XmlaResultCollection results = _server.Execute(tmslCommand);
if (results.ContainsErrors)
throw new Amo.OperationException(results);

View File

@ -252,7 +252,7 @@ namespace BismNormalizer.TabularCompare.UI
{
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)
{

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<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>
</configSections>
<userSettings>
@ -11,13 +11,13 @@
<value>localhost|</value>
</setting>
<setting name="TargetCatalog" serializeAs="String">
<value/>
<value />
</setting>
<setting name="SourceServerAutoCompleteEntries" serializeAs="String">
<value>localhost|</value>
</setting>
<setting name="SourceCatalog" serializeAs="String">
<value/>
<value />
</setting>
<setting name="InformationalMessagesVisible" serializeAs="String">
<value>True</value>
@ -75,24 +75,24 @@
</setting>
</BismNormalizer.Settings>
</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>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0"/>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Utilities" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0"/>
<assemblyIdentity name="Microsoft.VisualStudio.Utilities" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Imaging" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0"/>
<assemblyIdentity name="Microsoft.VisualStudio.Imaging" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0"/>
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<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.ApplicationInsights" version="2.8.1" 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.VisualStudio.Imaging" version="14.3.25407" 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.Immutable.10.0" version="10.0.30319" 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="MSBuild.Extension.Pack" version="1.8.0" targetFramework="net452" />
<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" />
</packages>

View File

@ -1,7 +1,7 @@
<?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">
<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>
<Description xml:space="preserve">BISM Normalizer manages Analysis Services tabular models</Description>
<MoreInfo>http://bism-normalizer.com/</MoreInfo>

View File

@ -22,7 +22,8 @@ namespace RestApiSample
private static async void CallRefreshAsync()
{
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
client.DefaultRequestHeaders.Accept.Clear();
@ -65,7 +66,8 @@ namespace RestApiSample
{
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);
#region Interactive or username/password
@ -82,7 +84,8 @@ namespace RestApiSample
#endregion
//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);
return ar.AccessToken;