Hi,
Is it possible to run grafana in azure webapp ?
I’m not sure. Have you tried?
Looks like Azure Web Apps support Go so Grafana might work:
EDIT: SEE MY LATER POST WITH THE COMPLETE PROCEDURE
I am new to Grafana but also would like to install as a web app. I have done the steps below which seems to work reasonably well but I am unable to get sqlite3 to compile i.e:
github.com/grafana/grafana/vendor/github.com/mattn/go-sqlite3
In file included from ./sqlite3-binding.h:35:0,
from vendor\github.com\mattn\go-sqlite3\backup.go:10:
D:/home/site/mingw64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/stdarg.h:1:25: fatal error: stdarg.h: No such file or directory
compilation terminated.
STEPS:
In Azure, create a new “Node JS Empty Web App”.
To set environment variables, using Debug Console (e.g. https://yoursite.scm.azurewebsites.net/DebugConsole), create a file in Azure Web App called applicationHost.xdt in D:\home\site with the following contents:
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <system.webServer> <runtime xdt:Transform="InsertIfMissing"> <environmentVariables xdt:Transform="InsertIfMissing"> <add name="GOPATH" value="D:\home\site\wwwroot" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" /> <add name="GOROOT" value="D:\home\site\go" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" /> <add name="PATH" value="%PATH%;D:\home\site\go\bin;D:\home\site\mingw64\bin" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" /> </environmentVariables> </runtime> </system.webServer> </configuration>
https://storage.googleapis.com/golang/go1.8.3.windows-amd64.zip
Restart web app.
Go to D:\home\site\wwwroot and run: go get GitHub - grafana/grafana: The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
Go to D:\home\site\wwwroot\src\github.com\grafana\grafana and run: go run build.go setup
In the docs for building from source, it mentions that you will need GCC (TDM-GCC) to build sqlite on Windows.
Alright. Let me try and update you the status. Thank you.
In Azure, create a new “Web App”.
To set environment variables create a new file D:\home\site\applicationHost.xdt in Azure Web App with the following contents (e.g. by using Debug Console https://yoursite.scm.azurewebsites.net/DebugConsole):
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <system.webServer> <runtime xdt:Transform="InsertIfMissing"> <environmentVariables xdt:Transform="InsertIfMissing"> <add name="GOPATH" value="D:\home\site\wwwroot" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" /> <add name="GOROOT" value="D:\home\site\go" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" /> <add name="PATH" value="D:\home\site\tdmgcc\bin;D:\home\site\go\bin;%PATH%" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" /> </environmentVariables> </runtime> </system.webServer> </configuration>
https://storage.googleapis.com/golang/go1.8.3.windows-amd64.zip
https://sourceforge.net/projects/tdm-gcc/files/GNU%20binutils/binutils-2.25-tdm64-1.zip/download
Restart web app.
Go to D:\home\site\wwwroot and run: go get GitHub - grafana/grafana: The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
Update the grunt dependency by editing D:\home\site\wwwroot\src\github.com\grafana\grafana\package.json as follows:
“grunt”: “**>=**0.4.5”,
The above step is required to prevent grunt from failing due to bug that manifests itself in Azure environment, fixed in grunt v1.0.
go run build.go setup
go run build.go build
npm install -g yarn
npm install node-sass
yarn install --pure-lockfile
The above step is required to prevent grunt failing due to lack of location.js file.
npm install -g grunt-cli
npm update grunt
grunt
set GF_SERVER_HTTP_ADDR=127.0.0.1
set GF_SERVER_HTTP_PORT=%1
.\src\github.com\grafana\grafana\bin\grafana-server.exe -homepath=.\src\github.com\grafana\grafana
<?xml version="1.0" encoding="UTF-8"?><configuration >
<system.webServer>
<handlers>
<remove name=“httpplatformhandler” />
<add name=“httpplatformhandler” path="" verb="" modules=“httpPlatformHandler” resourceType=“Unspecified”/>
</handlers>
<environmentVariables>
</environmentVariables>
</httpPlatform>
</system.webServer>
<*/configuration>
Thanks for the great step by step doku.
But I have no success to bring it on the street.
I run into an server 500 error.
I have some questions.
Do you create a WebApp or a Node JS Empty Web App?
in the web.config are you sure that the path is “” without * ?
I do also a restart from webapp, try to run the grafana.bat via cloudshell and so
is it possible that you have a double check on the doku
Thank you
You will be able to run grafana as azure web app using linux app service plan and container.
Below is my reference implementation of the same. You can customize the ARM template accoring to your need.