-
-
Save johndowns/1acfa2bb8cdd24e6f7e38251bc766631 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
var storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageAccountConnectionString"]); | |
var storageClient = storageAccount.CreateCloudBlobClient(); | |
var storageContainer = storageClient.GetContainerReference("mycontainer"); | |
await storageContainer.ExistsAsync(); | |
} | |
catch (StorageException ex) when (ex.RequestInformation.HttpStatusCode == 403) | |
{ | |
return req.CreateResponse(HttpStatusCode.InternalServerError, "The storage account key is not valid."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment