В настоящее время я пытаюсь создать API отдыха для обновления куба SSAS в Azure.Я прошел все шаги из этой ссылки .Затем я использую этот код для обновления Cube1:
#r "Microsoft.AnalysisServices.Tabular.DLL"
#r "Microsoft.AnalysisServices.Core.DLL"
#r "System.Configuration"
using System;
using System.Security;
using System.Security.Principal;
using System.Configuration;
using Microsoft.AnalysisServices.Tabular;
public static void Run(TimerInfo myTimer, TraceWriter log)
{
log.Info($"C# Timer trigger function started at: DateTime.Now}");
// try
// {
Microsoft.AnalysisServices.Tabular.Server asSrv = new Microsoft.AnalysisServices.Tabular.Server();
log.Info("Log1");
var connStr = "Provider=MSOLAP;Data Source=asazure://serveraddress; Initial Catalog=Cube1;User ID=*****;Password=*****";
log.Info("Log2");
asSrv.Connect(connStr);
log.Info("Log3");
Database db = asSrv.Databases["Cube1"];
log.Info("Log4");
Model m = db.Model;
m.RequestRefresh(RefreshType.Full); // Mark the model for refresh
db.Model.SaveChanges(); //commit which will execute the refresh
asSrv.Disconnect();
// }
// catch (Exception e)
// {
// log.Info($"C# Timer trigger function exception: {e.ToString()}");
// }
log.Info($"C# Timer trigger function finished at: {DateTime.Now}");
}
Обычно все должно быть в порядке, но вот мое сообщение об ошибке:
Не удалось загрузить тип 'System.Security.Principal.WindowsImpersonationContext 'from Assembly' mscorlib, Версия = 4.0.0.0, Культура = Нейтральный, PublicKeyToken = *****
Любая идея, чтобы решить эту проблему?
Спасибомного.