private static async Task CreateBlobContainerForImageStore()

in JfkWebApiSkills/JfkInitializer/Program.cs [131:154]


        private static async Task<bool> CreateBlobContainerForImageStore()
        {
            Console.WriteLine("Creating Blob Container for Image Store Skill...");
            try
            {
                BlobContainerClient container = new BlobContainerClient(
                    connectionString: ConfigurationManager.AppSettings["BlobStorageAccountConnectionString"], 
                    blobContainerName: BlobContainerNameForImageStore);
                await container.CreateIfNotExistsAsync();
                // Note that setting this access policy means that the container will be publically accessible.  This is necessary for
                // the website to work properly.  Remove this next line if you start using this code to process any private or
                // confidential data, but note that the website will stop working properly if you do.
                await container.SetAccessPolicyAsync(PublicAccessType.BlobContainer);
            }
            catch (Exception ex)
            {
                if (DebugMode)
                {
                    Console.WriteLine("Error creating blob container: {0}", ex.Message);
                }
                return false;
            }
            return true;
        }