To var connectionString = "UseDevelopmentStorage=true" AZURE STORAGE EMULATOR MAC CODEIn the code I posted above, I changed the lines // Retrieve storage account from connection string I figured it out!! Or more appropriately I found the answer here: The code above is just the short form of the big connection string I specified above. var connectionString = "UseDevelopmentStorage=true" So your connection string would be something like: var connectionString = the endpoints I have specified in the connection string. If you want to connect to storage emulator using account name and key, you would need to provide additional details like different endpoints. Since the key for devstoreaccount1 in the cloud is not the one you provided, you get 403 error. When you just specify the storage account name and key for the storage emulator in your connection string, storage client library treats it like a cloud storage account and tries to connect to using the account key you provided. For example, the default blob endpoint for a cloud storage account is while the blob endpoint for storage emulator is. After all, the MSDN article by MicrosoftĪccount name: devstoreaccount1 Account key:Įby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=īasically storage emulator has different endpoints than the cloud storage account. Quite frankly I am a little annoyed that the original code did not I've explained exactly how I made my project but I'd be willing to upload the entire thing if anyone is wants to just try running it. Are the versions of the dlls in my project somehow incorrect for development emulator? Or maybe there is a bug in v2.1? I was wondering if maybe there is some issue on my machine, or maybe there is some conflict between the Azure. Do I need to somehow add some permission to the development storage emulator? I don't understand why it says Forbidden. so basically the container cannot be created.Ĭan someone can tell me what is wrong here. If I navigate to it should fire my Action method. Now I go to Debug > Start Debugging, and it launches the site in a browser window as expected at localhost:57810. I did not create a cloud project or anything, so when I run this it will run on "Local IIS Web Server" as per the project properties (also known as IIS Express). AZURE STORAGE EMULATOR MAC WINDOWSStart > All Programs > Windows Azure > Emulator > Windows Azure Compute Emulator I make sure the compute emulator is started : Return Content("Blob uploaded to container on storage emulator") Using (var fileStream = Azure\Azure NOTES and stuff\table.jpg")) Create or overwrite the "mytestblob" blob with contents from a local file. Retrieve reference to a blob named "mytestblob".ĬloudBlockBlob blockBlob = container.GetBlockBlobReference("myemulatortestblob.jpg") Create the container if it doesn't already exist. Retrieve a reference to the previously created container.ĬloudBlobContainer container = blobClient.GetContainerReference("myemulatortcont") Retrieve storage account from connection stringĬloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings) ĬloudBlobClient blobClient = storageAccount.CreateCloudBlobClient() Public ActionResult AddBlobToBlobContainerStorageEmulator() As you can see it is pretty much the standard code you find in beginner examples This action is supposed to create a container on Azure blob storage, and upload a file to it. This is basically the account name and key everyone is supposed to use when using the emulator. In Web.config file, I add the following tag within the tags I believe this puts version 2.0.6.1 in my project references.Īside from that I see that my references also include I use NuGet to get "Windows Azure Storage". That creates the basic project template with a HomeController.cs and AccountController.cs So it seems my problem is only with emulator storage. I am able to create a cloud project in VS2012 if I want to, and if I do it successfully launches on the emulator. Windows Azure Tools for Microsoft Visual Studio 2012 -v2.1.If I look in Add/Remove programs I see I have I have installed the additional stuff required for Azure using Web Platform installer. AZURE STORAGE EMULATOR MAC PROI have both Visual Studio 2012 Pro and Visual Studio 2012 Express for Web (which is free). I will describe in detail what I have done.įirst let me reassure you that I have everything necessary installed (I think): AZURE STORAGE EMULATOR MAC TRIALHowever my 3 month trial expired without me really using it at all, and now that I've returned to looking at Azure I must run on storage emulator (after changing the connection string to dev storage). I had previously successfully run this same program on Azure. I keep getting a 403 forbidden error even though this is developer storage. I just cannot seem to get it to work and have wasted an entire day trying without success. I am attempting to use the Azure Storage Emulator to work with blob storage.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |