Skip to content

Latest commit

 

History

History
243 lines (158 loc) · 11.4 KB

Azure_Hosting_Guidline.md

File metadata and controls

243 lines (158 loc) · 11.4 KB

image

Note:

There are 2 ways to host your website using Azure Static Web Apps Service.

Guidlines:

👉Technique # 1:

  • First, ensure that your repository has been created and that your code has been pushed to GitHub's Main branch.
  • As a second step, go to Azure.com
  • Sign In with your credentials
  • Select "Static Web Apps" icon

image

  • And select "+ Create" option.

image

  • Enter your Static Web App's Name:

image

  • Select your nearest Region from the drop down and authorize it with your Github Account.

image

  • Then enter your "GitHub Username" to the "Organization"
  • Choose your "Repository name" from the drop down menu.
  • Select your "branch".
  • And nput your Build Details by selecting Build Presets from the dropdown menu.

image

  • Finally, hit "Review & Create" button to start deployment.✨




👉Technique # 2:

  • First, ensure that your repository has been created and that your code has been pushed to GitHub's Master branch.
  • As a second step, go to Azure.com
  • Sign In with your credentials
  • Select "Create a Resource"

image

  • Search "Web App" in the Search bar
    image

image

  • You will find the "Web App" like this:
    image

  • Select "Create" option.

  • And you will be redirected to a page like this: image

  • Select your preferable Subscription from the drop down menu: image

  • Give a new name to your Resource Group according to your project/website: image

  • Add a name here, according to your project: image

Like this:

image

  • Then select Node 16 LTS for the Runtime Stack
  • Choose Windows for Operating System, if you are a Windows user.
  • And choose the nearest Region around you from the drop down menu. image
- Now, you can give any name to your Plan. But, make sure that it is "Free F1". Here, I'm using te default one!

image

  • Go to the "Deployment" tab and Enable the options:

image

  • Ten "Sign In with and Authorize" with your Github Account. Like this:

image

  • Then enter your "GitHub Username" to the "Organization"
  • Choose your "Repository name" from the drop down menu.
  • Select your "branch".

image

  • Now, go to the "Tag" tab and enter a "Value name" according to your Project. Like this:

image

  • Then Hit "Review + Create" from the bottom:

image

  • Recheck the Details and hit "Create":

    image

  • Then it will take some time and start Deployment image

-Once Deployment is completed...

  • Select Go to Resources button... image
  • You will be redirect to a page like this:

    image

  • Then check your "GitHub Repository", you will find one action In Progress image

image

  • Then go to the Actions tab and select the running Workflow.

    image

  • This workflow process will consume enormous amount of time! To reduce the time consumption, we need to modify the workflow file. For that, we will cancel the current Workflow :

    image

  • After cancelling the workflow, select "View workflow file" option from the top right corner:

    image

  • Then start editing the file using Pen icon:

    image

  • Scroll down to this section of your code and add a comment : "Zip the build directory" image

image

  • Then search "zip" in the side search bar and select "Zip Release".

    image

  • Copy the code like this and paste it below your comment. image

image

  • Then remove the select unnecessary code, like this:

image

  • Then select and modify the path, like this:
Original Modified
image image
  • Then select and modify the filename, like this:
Original Modified
image image
  • It will finally look like this:

    image

  • Scroll down your code a bit, modify the path and write release.zip, like this:
Original Modified
image image
  • Scroll down a bit more, modify the package and write release.zip, like this:
Original Modified
image image
  • Then, hit "Start Commit" button and Commit Changes.

    image

  • Now, go to the "Actions" tab and check.
  • It will take few minutes to complete the deployment.

image

image

  • Onece the deployment is completed, Go back to your Azure account, and copy/open your URL to the new tab

image

  • Finally, your website is Hosted! Congratulation!!!🎉

image