How to Create and Launch a Tic Tac Toe Game on Azure Web App

Deploy on Azure Web App

Step 1. Initialize the Project and Push to GitHub (Code attached in the Zip File).

Once your code is ready, initialize a Git repository and push the code to GitHub.

# Initialize Git
git init

# Add your files
git add .

# Commit the changes
git commit -m "Initial Tic Tac Toe commit"

# Push to GitHub (replace <your-repo-url> with your GitHub repo URL)
git remote add origin <your-repo-url>
git push -u origin master

Step 2. Log in to Azure.

Log in to Azure from your terminal using the Azure CLI.

az login

Step 3. Create a Resource Group

Create a resource group for your project.

az group create \
    --name TicTacToeGroup \
    --location "East US"

Step 4. Create an App Service Plan.

This defines the region, instance size, and scaling options for your app.

az appservice plan create \
    --name TicTacToePlan \
    --resource-group TicTacToeGroup \
    --sku FREE

Step 5. Create the Web App.

Create the Azure Web App for hosting your Tic Tac Toe game.

az webapp create \
    --resource-group TicTacToeGroup \
    --plan TicTacToePlan \
    --name TicTacToeGameApp \
    --runtime "node|16-lts"

Step 6. Configure GitHub Deployment.

Configure the Web App to deploy directly from your GitHub repository.

az webapp deployment source config \
    --name TicTacToeGameApp \
    --resource-group TicTacToeGroup \
    --repo-url <your-github-repo-url> \
    --branch master \
    --manual-integration

Step 7. Access Your Game.

Restart game

Once deployed, you can access your game at https://<your-app-name>.azurewebsites.net.

That's it! You've successfully created and launched a Tic Tac Toe game on an Azure Web App.

Up Next
    Ebook Download
    View all
    Learn
    View all