Yes, Azure Websites can run Go! Check out this post to understand the basics of running Go in Azure Websites. You can simplify by using a site extension with resource manager to get the Go binaries on the machine.
In this repository you'll find the tools you need to configure Azure Websites to automatically compile and host your Go website when you commit using Git. Simply follow the steps in this tutorial to get everything setup and configured.
Note: you'll only have to run through this tutorial once. Once configured, all you need to do is commit your Go code and the app is automatically compiled and configured.
Setup Steps
-
Clone this repository.
git clone https://github.com/wadewegner/azure-website-go-builder
-
Either use PowerShell or the Azure Portal to deploy your website along with the Go Lang Site Extension.
PowerShell Steps
-
Install and configure Azure PowerShell (if you don't already have it).
-
Edit the
deploy_site_extension.ps1
file to include your credentials. You can also change names and locations. You can change other settings in thesite_extension_template.json
file if you desire but it's not absolutely necessary. -
Run the
deploy_site_extension.ps1
PowerShell script.
Azure Portal Steps
-
Log into the Azure Portal.
-
Create a new Azure Website. Feel free to use the free tier if you're testing.
-
Once your website is provisioned the website blade will open. Select
Configuration
andExtensions
then click theAdd
button. -
Select the
Go Lang for Azure Websites
site extension, accept the legal terms, and clickOK
.
Give it a moment to install into site extension. You can see progress on the
Notifications
blade. -
-
Log into the Azure Portal (if you're not already there) and open your website blade.
-
Select the
Deployment
tile to configure continuous deployment. Choose theLocal Git Repository
source and clickOK
. -
Select the
Set deployment credentials
tile and set your password. Don't forget to clickSave
. -
Select the
Deployment
tile again (it should sawNo deployments found
) and copy yourGIT URL
. -
Return to your console and add a git remote to your Azure Website.
git remote add azure https://wadewegner@golangtestportalsite.scm.azurewebsites.net:443/GoLangTestPortalSite.git
-
Add your changes, commit, and push to Azure. Enter your password when prompted.
git add -A git commit -m "Initial setup" git push azure master
-
Browse to your website. You should see the following:
That's it! As part of the commit process, Azure Websites runs the deploy.cmd
file to compile and deploy your application. If you change your app.go
and push your changes you'll see the updates after the deploy script finishes.
If you have any questions or issues please submit an issue.