CreateContainerIfNotExistAsync() public méthode

Creates the blob container if it does not exist, and sets its public access permission to allow downloading of blobs by their URIs.
public CreateContainerIfNotExistAsync ( ) : Task
Résultat Task
Exemple #1
0
		internal static async Task OneTimeInitializeAsync(CloudStorageAccount azureAccount) {
			var blobStorage = new AzureBlobStorage(azureAccount, BlobController.DefaultContainerName);
			await blobStorage.CreateContainerIfNotExistAsync();

			Task.Run(async delegate {
				while (true) {
					await blobStorage.PurgeBlobsExpiringBeforeAsync();
					await Task.Delay(AzureStorageConfig.PurgeExpiredBlobsInterval);
				}
			});
		}
Exemple #2
0
 /// <summary>
 /// Ensures that the Azure blob container and table are created in the Azure account.
 /// </summary>
 /// <param name="azureAccount">The Azure account in use.</param>
 /// <param name="blobStorage">The blob storage </param>
 /// <returns>A task representing the asynchronous operation.</returns>
 private static async Task InitializeLocalCloudAsync(CloudStorageAccount azureAccount, AzureBlobStorage blobStorage)
 {
     var tableStorage = azureAccount.CreateCloudTableClient();
     await Task.WhenAll(
         tableStorage.GetTableReference(AzureTableStorageName).CreateIfNotExistsAsync(),
         blobStorage.CreateContainerIfNotExistAsync());
 }