I'm using the v2 python programming model and trying to launch a dash app similar to the example of a Flask app here
my function_app.py is as follows:
import dash
from dash import dcc
from dash import html
import azure.functions as func
dashapp = dash.Dash()
colors = {
'background': '#111111',
'text': '#7FDBFF'
}
dashapp.layout = html.Div(
style={'backgroundColor': colors['background']},
children=[
html.H1(
children='Hello Dash',
style={
'textAlign': 'center',
'color': colors['text']
}
),
html.Div(children='Dash: A web application framework for Python.', style={
'textAlign': 'center',
'color': colors['text']
}),
dcc.Graph(
id='Graph1',
figure={
'data': [
{'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'},
{'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': u'Montréal'},
],
'layout': {
'plot_bgcolor': colors['background'],
'paper_bgcolor': colors['background'],
'font': {
'color': colors['text']
}
}
}
)
]
)
app = func.WsgiFunctionApp(app=dashapp.server.wsgi_app,
http_auth_level=func.AuthLevel.ANONYMOUS)
My host.json is:
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.15.0, 4.0.0)"
},
"functionTimeout": "00:10:00",
"extensions":
{
"http":
{
"routePrefix": ""
}
}
}
When I run locally it works as expected with my app at http://localhost:7072/
but when I deploy to Azure functions and go to myapp.azurewebsites.net
then I just get the your app is up and running page. My guess is that Azure is serving that at the root address regardless of my app but the local deployment doesn't but I don't know how to verify that or, more importantly, change that behavior.