Enterprise Framework

Software Solutions in the Enterprise

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

<rewrite> 

<rules> 

<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" /> 

</conditions> 

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

</rule> 

</rules> 

</rewrite>


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

https://docs.microsoft.com/en-us/azure/application-gateway/application-gateway-configure-redirect-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;

https://blogs.msdn.microsoft.com/appserviceteam/2017/02/24/creating-a-local-pfx-copy-of-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.


STEPS:

$ 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

ADD .bashrc CONTENTS
===============================
 
if [ -f ~/.git-completion.bash ]; then
    source ~/.git-completion.bash
fi
 


$ 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
fi
 
export PS1='\h:\u \W$(__git_ps1 "(%s)") $ '