Пример #1
0
        public AzureServices(ManagementModel managementModel)
        {
            _managementModel    = managementModel;
            _applicationInsight = new ApplicationInsights();

            _account = CloudStorageAccount.Parse(Environment.GetEnvironmentVariable("AzureWebJobsStorage"));
            _client  = _account.CreateCloudTableClient();

            _table = _client.GetTableReference(managementModel.MessageType);

            _telemetry = _applicationInsight.Create();
            Task.Run(async() =>
            {
                if (!await _table.ExistsAsync())
                {
                    await _table.CreateIfNotExistsAsync();
                }
            });
        }