Wednesday, January 6, 2021

Our first resource, or building a website on the cheap

 The first thing we are going to do tonight is create a new Storage Account so that we can get a web page up.  First we log into the Azure Portal and then click <create a resource>

Next type in Storage Account in the search box and hit enter:

Now click on the Storage Account tile and click <create> or click on the <create/storage account> button
Now, we are forced to create a resource group.  It isn't hard, and it is just what it sounds like: a group that you can put resources in.  Click on the <create new> and type in a name and click <ok>
We now just need to add our name and click <review + create> and then <create>.  It will then create our storage account.  Note: the name you choose will become part of the URL or Uniform Resource Locator of your storage account.   


When it finishes click <goto resource>
On the left hand side, under the Settings header click <static website>
Click <enable> and enter index.html in the top box and error.html in the second box and click <save>
Now, what we just did was tell Azure to set up a section of our Blob Storage to use as a static website.  We then told it that people just visiting should be served the content of the file index.html and that it should show the content of error.html if there is a problem.  Now we just need to create those two files and upload them.  Use notepad and create a text file named index.html that contains:
<html><body><h1>index</h1></body></html> 

 and a second text file named error.html that contains

<html><body><h1>error</h1></body></html> 

 Now, back in the Azure Portal on the left hand side click <storage explorer (preview)> and click on the BLOB CONTAINERS and $web and then click <upload>  


On the new part of the window that pops up, click on the little blue file folder and find and select your two files.  Then click on <upload>

Now, on the left hand menu click back on <static website> and you can find your site URL

Type your URL in a browser and give it a try!