Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzureSamples fails to retreive images #40

Closed
MisinformedDNA opened this issue Jul 19, 2013 · 3 comments
Closed

AzureSamples fails to retreive images #40

MisinformedDNA opened this issue Jul 19, 2013 · 3 comments
Assignees
Labels
Milestone

Comments

@MisinformedDNA
Copy link
Collaborator

  1. Open AzureSamples.sln in VS2012 SP1
  2. Perform required solution and project upgrades
  3. Debug AzureWebApplication
  4. Go to Upload.aspx
  5. Upload a file

EXPECTED: Image is successfully stored and then displayed in 3 variations

ACTUAL: Image is successfully stored, but image cannot be retrieved and results in 3 404s

  • Try to access the image without a query string

EXPECTED: Image loads

ACTUAL: Still a 404

Considering the issue I am having here, I decided to see if I could get the samples working. No luck. With the linked problem I get 404 for anything in Azure with a query string. With the sample, I always get a 404.

@MisinformedDNA
Copy link
Collaborator Author

Tried replacing AzureReader with AzureReader2, same result.

@ghost ghost assigned JaredReisinger Nov 27, 2013
@JaredReisinger
Copy link
Contributor

Looks like the problem comes down to the sample specifying connectionString="BlobConn" in the AzureReader <plugin> configuration and trying to migrate the sample to AzureReader2. The AzureReader's (1.x) virtual path provider uses CloudStorageAccount.FromConfigurationSetting() (which looks up the connection string in Azure), but the AzureReader2 virtual path provider uses CloudStorageAccount.Parse() (because FromConfigurationSetting() doesn't exist in Azure 2.x), which expects the final connection string itself, not a lookup-key.

For 1.x/2.x compatibility, AzureReader2 should be using CloudConfigurationManager.GetSetting() in order to look up the connection string, and then pass that value to CloudStorageAccount.Parse(). When I try this in AzureSamples, things still fail, however, because it doesn't seem to be detecting that it's in an AppFabric environment. This might just be configuration weirdness on my machine, however. Adding in a non-Azure placeholder in AzureWebImages' web.config like this:

<appSettings>
    <add key="BlobConn" value="UseDevelopmentStorage=true" />
</appSettings>

... does do the trick, but really shouldn't be necessary. (It also should get ignored if things are working correctly, so it might be worth putting in place to help the sample succeed.)

@lilith
Copy link
Member

lilith commented Dec 3, 2013

That looks like the correct solution; let's fix AzureReader2 and set the sample up to use UseDevelopmentStorage

JaredReisinger added a commit that referenced this issue Dec 3, 2013
Roll AzureSamples.sln back to pre-Azure-2.x version.  It was not supposed to be updated!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants