Jeff Sanders Technical Blog

I am a Microsoft employee that has worked on all aspects of the Web Stack for a long time. I hope these blogs are useful to you! Use this information at your own risk.


Earlier Posts

You have an option to create a custom startup script when using our provided (commonly referred to as ‘blessed’) images for PHP


Azure guarantees 99.95% uptime or better, but sometimes your application or database misbehaves due to something you have done (written bad code) or in the rare event there is a problem in a region.  There was not a good end to end sample of setting up an Azure App Service that was deployed to multiple regions to be responsive and that utilized auto failover if a resource or data center went down so I created this one!  This will illustrate how you can quickly and easily lay the foundation for a Geo-Distributed application in Azure built on Azure App Service, Azure Traffic Manger and Azure SQL.


For example:


You can test the key that Azure Functions uses when communicating to it’s associated storage account.  This is a great troubleshooting step if you get errors that the function is not accessible.


You can use Deployment Slots and direct a percentage of the production traffic to a particular slot.  If you want to test only that slot say with the custom Domain on the production slot and ensure you hit that slot, you need to add a Cookie called x-ms-routing-name and specify that slot I want to route to.  In this example I am going to route to the test slot:


If you need to move files from a container and you are not using WEBSITES_ENABLE_APP_SERVICE_STORAGE, you will notice you cannot see the files when you SSH into the Kudu container.  In order to get these files into Kudu to easily transfer them you can use the linux tool ‘ncftp’. 


When updating your Azure Function App storage account keys, if you specify the wrong key… You could get an error including the text:


There are lots of ways to do things in Azure.  I could not find a current end to end sample of setting up and getting an Access Token using SSH on a Linux box.  I chose the latest Ubuntu image up in Azure Virtual Machines for this overview.  This is loosely based on this older blog which had you create a PEM certificate (which is no longer necessary)

Steps


I ran into an interesting error that I had to debunk where a customer thought with HTTP/2 on Windows Server 2016 which has IIS 10 installed, that this caused the error above.  That was not true!


Kudu is the .SCM interface for Azure App Services.  If you are running more than one instance of Azure App Services (for instance you have scaled out to 4 instances) and you need to get to the Kudu console to do something like kill a process, profile an instance or get a dump of a particular instance… you can use this technique.  This technique does not rely on ARRAffinity being set for the Application because that setting does not affect the Kudu site. 


After publishing the web app to Azure Cloud Services from Visual Studio 2017, it would not run and returned a 500 error.  Turning off custom error messages I was getting this error: Could not find a part of the path ‘E:\sitesroot\0\bin\roslyn\csc.exe’. In your solution explorer for your project, right click on the ‘References’ section for your WebRole and select ‘Manage NuGet Packages…’ full stack:


PowerShell can and does use System.Net classes to communicate over the wire.  This example will cover capturing a System.Net trace of the Azure PowerShell Publish-AzureWebsiteProject command-let.