private static void SendSASToICM(string name, int Id) { var sasToken = BlobStorage.GetSASToken(Id, name); // Since we build our own HTML, we directly call the AddICMDiscussion instead of callign Log.Online if (!SALsA.GetInstance(Id).ICM.QueueICMDiscussion(Utility.UrlToHml(name, sasToken), false)) { Log.Information("Did not add ICM discussion : {0} with sasToken {1}. Probably already exists", name, sasToken); } }
public static void UploadLog(int Id) { try { var currentTime = DateTime.UtcNow.ToString("yyMMddTHHmmss", CultureInfo.InvariantCulture); var blobName = String.Format("{0}-{1}_{2}_{3}{4}", Constants.LogFileNamePrefix, Log.UID, currentTime, Id, Constants.LogFileNameExtension); Log.FlushAndClose(); BlobStorage.UploadStream(Id, blobName, Log.LogStream.BaseStream, "text/plain").GetAwaiter().GetResult(); var sas = BlobStorage.GetSASToken(Id, blobName); Log.SetSAS(sas); Log.Information("Log for this automatic run are available here : {0}", sas); } catch (Exception ex) { Log.Warning("Failed to upload log for this run"); Log.Exception(ex); } }
public static string UploadICMRun(int Id, string html) { try { var currentTime = DateTime.UtcNow.ToString("yyMMddTHHmmss", CultureInfo.InvariantCulture); var blobName = String.Format("{0}-{1}_{2}_{3}{4}", Constants.LogICMFileNamePrefix, Log.UID, currentTime, Id, Constants.LogICMExtension); BlobStorage.UploadText(Id, blobName, html, "text/html").GetAwaiter().GetResult(); BlobStorage.UploadText(Id, Constants.LogICMQuick, html, "text/html").GetAwaiter().GetResult(); var sas = BlobStorage.GetSASToken(Id, blobName); Log.Information("ICM log for this run are available here : {0}", sas); return(sas); } catch (Exception ex) { Log.Warning("Failed to upload ICM log for this run"); Log.Exception(ex); return(null); } }