private static async Task ConfigureAsync() { try { var storageAccount = (ICloudStorageAccount)GlobalConfiguration.Configuration.DependencyResolver.GetService(typeof(ICloudStorageAccount)); await ConfigureStorage(storageAccount); await ConfigureCors(storageAccount); } catch (Exception t) { ExceptionHandlerUtilities.ReportExceptionAsync(t, null); } }
private static async Task ConfigureCors(ICloudStorageAccount storageAccount) { try { var blobClient = storageAccount.CreateCloudBlobClient(); var blobServiceProperties = await blobClient.GetServicePropertiesAsync(); ConfigureCors(blobServiceProperties); await blobClient.SetServicePropertiesAsync(blobServiceProperties); } catch (Exception t) { ExceptionHandlerUtilities.ReportExceptionAsync(t, null); } }
private static async Task ConfigureStorage(ICloudStorageAccount storageAccount) { try { var cloudQueueClient = storageAccount.CreateCloudQueueClient(); await CreateQueueIfNotExists(cloudQueueClient, WebJobs.Thumbnails.Shared.Constants.ThumbnailsQueueName); await CreateQueueIfNotExists(cloudQueueClient, Fifthweek.GarbageCollection.Shared.Constants.GarbageCollectionQueueName); await CreateQueueIfNotExists(cloudQueueClient, Payments.Shared.Constants.RequestSnapshotQueueName); await CreateQueueIfNotExists(cloudQueueClient, Payments.Shared.Constants.RequestProcessPaymentsQueueName); var cloudBlobClient = storageAccount.CreateCloudBlobClient(); await CreateBlobContainerIfNotExists(cloudBlobClient, Payments.Shared.Constants.PaymentProcessingDataContainerName); await CreateBlobIfNotExists(cloudBlobClient, Fifthweek.Azure.Constants.AzureLeaseObjectsContainerName, Payments.Shared.Constants.ProcessPaymentsLeaseObjectName); await CreateBlobIfNotExists(cloudBlobClient, Fifthweek.Azure.Constants.AzureLeaseObjectsContainerName, WebJobs.GarbageCollection.Shared.Constants.LeaseObjectName); await CreateBlobContainerIfNotExists(cloudBlobClient, Constants.PublicFileBlobContainerName); } catch (Exception t) { ExceptionHandlerUtilities.ReportExceptionAsync(t, null); } }
public void Configuration(IAppBuilder app) { try { var httpConfiguration = new HttpConfiguration(); IdentityConfig.Register(app); DapperConfig.Register(); AutofacConfig.Register(httpConfiguration, app); AzureConfig.Register(); OAuthConfig.Register(httpConfiguration, app); DatabaseConfig.Register(); WebApiConfig.Register(httpConfiguration); app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); app.UseWebApi(httpConfiguration); } catch (Exception t) { ExceptionHandlerUtilities.ReportExceptionAsync(t, null); throw; } }
public void ReportExceptionAsync(Exception exception, string developerName) { ExceptionHandlerUtilities.ReportExceptionAsync(exception, developerName); }
public void ReportExceptionAsync(Exception exception) { var developerName = ExceptionHandlerUtilities.GetDeveloperName(this.requestContext.Request); ExceptionHandlerUtilities.ReportExceptionAsync(exception, developerName); }
public void ReportExceptionAsync(IOwinRequest request, Exception exception) { var developerName = ExceptionHandlerUtilities.GetDeveloperName(request); ExceptionHandlerUtilities.ReportExceptionAsync(exception, developerName); }