public async Task Initialize()
            {
                Store = new AzureHttpMessageStore(Table, BlobContainer, UseCompression);
                await Table.CreateIfNotExistsAsync(CancellationToken.None);

                await BlobContainer.CreateIfNotExistsAsync(CancellationToken.None);
            }
Ejemplo n.º 2
0
        public async Task <bool> CreateContainerIfNotExistsAsync()
        {
            bool result = await appLeaseContainer.CreateIfNotExistsAsync();

            await this.CreateAppLeaseInfoIfNotExistsAsync();

            return(result);
        }
        protected void SetContainer()
        {
            BlobContainer = BlobClient.GetContainerReference(ContainerName);

            if (CreateIfNotExists)
            {
                BlobContainer.CreateIfNotExistsAsync();
            }
        }
Ejemplo n.º 4
0
        public async Task <bool> CreateLeaseStoreIfNotExistsAsync(TaskHubInfo eventHubInfo, bool checkIfStale)
        {
            bool result = false;

            result = await taskHubContainer.CreateIfNotExistsAsync();

            await this.GetOrCreateTaskHubInfoAsync(eventHubInfo, checkIfStale : checkIfStale);

            return(result);
        }
Ejemplo n.º 5
0
            private async Task ClearAllBlobSecrets()
            {
                await BlobContainer.CreateIfNotExistsAsync();

                var blobs = await BlobContainer.ListBlobsSegmentedAsync(prefix : TestSiteName.ToLowerInvariant(), useFlatBlobListing : true,
                                                                        blobListingDetails : BlobListingDetails.None, maxResults : 100, currentToken : null, options : null, operationContext : null);

                foreach (IListBlobItem blob in blobs.Results)
                {
                    await BlobContainer.GetBlockBlobReference(((CloudBlockBlob)blob).Name).DeleteIfExistsAsync();
                }
            }
Ejemplo n.º 6
0
            private async Task ClearAllBlobSecrets()
            {
                // A sas connection requires the container to already exist, it
                // doesn't have permission to create it
                if (RepositoryType != SecretsRepositoryType.BlobStorageSas)
                {
                    await BlobContainer.CreateIfNotExistsAsync();
                }

                var blobs = await BlobContainer.ListBlobsSegmentedAsync(prefix : TestSiteName.ToLowerInvariant(), useFlatBlobListing : true,
                                                                        blobListingDetails : BlobListingDetails.None, maxResults : 100, currentToken : null, options : null, operationContext : null);

                foreach (IListBlobItem blob in blobs.Results)
                {
                    await BlobContainer.GetBlockBlobReference(((CloudBlockBlob)blob).Name).DeleteIfExistsAsync();
                }
            }