azure-web-sites

How to prevent an Azure website from going to sleep?

南笙酒味 提交于 2019-11-28 08:08:38
I deployed an ASP.NET 5, MVC 6 web application to Azure. It seems that if I don't hit the site for 10-15 minutes, it goes to sleep and it takes a good 10-15 seconds for it to wake up. I am not sure whether its the website that's falling asleep, or the database that it's connecting to. So 2 questions. How do I prevent the site from going to sleep so soon. Is there a way to have visibility into what's going on in Azure with the website and the database. Are they kicked out of memory? Azure Web Apps have an 'Always on' option (with basic/standard tiers) which keep your app (and associated web

Express Applications throwing 500 on azure

徘徊边缘 提交于 2019-11-28 08:07:22
问题 The following code runs perfectly locally... var express = require('express'); var app = express(); app.get('/', function (req, res) { res.send("Hello World"); }); var port = 8080; app.listen(port, function () { console.log('Server started and is listening on port ' + port); }); But when i deploy it to azure I get a 500 error. Here is my findings... I have taken this advice Have tried all possible combinations of server.js, app.js, directory structure etc. The code is being deployed from a

ASP.NET 5: Access-Control-Allow-Origin in response

跟風遠走 提交于 2019-11-28 07:10:34
问题 From what I understand, when enabled CORS accordingly, the response model should include the following header information (provided that I want to allow everything): Access-Control-Allow-Origin: * Access-Control-Allow-Method: * Access-Control-Allow-Header: * Enabling it in Startup : public void ConfigureServices(IServiceCollection services) { //... services.AddCors(); services.ConfigureCors(options => { options.AddPolicy("AllowAll", p => p.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()

How can I keep my Azure WebJob running without “Always On”

五迷三道 提交于 2019-11-28 07:02:07
I have a continous webjob associated with a website and I am running that website on the Shared mode . I don't want to go to Always On option as there is no real need for my application. I only want to process the message when the calls are made to my website. My issue is that the job keeps stopping after few minutes even though I am continuously calling a dummy keep alive method on my website at every 5 minute that posts a message to the queue that is monitored by that webjob. My webjob is a simple console application built using the WebJob SDK that has a code like this JobHost host = new

Site in Azure Websites fails processing of X509Certificate2

↘锁芯ラ 提交于 2019-11-28 06:45:54
I have site in Azure Websites (not Hosted Service) and I need processing .pfx certificates with private key there. var x509Certificate2 = new X509Certificate2(certificate, password); But I was faced with follow exception: System.Security.Cryptography.CryptographicException: The system cannot find the file specified. at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr) at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromBlob(Byte[] rawData, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx) at

Azure websites deploy specific web project

丶灬走出姿态 提交于 2019-11-28 05:23:43
I have a solution with multiple web projects. I want to run them inside Azure Websites, each as a separate website, from the same Git repository. How do I specify which website runs which web project? AppHarbor handles this with multiple solution files named after the applications, containing the respective web project. I cannot find anything about Azure websites. Now it is as simple as using App.Settings instead of a .deployment file. This also allows for multi-project solutions in one Repo, so for example, if you have a WebAPI and a Web App in one solution you can configure an Azure Web Site

How to define connection string for session state in Azure

旧巷老猫 提交于 2019-11-28 04:44:05
问题 I am using the RedisSessionStateProvider using a procedimient like this https://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-session-state-caching/ I define its connection string in web.config , in this example is XXXXXX . <system.web> <compilation debug="true" targetFramework="4.6.1" /> <httpRuntime targetFramework="4.5" /> <globalization culture="es-CO" uiCulture="es" /> <customErrors mode="Off" /> <sessionState mode="Custom" customProvider="SessionStateStore">

VSTS: Pass build/release variables into Powershell script task

狂风中的少年 提交于 2019-11-28 04:20:50
Ideally, I would want to configure our Azure Web App application settings using build variables (on VSTS), for example: We perform our publish tasks using Powershell scripts. In order to set app settings, the following script could be used: param($websiteName, $appSettings) Set-AzureWebsite -Name $websiteName -AppSettings $appSettings I could pass these build variables manually into a Powershell script build task, like so: PrepareAppSettings.ps1 -websiteName "MyWebApp" -appsettings @{"MyConnectionString" = $(MyConnectionString);"MyRandomService" = $(MyRandomService);"MyRandomServiceClient"=$

How to signout from an Azure Application?

ぃ、小莉子 提交于 2019-11-28 03:57:16
问题 I have created a Azure AD application and a Web App. The Azure AD Application uses AAD Authentication. This works well. When I go to my URL and I am not authenticated, I have to enter my credentials. When I enter my credentials, I am forwarded to my application. But then comes the problem. How do I sign out. I have found this question and I wanted to implement option 2: not signing out using code, but using links Azure AD provides. The point is, I have no clue where to configure this. He

What is the difference between an API App and a Web App?

青春壹個敷衍的年華 提交于 2019-11-28 03:44:43
I've been reading a few tutorials now on deploying Web Apps and API Apps to Azure. However, I am still a little unsure as to why you would use one over another. I can create a new .NET solution with API controllers and deploy this as a Web App, so why would I specifically require an API App? Are these optimized specifically for ASP.NET Web API, where as Web Apps are for delivering HTML? Updating the answer to current state of Azure, App Services now replaces all Mobile, Api and Web Apps flavors as a single app framework with all the functionality rolled over to make things more accessible