How to configuration cache for azure websites? - azure

I tried to set up caching in a role, but the documentation I have says it needs to be within the same CloudServices publishing project in order for it to be accessible...
Here's the documentation I followed to setup a cache cluster.
http://www.windowsazure.com/en-us/develop/net/how-to-guides/cache/
My problem is my website is a normal mvc project that I publish to Azure Websites. It is not a WebRole. So the
<autoDiscover isEnabled="true" identifier="[cache cluster role name]" />
is definitely not going to work for me.
Is there a way I can get the ip + port the cache cluster is located at and some credentials and set up my website to be able to use the cache client and access it?
If not, can someone get me more up-to-date info on how to set up a Windows Azure Shared Cache? This documentation appears to be dated because I cannot find the option to create a shared cache in management portal... http://msdn.microsoft.com/en-us/library/windowsazure/gg618005.aspx
Thanks.

If you get redirected to the new HTML portal, you can click on your user name in the top right hand corner of the screen and select the "previous portal" link to get back to the old Silverlight portal.

Related

What causes azure websites to ignore settings from web.config?

My web.config contains multiple entries in "appSettings" (e.g.: twilio account key). One of these is for the asp.net chart control. It's the configuration part that states where the images the control generates are to be stored.
All of these settings work on my development machine. That is, i can connect to twilio and the chart control stores image in memory (as it should, according to the settings).
When i publish the site to my azure website (using vs), all of the settings work, apart from the chart control one. The chart control behaves as if the setting isn't even there. (it defaults to c:\TempImageFiles for storage).
I looked into the published version of the web.config and the setting is there. Only, it's beeing ignored.
My next attempt was to add that setting using the portal. (It's possible to add appSettings for a web app using the portal). I copied the exact same setting from web.config into the portal settings. This worked, so there is nothing wrong with what's in the settings.
So my question is: Why are some (at least this one) settings from web.config ignored when the app runs inside an azure web app?
You might have an app setting defined in the Web App's configuration with an identical name that overrides the web.config setting. This is typically done to have production settings stored in Azure instead of Web.config.
You can confirm if this is the case by opening your Web App's blade in the new portal, and checking the Application Settings tab there.
azure websites / azure web app service are typical web applications running on top of azure PaaS infrastructure. So whatever storage allocated to the service is accessible from the app. But it cannot be the typical C: or D: where in a regular server the app may have complete access. Mostly the C: space is allocated for IIS hosting. D:\local is something you can utilize as the app will have complete read and write access.
Please refer azure web app service sandbox details here.
If you are accessing the path via code try using Server.MapPath property to get access to the path. options like Path.GetTempPath() will not work.
One point to note is, any local storage in azure PaaS services is to be treated like a temporary storage. Whenever the site, service or role recycles the storage will be gone a fresh storage will be assigned.

Web service migration from Local IIS to Azure

I Used Azure Website Migration Assistance to migrate my web service that was running on my Local VM's IIS. My Migration process was successful and also I was able to use this web service. But I can't find where to find the migrated source code in azure portal. All I can see is some 20Mb of data in on the dashboard graph of azure portal. If I need to changed some of my code where to do this?
What is on the Azure Web App should now match what was on your IIS server. Now, to update the web app, you can use the deployment techniques here: https://azure.microsoft.com/en-us/documentation/articles/web-sites-deploy/
The simplest method to deploy to check what content is on your web app would be to use the SCM site. This is available at: https://your-site-name.scm.azurewebsites.net. Go to Debug Console > CMD and then the site > wwwroot folder to see your web app content. You can also upload to the site via drag and drop.
Alternatively, you can download the publishing settings for your web app via the portal and then re-use the migration tool, select the site, and then upload the publishing settings. However I would suggest using the deployment techniques above first. (Disclaimer: I wrote the migration tool.)
There are multiple ways to push changes to your Azure Website/Web App. They are listed here: https://azure.microsoft.com/en-us/documentation/articles/web-sites-deploy/
One simple way is to use an FTP client like FileZilla. In the classic portal, you will find the FTP address (hostname) and the credentials in the dashboard tab. In the new portal, select your Web App and the FTP address will be displayed in the Essentials section at the top of the page. Click on Settings and Deployment credentials to set your FTP user password.
Another simple alternative is to use Dropbox. Take a look at this video for how to set instructions: https://channel9.msdn.com/Series/Windows-Azure-Web-Sites-Tutorials/Dropbox-Deployment-to-Windows-Azure-Web-Sites

How to get .publishsettings for Web Deployable Web Role?

I enabled the Web Deploy feature for my Web Role and deployed it.
But how can I get hold of the .publishsettings file so I can create a Publishing Profile for it?
This 2 year old article states that it should have been created automatically, but I haven't got that in my profile manager.
Any ideas?
If you are using Visual Studio 2012 or greater, the server explorer to the left will have several Azure items.
Specifically the Windows Azure Compute is what we are looking for, right click on that and say 'add deployment environment'. You will then be prompted with a dialog that allows you to sign in and download publish settings file:
You can get publishsettings file from the following link: https://windows.azure.com/download/publishprofile.aspx
Well, the problem was really behind the keyboard.
So the publishing profile is actually provisioned correctly and automatically to the Web project as the documentation states.
The problem and confusion was that I have a secondary web application in my Solution that I also publish to the same Web Role (referenced as an additional Site in the ServiceDefinition.csdef file).
That Web Project does not get the Publishing Profile, and when I try to create a profile manually, it doesn't work since that (secondary) IIs instance is not configured for Web Deployment.
Oh well, back to the tedious Cloud Service deployment it is...

Credentials rejected by remote desktop to Windows Azure Web Role

I have created a Cloud project on VS 2012 with .net 4.5. This consists of two web roles, an API and an front end website.
I have followed the instructions here: http://msdn.microsoft.com/en-gb/library/windowsazure/gg443832.aspx in order to set up remote desktop, and deployed the service.
When I try to connect (I have double and triple checked the credentials), I get told that 'The credentials that were used to connect to did not work. Please enter new credentials.
My web roles are both operational, and I can visit them both in the browser.
I have tried waiting a while after deploying for changes to propagate, but this makes no difference. The only thing I can think of is that I have not done anything with certificates as of yet other than download the appropriate bits in order to deploy from visual studio. I can't find any documentation that says I need to though.
I have also tried out adding various domains to the username but nothing works.
Am I missing something, or is there a chance that there is a bug with azure at the moment?
EDIT: Have now tried deleting the cloud project from visual studio, deleting the cloud service in azure and redeploying with only a single web role. Still seeing the problem.
Just checking for completeness,
Did you use the button on the website for your first access?
http://blogs.msdn.com/b/avkashchauhan/archive/2011/04/03/how-to-login-into-windows-azure-virtual-machine-using-remote-desktop.aspx
On the other hand, this is the link that worked for us, it includes how to set up the cert needed too.
http://geekswithblogs.net/MagnusKarlsson/archive/2012/12/03/connect-to-running-web-role-from-remote-desktop-connection-and.aspx
I fixed this by removing the <Import moduleName="RemoteAccess" /> and <Import moduleName="RemoteForwarder" /> lines from the .csdef then removing all references to Microsoft.WindowsAzure.Plugins.RemoteAccess and Microsoft.WindowsAzure.Plugins.RemoteForwarder within the .cscfg files. I then was able to deploy and enable remote desktop access from the newer Azure portal.
After adding users to the Azure Active Directory Domain, (e.g. smith#mydomain.onmicorosft.com), I tried logging in as one of those users, but got "Your credentials did not work." After some trial and error, I found that I had to add the users (e.g. smith) as local users on the VMs. Once I did that, and assigned, passwords, the users could RDP in.

Published Web app to Azure, how do I browse to it, monitor it?

I have created my first app for azure. It's has an MVC3 web role which writes some data to table storage.
It also has a worker role that does some work behind the scenes to the same data.
It all works fine in the emulator.
I've uploaded it all to Azure as a staging deployment, the hosted service it is reports all roles as "ready". The health for all roles is "healthy", though the worker role appears to crash and goes to "degraded" and then resets itself (I assume this is what is happening).
So what now? I have found a "DNS Name" on my Web Role in the form "http://{guid}.cloudapp.net/"
Clicking on that link just gives me a network access error, http://www.downforeveryoneorjustme.com/ can't find it either.
What am I missing? Where can I see diagnostics similar to the emulator? I've set "Enable Diagnostics" to use my Azure storage account in each role. How do I get into the storage to see if it has traced anything? Can this be done through the Management Portal?
I've tried searching through MSDN, but I can't find a page that says "and then you click the DNS name link and your website will launch. I'm sure there is a lovely page like that but I can't find it.
thanks in advance!
In August 2011, the Windows Azure role templates were updated to work with the ASP.NET Universal Providers. As such, when you create a new project, the session state provider is backed by SQL Express by default. If you don't change this to SQL Azure or Cache (or disable session state), you'll run into issues.
I'm not sure this is exactly the issue you're running into, but it's a common one. See Nate Totten's blog post for more information about this (Nate calls out this issue a few pages down, under IMPORTANT NOTE).
You can access diagnostics data directly from Visual Studio Server Explorer.
Here you have all necessary information: Browsing Storage Resources with Server Explorer http://msdn.microsoft.com/en-us/library/windowsazure/ff683677.aspx
Personally I use Azure Diagnostics Manager from Cerebrata http://www.cerebrata.com/products/AzureDiagnosticsManager/ that is easy and has a good dashboard

Resources