Sunday, January 10, 2021

Copying content from GitHub to Azure Storage

I was going to figure out how to get our code from GitHub to our Azure Storage Account and write it up, but while I was using Bing to lookup how I ran across Set up a GitHub Actions workflow to deploy your static website in Azure Storage which covers everything.  The sample does use the Azure Cloud Shell and doesn't do as much showing as telling.  

The first thing that you need to do is open up an Azure Cloud Shell.  Click the ellipsis in the top right corner and then <cloud shell> 

That is a command shell that has the Azure Cloud Shell extension in place and you already authorized using your current credentials.  They come in two flavors, bash and PowerShell.  Bash in the default shell in Linux and PowerShell is a command shell in Microsoft Windows.  Once the bottom half of your screen loads, you will be given a choice.  We are going to use PowerShell so click <powershell>

Command shells require you to have a home directory and they need a place to store environment variables and other important information.  In the Azure, you need to allocate a Storage Account if you want to store things so that is what we are prompted to do next.  Leave the default subscription and click on <create storage>
Once it finishes allocating your storage account, you will get a prompt at the bottom of the screen

We are going to enter the command from the article with our own parts and pieces filled in.  The original was:

az ad sp create-for-rbac --name {myStaticSite} --role contributor --scopes /subscriptions/{subscription-id}/resourceGroups/{resource-group} --sdk-auth

I am going to edit this tomorrow and update it with some good pics.