ImageResizer with AzureReader2 while hosted on GitHub Depoyed Azure Website throws 404s - azure-web-app-service

When I call use AzureReader to resize an image I get a 404, yet if I don't do a resize the passthrough call works perfectly.
I think it is due to the problem stated on the /resizer.debug.ashx page:
"Precompilation is enabled. Image providers may not work as expected."
The problem is I'm deploying through GitHub and don't know how to control precompilation.
So my question(s) are:
1. Am I right in thinking this is precompilation related? If not then what?
If so
2. how can I block precompilation on GitHub based deploy
3. how can I work around precompilation problem? (i've seen http://sunali.com/2008/01/09/virtualpathprovider-in-precompiled-web-sites/ but am not able to see how to apply to my problem)
On other point... incredibly similar code deployed fine to AAzure via Github 6 months ago and worked... has Azure Websites changed something with deployment in last 6 months or so?
Many thanks,
RIchard

Microsoft's VirtualPathProvider framework does not work in Precompiled mode.
Typically, this manifests as failure on direct access (without resizing).
However, AzureReader2 is unique among the blob providers in that it redirects to the original blob instead of directly serving the image when no changes are required.
You may be able to set vpp=false on the <add name="AzureReader2 vpp="false"/> element an get it to work.

Related

Kentico GetAzureFile.aspx badhashtext error

I've recently copied a Kentico 10 environment to a new development environment, and upgraded it to Kentico 12. I believe the problem occurred after the upgrade, not after the copy (of the site and database). The new environment is also using a different URL than the original, and I have a valid license key for the new URL.
The site functions correctly, except for images. Unfortunately, all media library images that are loaded using GetAzureFile.aspx are failing to load. Attempting to access one causes a redirect to
/CMSMessages/accessdenied.aspx?resstring=dialogs.badhashtext&hash=...
I assumed the problem might be a different CMSHashStringSalt in the new environment's web.config, but it is the same as that of the original environment.
Per this documentation, I have attempted to re-save some of the images to see if they would begin loading but that did not help.
Does anyone have any suggestions on how I might tackle this problem?
Thanks
I don't believe that GetAzureFile() is something you should be using "publically", I believe that's meant to be an internal handler. You should be using the permanent URLs for media libraries hooked up to external storage.
Also, your provider code could need to be updated. Check out the documentation.

Where can I see the files for a Azure static web app? Image file doesn't seem to have been deployed

I'm playing around with Azure Static Web Apps and have built a simple Blazor App which I've deployed. I added a Contacts page with an image that appears when built and running in Visual Studio but the image is missing when the app is is deployed via a GitHub Workflow Action. I've checked the file is present in the GitHub repo. I'm just using the free version of Azure static web apps for testing and believe the files are deployed to blob storage.
I can see two similar related questions to my problem but neither of them provide a solution to my issue
Is there a way to view files in Azure Static Web App?
Azure static web apps not loading page resources correctly. css or javascript files
As per the link to the first question above, is there a way to see the files deployed to check if the file is actually there? Everything I'm seeing tells me it's not! - the image is not showing and copying the link to a new window gives me the usual file not found. Link looks absolutely spot on - https://madeupbit.azurestaticapps.net/FundXWebTelNo1.png. I deliberately moved the file out of a separate images directory into the root to eliminate any of the possible issues mentioned in the second question linked above.
And I guess the second question is if it's not there, how do I get it there seeing the automated GitHub Workflow Action ain't doing it. Of course there may be something else going on so any suggestions welcome!

Windows Azure deployment keeps a old version of the Silverlight application

I have a small solution that is composed out of 2 main projects a Mvc4 Web Api and a silverlight 5 Application. I've configured and deploy the application initially on the Azure platform and it all went great, but ever since when I deploy again the silverlight project does not get pushed and the online site has the old version.
I should mention all works great with the azure simulator on my local dev machine.
Anybody had a similar issue?
Regards,
I would suspect first (as Simon suggests) that the browser likely still has the previous client cached and loads that instead of downloading your new client.
You can use the version number in the code on your page that hosts the silverlight app to help. While it's easy for you to clear the cache - you don't really want to have to tell users to do that whenever you update.
Set the version to whatever your latest assembly version is (silverlight client project assembly), this will force the browser to download the client if the cached version is a lower number.
<param name="source" value="AppPath/App.xap?version=2.0.0.6"/>
Ok,
So after pulling my hair out, I finally figured out.
I have to change the build configuration to release in VS do a rebuild and then do publish because apparently the azure project does not do rebuild on the project when you publish it.
To solve this issue you'll need to identify the source of the problem (is it a client side problem where you have a caching issue or not). Even though you say caching isn't the problem we'll need to be sure about this first.
What I suggest is that you do the following first:
Activate Remote Desktop on your role
Connect through RDP and save this file to the role: http://support.microsoft.com/kb/841290 (fciv.exe)
Find the *.xap file (usually in E:\sitesroot) and get its checksum (using fciv.exe)
Modify the Silverlight project locally (maybe change a label or move around an element) to make sure its hash has changed.
Redeploy the application
Connect through RDP and use fciv.exe to get the checksum of the *.xap file once again
Compare both checksums
If the checksums are different, then it means that the deployment worked correctly and the Silverlight xap has been updated. If the checksum is the same, the problem lies with the deployment.
Please let us know the result so we can help you find the solution.

Difference in output on Azure

I've run into a little problem here. What I get on my local environment and my cloud result is different... I've tried using IntelliTrace, but everytime I want to debug a track it gives me a No source available message.
There aren't any exceptions or anything like that, everything loads perfectly fine... it just seems like the 4th case of the switch-case is screwed. I'm using 4 const ints in a static Common.cs file to populate these 4 possibilities; I know I could be using an enum, but it shouldn't really matter, right?
If this helps, I am also using Telerik's RadChart control. In other words, these 4 options manipulate the data in 4 different ways. People have told me that there is no way to debug code hosted within Azure, and that I could probably use Azure Diagnostics and keep tracing every few lines or so...
Does anyone have any pointers on which direction I should go? or have faced similar problems before? Many thanks... I am pretty much clueless in here.
EDIT: The problem lay with the localization on Azure. On my local machine the date format is dd/mm/yyyy, whereas on Azure it is mm/dd/yyyy. Hence, the problem arose...
It seems to me you're using a web role. If that's the case, the quickest way to explore differences between local deployment and azure deployment is to enable Web Deploy on your cloud project.
Once you've done that, use the Publish option on the Web project (NOT on the cloud project) to quickly upload your code changes to Azure, and explore doing old-fashioned Response.Write.
Ugly, but quite efficient when you don't get what's happening.
Pierre

SharePoint 2010 Web part Deployment Error

When I deploy my web part locally everything is fine. The web part is registered as safe, and is completely usable.
When I deploy the wsp to another server the web part comes back with the following error although everything appears to be deployed correctly (and the SafeControls appear within the web.config). :
Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type XXXXX could not be found or it is not registered as safe.
It is almost the exact same issue as this question. The only difference being that when I look at my web.config on the server I am deploying to I DO see the SafeControls.
Any thoughts on things that I could try to fix the issue? Server settings, how I package or deploy, etc.
I was able to solve my issues by manually removing the solution from the GAC. Then I just tried to add the solution again and everything works well.
I had added the web part in question after the initial upload of the solution (sorry about leaving that part out of the description). Before doing this I was trying to retract and delete from the Central Admin then retry the addition. Apparently this didn't actually delete the solution from the GAC.
The site was using the old version of the solution which did indeed not include a SafeControl for the new web part. Once the old version was removed the addition of the new version went without a hitch and all is well.
Thanks to all for their suggestions.

Resources