Enterprise Framework

Software Solutions in the Enterprise

Azure Application Gateway with SSL Offloading - IIS Url Rewrite from HTTP to HTTPS Redirect



<rule name="HTTP To HTTPS Redirect Behind App Gtwy" stopProcessing="true"> 

<match url="^(.*)$" ignoreCase="false" /> 

<conditions logicalGrouping="MatchAny"> 

<add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" ignoreCase="false" /> 


<action type="Redirect" url="https://{SERVER_NAME}{URL}" redirectType="Found" /> 




You can also do this HTTP to HTTPS redirect through the Application Gateway using PowerShell.


Create PFX from Azure App Service Certificate Service

I recently created a Azure App Service Certificate that I wanted to use with Azure Application Gateway.  However, this requires you to upload an PFX file and there isn't an option to generate one from Azure App Service Certificate.  However, I found an article that can generate the PFX for you from the App Service Certificate;


Mac Sierra : Git Completion and Bash Prompt With Branch Update

The following will help get GIT completion setup locally on Mac Sierra.  Not correctly loading the git-completion.bash or git-prompt.sh can result in getting the following error: 

ERROR:   __git_ps1: command not found

Check that you did not mistype the file name as that could result in the script not being found and ran.


$ cd ~/Downloads       

$ curl -OL https://github.com/git/git/raw/master/contrib/completion/git-completion.bash

$ mv git-completion.bash ~/.git-completion.bash

$ sudo nano ~/.bashrc

if [ -f ~/.git-completion.bash ]; then
    source ~/.git-completion.bash

$ cd ~/Downloads/

$ curl -OL https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
$ mv ~/Downloads/git-prompt.sh ~/.git-prompt.sh

UPDATE .bash_profile CONTENTS
if [ -f ~/.git-prompt.sh ]; then
    source ~/.git-prompt.sh
export PS1='\h:\u \W$(__git_ps1 "(%s)") $ '