A collection of 10 posts

Modifying host headers with Azure websites when using it behind an Application Gateway or reverse proxy via URL Rewrite Module

I'm currently using Azure's Application Gateway with a backend pool utilising Azure's App Service. When the application gateway forwards your request to the backpool, it also forwards X-Original-Host HTTP Header together with it to help you identity which listener the gateway originally acted upon but what if you wanted it to match the HOST header at the web server (app service)? This might be useful for cases where you need to generate absolute URLs in your web app for whatever ...

Diagnosing 500 Internal Server Errors from IIS

Windows 10 Setup In short, setup failed request tracing feature on IIS On Windows 10, let's first enable it netmgr > server > website > failed request tracing rules > edit site tracing > enable add > all content > status codes > 500 Then to view the logs inetmgr > server > website > failed request tracing rules > view trace logs then find the fr*.xml related files, right click and open with IE Internet Explorer. Not sure ...

Finding the WEBSITE_LOCALCACHE_READY environment variable for Azure Web Apps Local Cache feature?

Recently attempted to implement Azure's Local Cache feature for App Service and so after updating App Settings "WEBSITE_LOCAL_CACHE_OPTION": "Always", "WEBSITE_LOCAL_CACHE_SIZEINMB": "1800", And restarting my app, how do I verify that the web app's local cache instance is serving up the content and not from a shared network location? You will need to navigate to https://yourwebsitename.scm.azurewebsites.net/ProcessExplorer and find the properties column for ...

Connecting to a remote (Azure) Redis Console on Windows via Redis CLI

Installing the Redis CLI You'll need the Chocolatey package manager if you have not yet installed this. choco install redis-64 Connecting to the remote instance Find the password/access key on Azure > Home > Redis Caches > my-redis-db > Access keys> Then whip out our favourite shell redis-cli -h my-redis-db.redis.cache.windows.net -p 6379 -a <access key on Azure> Useful commands # Show all keys keys * # Remove all keys flushall # Monitor gets and sets monitor ...

View history of start and end execution times in Powershell

Recently I've been trying to scale my Azure SQL database up from a low pricing tier to a higher pricing tier. It seems like the process can take between minutes to hours. I wanted a way of measure how long this would take and while using the Measure-Command commandlet was useful in showing the duration, it didn't show the time it was executed from start to finish. While the duration was helpful, it didn't really reflect the true amount of ...

Copying firewall rules between two Azure SQL servers

Recently I've setup active geo-replication for my database hosted on Azure which basically allows you to asynchronously replicate transactions held on a primary database to a secondary database (usually located in a different geographical region) which is set to read only. The problem was, in a failover/disaster recovery situation, for the secondary to be usable, I would have to manually add all the existing firewall rules on the primary to the secondary which may be updated from time to ...

Comparing Azure Automation with Azure Functions

Two ways to run Powershell Scripts on Azure are on the Azure Automation and Azure Functions platforms. While Microsoft has provided a nice article about the comparisons between Azure Flow, Logic Apps, Functions, and WebJobs, there hasn't been a comparison between Azure Automation and Azure Functions. @johnliu took some notes at MSAUIgnite and posted it on Github which I thought I would share here as well. ...

Exporting all Azure Web App settings for every app on every resource group for both production and staging slots to CSV

I've currently got about 40-50 apps running on Azure's App service offering being deploying using Azure ARM deployment templates. Each app contains AppSettings. There were times when I've noticed that some apps don't get all the AppSettings defined in the ARM template so I wrote a script to print and export the list of appsettings for each of my 40-50 apps for sanity checking. $allWebApps = Get-AzureRmWebApp #$allWebApps = $allWebApps | Where-Object {$_.ResourceGroup -eq 'nameOfresourceGroup'} $resourceGroups = $allWebApps | Select-Object 'ResourceGroup' -Unique $outItems = New-Object System. ...

VSTS - Visual Studio Team Services

Setting up a new instance of VSTS Account level settings Region - Australia East Timezone - GMT+10 Users (adding Frank) Agent pools (adding 3 hosted VSTS agents) Security (adding to Frank to Project Collection Administrators) Billing (for adding VSTS agents which does the actual work) Active Directory (created automatically) Project level settings Adding a Azure ARM service endpoint (for Azure relation interactions) Adding a source code repository service endpoint (for Bitbucket) Add a depth of 3 for faster checkout ...

Replacing New Relic's .NET agent from running on Azure App Services

To have New Relic working for a .NET app hosted on Azure's App Services, I needed New Relic's .NET agent installed in 1 of 3 ways. Manual installation via NuGet Extension installation via the SCM website Extension installation via the Azure Portal Initially I had it installed via the Azure Portal (method 3), which seemed fine but to give us better flexibility in having a "clean" deployment by setting the <SkipExtraFilesOnServer>True</SkipExtraFilesOnServer> flag ...