azure-web-sites

How to detect if ASP.NET site is running locally, in azure web role, or azure web site?

ε祈祈猫儿з 提交于 2019-12-07 06:07:16
问题 Note: This is different from the question of detecting running locally versus in an Azure role, which I understand has been answered already. I've got an APS.NET MVC app which I deploy to Azure. I'm running V2.5 of the Azure tooling. I'd like to be able to detect which of the following three scenarios the code is running in: Locally (debugging on IIS), Azure website or Azure web role I've seen in other posts the suggestion to use the following: RoleEnvironment.IsAvailable However, this seems

How to use sticky staging slots in Azure Arm Templates

不打扰是莪最后的温柔 提交于 2019-12-07 04:57:03
问题 How can you deploy sticky settings to a production app slot in azure web apps using ARM templates without overwriting the existing app settings? I'm using Azure ARM templates to deploy my environment and code releases. The environment has both Staging and Production slots. Part of the deployment is deploying AppSettings. We deploy to Staging, test, then swap to prod. This system has been working well until now, when I need to deploy a sticky AppSetting to prod. Normally, the deployments are

The “Microsoft.CodeAnalysis.BuildTasks.Csc” task could not be loaded

大憨熊 提交于 2019-12-07 04:38:26
问题 I'm trying to publish a newly created asp.net 4.6 web project to Azure web apps and receiving the following error: remote: D:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(316,9): error MSB4062: The "Microsoft.CodeAnalysis.BuildTasks.Csc" task could not be loaded from the assembly D:\home\site\repository\packages\Microsoft.Net.Compilers.1.0.0\build..\tools\Microsoft.Build.Tasks.CodeAnalysis.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=14

How does memory usage, cpu time, data out, and file system storage apply to my website?

断了今生、忘了曾经 提交于 2019-12-07 01:45:27
问题 Pardon my ignorance but I have a few questions that I can not seem to get the answers by searching here or google. These questions will seem completely dumb but I honestly need help with them. On my Azure website portal I have a few things I am curious of. How does CPU-Time apply to my website? I am unaware how I am using CPU unless this applies to hosting some type of application? I am using this "site" as a form to submit data to my database. What exactly does "data out" mean? I am allowed

C# DateTime.Now in Azure not reporting GMT - can the default timezone be set?

随声附和 提交于 2019-12-07 01:12:10
问题 In azure websites the DateTime.Now always gives back the time in UTC, where I need to be able to set the timezone to GMT, so all times are currently an hour out. I'm not able to change any of the code at this point, so the question is whether the default timezone can be changed either in configuration or programatically (it's possible to set the default culture in Global.asax to ensure date formats are correct). 回答1: First, GMT is essentially the same as UTC - it has no offset. To be precise,

Azure websites throw 500 error when there is a colon in the URL

纵然是瞬间 提交于 2019-12-07 00:09:15
问题 External clients are hitting my Azure website with urls that contain the colon (:) character. The request are not valid, but on my old IIS server it would give a 404 error. On Azure, the same URL will give a 500 error. This wastes my time, as I have to check the logs. This is an example of a request: http://www.example.com/http:/www.example.com Is there any way of avoiding this behaviour on the server side, and give 4xx error instead? Keep in mind, this problem is on Azure only, and I do not

Azure Website Exception: Format of the initialization string does not conform to specification starting at index 0

≡放荡痞女 提交于 2019-12-06 22:16:31
问题 I have an Azure Website that I use to host my MVC + Entity Framework project. When I run the site locally using the same connection to my SQL Azure database, everything works perfectly, but when I deploy the site to my Azure Website, I get the following error: Format of the initialization string does not conform to specification starting at index 0. I followed the steps in several other posts and added the connection string to the thrown error and this is what the connection string comes out

configure mime types windows azure websites php app

一世执手 提交于 2019-12-06 21:19:04
问题 I'm using Windows Azure Websites to host a php app. My app uses webfonts (css3 feature) and I need to configure extensions such as .eot; .woff to avoid 404 errors. I know that it's possible to set this kind of configs using web.config in a .net app, but for a php site, what can I do? Unfortunately there's no RDP for websites. Is there another way to solve this? 回答1: I could solve this just adding a web.config to root folder. <?xml version="1.0" encoding="utf-8"?> <configuration> <system

Securing a network between a website and VM in azure

守給你的承諾、 提交于 2019-12-06 19:35:09
问题 I understand that in windows azure you can add VMs to a virtual network, but I don't see the option to add a website to a network. what is the recommended way of securing access to a VM (MongoDb) from an azure website? I would much prefer have the db behind some sort of firewall rather than traffic going through the public internet. Edit: the vm will be hosting MongoDb, so using Sql Azure or other MSSql solutions isn't an option. 回答1: IF you are looking to use networking and your own database

Scale Azure WebApp using .NET SDK

三世轮回 提交于 2019-12-06 17:08:35
Description of the Microsoft.WindowsAzure.Management.WebSites NuGet package says that it " Provides management capabilities for Microsoft Azure Web Sites. Deploy, configure, debug, and scale your websites " What class and methods should I use to perform a scaling operation? My previous question on this topic was marked as duplicated, but I don't agree, here is an explanation: Scale Azure web app with Azure Management Libraries for .NET Try this PSEUDO code. You'll need to transform config from Response to Update model. var config = client.WebSites.GetConfiguration(webspace, website); config