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

                await BlobContainer.CreateIfNotExistsAsync(CancellationToken.None);
            }
Exemple #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();
            }
        }
Exemple #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);
        }
Exemple #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();
                }
            }
Exemple #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();
                }
            }