예제 #1
0
        /// <summary>
        /// Walk from the parameter up to the containing type, looking for a
        /// <see cref="StorageAccountAttribute"/>. If found, return the account.
        /// </summary>
        internal static string GetAccountOverrideOrNull(ParameterInfo parameter)
        {
            StorageAccountAttribute attribute = TypeUtility.GetHierarchicalAttributeOrNull <StorageAccountAttribute>(parameter);

            if (attribute != null)
            {
                return(attribute.Account);
            }
            return(null);
        }
예제 #2
0
        private static async Task DeleteQRCodeAsync(string vanityUrl, Binder binder)
        {
            StorageAccountAttribute storageAccountAttribute = new StorageAccountAttribute("AzureWebJobsStorage");
            CloudStorageAccount     storageAccount          = await binder.BindAsync <CloudStorageAccount>(storageAccountAttribute);

            CloudBlobClient    client    = storageAccount.CreateCloudBlobClient();
            CloudBlobContainer container = client.GetContainerReference(QRCODECONTAINER);

            CloudBlockBlob blob = container.GetBlockBlobReference($"{vanityUrl}.png");
            await blob.DeleteIfExistsAsync();
        }