This is my first project in my attempt to learn cloud skills.
This is a super simple webpage that I pushed up to Azure App Services. I focused more on getting something up and working than focusing on languages or fancy frameworks or whatever. The sample project just had a "hello world" and I made it a little more fancy. (Only a little...)
- Get the repo:
git clone https://github.com/geekygirlsarah/azure-php-helloworld.git
- Change into that directory:
cd azure-php-helloworld
- Test it locally:
php -S localhost:8080
- Log in to Azure:
az login
- Create a new git deployment user:
az webapp deployment user set --user-name <username> --password <password>
- Create a resource group:
az group create --name <resourceGroup> --location <location>
- name the Resource Group whatever you like, but remember that name as you'll use it a lot
- use
az appservice list-locations
to get a list of possible locations you can use
- Create a new App Service plan attached to that Resource Group: `az appservice plan create --name
- Name the Service Plan whatever you like, just remember the name of it
- Create a web app on that Service Plan:
az webapp create --name <appName> --resource-group <resourceGroup> --plan <servicePlanName>
- Whatever you name the web app will be the name of your website. So
myHelloWorldApp
will go tohttp://myHelloWorldApp.azurewebsites.net
.
- Whatever you name the web app will be the name of your website. So
- Test the site out by to that link. You should get a default Azure page.
- Get the App Service git push URL:
az webapp deployment source config-local-git --name <appName> --resource-group <resourceGroupName> --query url --output tsv
- Copy that URL. You'll need it in the next step.
- The username is between the
https://
and@appname.scm
- Add Azure as a git remote: `git remote add azure
- Push your repo to Azure's master branch:
git push azure master
- Go to the same URL for your web app (created in step 8) and test to see if it works. You should see some text, a text box, and a submit button.
- Make your own changes and try it out!
http://geekygirlsarah-helloworld.azurewebsites.net/
Directions: https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-get-started-php Repo: https://github.com/Azure-Samples/php-docs-hello-world
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Find me on Twitter at @geekygirlsarah. Please feel free to reach out!