in SamplesV1/AzureAnalysisServicesProcessSample/ProcessAzureASActivity.cs [41:90]
public override IDictionary<string, string> Execute(ProcessAzureASContext context, IActivityLogger logger)
{
logger.Write("Starting ProcessAzureASActivity");
if (string.IsNullOrEmpty(context.AdvancedASProcessingScriptPath))
{
logger.Write("No custom TMSL script specified, process perform full process of the database");
try
{
Model tabularModel = GetTabularModel(context.AzureASConnectionString, context.TabularDatabaseName);
ProcessTabularModel(tabularModel, logger);
logger.Write("Finalizing ProcessAzureASActivity");
}
catch (Exception ex)
{
logger.Write(ex.Message);
throw;
}
}
else
{
logger.Write("Custom TMSL script specified, perform action defined in TMSL script");
try
{
using (AdomdConnection asConn = new AdomdConnection(context.AzureASConnectionString))
{
asConn.Open();
foreach (string scriptPath in context.AdvancedASProcessingScriptPath.Split(';'))
{
string commandText = ReadBlob(context.BlobStorageConnectionString, scriptPath);
AdomdCommand asCmd = asConn.CreateCommand();
asCmd.CommandText = commandText;
asCmd.ExecuteNonQuery();
logger.Write("Azure AS was successfully processed");
}
}
}
catch (Exception ex)
{
logger.Write(ex.Message);
throw;
}
}
return new Dictionary<string, string>();
}