Change Azure website app settings from code

You can also use the Azure Fluent Api. using Microsoft.Azure.Management.Fluent; using Microsoft.Azure.Management.ResourceManager.Fluent; using Microsoft.Azure.Management.ResourceManager.Fluent.Authentication; using Microsoft.Azure.Management.ResourceManager.Fluent.Core; … public void UpdateSetting(string key, string value) { string tenantId = “a5fd91ad-….-….-….-…………”; string clientSecret = “8a9mSPas………………………………=”; string clientId = “3030efa6-….-….-….-…………”; string subscriptionId = “a4a5aff6-….-….-….-…………”; var azureCredentials = new AzureCredentials(new ServicePrincipalLoginInformation { ClientId = clientId, ClientSecret = clientSecret }, tenantId, … Read more

Upgrading Node on an Azure website?

Ensure the Azure Web App has the node version you want. Go to yoursite.scm.azurewebsites.net Choose Debug Console (PowerShell or CMD) Navigate to D:\Program Files (x86)\nodejs Run dir to see the available nodejs versions. For instance, if there is a directory named 6.3.0, then you can use it. // App Setting WEBSITE_NODE_DEFAULT_VERSION 6.3.0 // package.json engines”:{“node”: … Read more

Adding custom properties for each request in Application Insights metrics

It looks like adding new properties to existing request is possible using ITelemetryInitializer as mentioned here. I created sample class as given below and added new property called “LoggedInUser” to request telemetry. public class CustomTelemetry : ITelemetryInitializer { public void Initialize(ITelemetry telemetry) { var requestTelemetry = telemetry as RequestTelemetry; if (requestTelemetry == null) return; requestTelemetry.Properties.Add(“LoggedInUserName”, … Read more

Rewriting a URL in an Azure web app

You need to create a web.config file in your wwwroot folder and put the relevant config entries there. Here’s an example of an web.config rule, to give you an idea of what it should look like. The below example redirect the default *.azurewebsites.net domain to a custom domain (via http://zainrizvi.io/blog/block-default-azure-websites-domain/) <configuration> <system.webServer> <rewrite> <rules> <rule … Read more

How to deploy a Flask+React application to Azure Web Service

Newest After testing, the python project is deployed in the webapp, the react project is deployed in the virtual application, and the normal node project is also deployed in the virtual application. Deploy the flask python project to the windows environment, the normal deployment method will fail, please be sure to follow this blog document … Read more

Publish Multiple Projects to Different Locations on Azure Website

Go to the Configure tab for the site in Azure portal. Scroll all the way to the bottom then add a new application where ever you want like Project2 below. Basically the ‘Project2’ part is the URL after the root “https://stackoverflow.com/” and the ‘site\wwwroot\Project2’ is where the actual folder should live under the site root … Read more