internal static void StorePfxForSession(string sessionId,byte[] pfx,string password) { DataContext.Do(ctx=>{ var session = ctx.AddAzureSubscriptionSessions.Find(sessionId); if(session == null) { session = new AddAzureSubscriptionSession { SessionId = sessionId }; ctx.AddAzureSubscriptionSessions.Add(session); } session.Pfx = pfx; session.Password = password; ctx.SaveChanges(); }); }
private static AzureUsageClient GetAzureUsageClient(string azureSubscriptionId,AddAzureSubscriptionSession record) { return new AzureUsageClient(new FromPKCSMetricsEndpointConfiguration(record.Pfx,record.Password,azureSubscriptionId)); }