Windows Azure cloud service asp.net config file changes - asp.net

I have deployed my asp.net web site using cloud service. I have deployed it by publishing from Visual studio.
problem is every time if i have to make changes to web.config, i have to redeploy from visual studio.
Is there anyway we can directly modify from windows azure? I don't want every time developer should involve in this.

Instead of defining your settings in web.config file, you should define them in Service Configuration File (*.cscfg). Then you should be able to change the values from Azure Portal and other means without redeploying your code.
At any cost, stay away from making web.config changes in the deployed code (using RDP or some other means). If for some reason Azure decides to deploy your code in other VM, your changes will be lost. See this thread for more details: Azure Webrole loads old website version after restart.

Related

Can i deploy Azure project on IIS?

I have solution with startup project that have .ccproj format. This is an Azure project that require Azure SDK installed. By default i am able to run it using IIS Express with Azure storage emulator & Azure compute emulator. But when i make some changes i need to recompile entire solution and re-run it. How can i deploy it in IIS server ? Could you advise me alternative deploy method how to run it in simplest way ?
I want to re-compile and attach to process after make some changes in project without restarting IIS Express & Azure emulators, it takes a lot of time.
#DotNetGoose,
should be able to run on IIS but you will need to abstract all the calls that your code read content from RoleEnvironmental and direct them to read from Web.config, and have a copy of corresponding settings in your web.config.
once the abstraction is done, set your web app as default startup project, you should be able to run them as normal web app on iis or iisexpress.

How to only deploy changed project files in Windows Azure?

I am working on a web project in ASP.NET which is integrated with Salesforce. I have published my web project in Windows Azure. Now I have some changes in particular files and I want to deploy these changes only rather than complete project.
If you are using Web Deploy from within Visual studio, it will automatically only deploy the changed files in a differential manner. Alternatively, if you are using Azure VM's or a Cloud Service (which is actually VM's), you can connect to the machine(s) using RDP and update select files manually. You can get the RDP information to the machine from the Azure Portal.
http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-log-on-windows-server/

Deploy to an Azure WebRole without Visual Studio

Is there a way I can deploy my entire website/webapp to an Azure WebRole without the need of Visual Studio?
Context: We have a test environment where there's an IIS hosted web app where our testers test (of course). The thing is, we want to grab that exact tested web app folder and deploy it "as is" to a WebRole.
Please avoid commenting on our procedure, we have been looking at it and we will eventually change it if we have to, I just need a 'simple' yes(how)/no answer.
IIS Web Deploy can be used to package/migrate/restore IIS applications. It can be enabled while deploying a web role as described in this article and allows to update the web role with the application as deployed in your test environment.
Be aware that only single instance cloud services are supported and that in case of a maintenance operation by the fabric controller, your service will be rolled back to the state created by the initial azure package deployment. (There once was a tool for syncing between multi-instance web deployments but sadly that did not work out too well and is no longer supported. Do not attempt to use or rebuild it.)
Installing and Configuring Web Deploy shows the steps to get web deploy for your local testing IIS while articles on using web deploy like this one show examples for calling the tool.
Another option to evaluate are azure websites and git deployment. This could provide you with a documented and reproducible form of deployment that is not prone to unwanted rollbacks while allowing the service to scale to multiple instances. This option might not work out if the application it too tied to the web roles infrastructure or contains code not suitable for the more restricted web sites environment.
A third option to look at is using CSPack as presented in this article. You basically create a service definition and package up the webapp manually without building it in Visual Studio or TFS.
Yes - make sure you have enabled Remote Access on your webrole. Then copy your web app from your local IIS folder to F:\sitesroot\0 (NOTE - may be E:\sitesroot\0 on same web roles).
Yes, you can write a programmatic interface against Web Deploy from your C# code. If you're deploying to Azure Web Sites, you could also use the Windows Azure Management Libraries to spin up new web sites or clouand deploy them.

Windows Azure: Can I just use it like a standard Windows 2008 Server?

I've created an Azure server instance. I've deployed a simple application to it. As part of the deployment process I enabled Remote Desktop Connections.
I have some standard ASP.net applications that run on Windows, is there something to stop me deploying these applications manually to IIS using Remote Desktop. I've read so much about having to migrate standard ASP.net apps to Azure. I don't want to this as we will have customers who will still use Windows Server 2003/2008 so I don't want to have to maintain 2 versions.
Well, as I understand it, in theory you could deploy stuff using remote desktop. But when the instance shuts down/restarts you'll lose it all (unless you've built it into your startup scripts) and have to re-load everything each time. The main reason they suggest you have at least two instances is so that when one shuts down for updates etc there is always at least one other running.
The "Windows Azure Accelerator for Web Roles" project allows you to create an Azure web role which then enables you to use web deploy for all your other web sites - I'm guessing that will be a whole lot better approach and is definitely worth a look. Also, I believe smarx.com is a good place to browse for info and ideas.
Using a startup task and the Azure Bootstrapper you can download, unzip, install almost any kind of 3rd party software that supports either xcopy deployment (just copy the files) or an unattended(silent) install.
Assuming you aren't using Azure storage or anything like that, there shouldn't be any difference with the IIS application. If you are using anything specific to Azure, you can use the RoleEnvironment.IsAvailable to test if you are running inside Azure or not. That will return true for the emulator as well. If you want to use Azure storage from both, you can add the settings in the web.config to use if not running in Azure.

ASP.NET ASMX Web Service

I have a website published in IIS 7.0 which works perfectly. I just wanted to add a few more functions that I have created. When I replaced the IIS files with the new version, it didn't update the files and still showed the old services. The new services should be in place at the server but this is not working.
I used the same procedure when I published but I don't know what's wrong.
Stop your service, and restart. I also suggest that you create a custom Application Pool in IIS for your application as it will have it's own disposal area and not interfere with any other application.
You can also try to stop the service, delete the contents of the folder, and then upload your republished code and restart the application.

Resources