protected async override Task PrepareMigrationAsync() { var sessionId = string.Empty; if (!string.IsNullOrWhiteSpace(options.SpecPath)) { if (!File.Exists(options.SpecPath)) { throw new ArgumentException($"'{nameof(options.SpecPath)}' points to a file ({options.SpecPath}) that doesn't exist."); } spec = Deserialize <WorkItemMigrationSpec>(File.ReadAllText(options.SpecPath)); sessionId = $"{nameof(WorkItemMigrationTask)}:{Guid.NewGuid()}"; } if (!string.IsNullOrWhiteSpace(options.Base64Content)) { var interopPayload = Deserialize <INTEROP_Payload>( UTF8Encoding.UTF8.GetString( Convert.FromBase64String(options.Base64Content))); spec = interopPayload.ConvertToSpec(); sessionId = interopPayload.Id; Insights.Debug($"Base64Content parsed: Session ID: {interopPayload.Id}"); Insights.Debug($"Body: {UTF8Encoding.UTF8.GetString(Convert.FromBase64String(options.Base64Content))}"); } Insights.InitializeSession(sessionId); client = GetWorkItemService(); await Task.CompletedTask; }