Skip to content

Commit 9cedeea

Browse files
author
naman-msft
committed
added new docs
1 parent 6613502 commit 9cedeea

File tree

7 files changed

+80
-1348
lines changed

7 files changed

+80
-1348
lines changed

tools/python-docs-hello-django renamed to scenarios/azure-docs/articles/app-service/python-docs-hello-django

File renamed without changes.

tools/python-docs-hello-world renamed to scenarios/azure-docs/articles/app-service/python-docs-hello-world

File renamed without changes.

tools/ghi.md renamed to scenarios/azure-docs/articles/app-service/quickstart-python-1-django.md

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,7 @@ Before deploying, declare environment variables for the deployment. A random suf
7676
```bash
7777
export RANDOM_SUFFIX=$(openssl rand -hex 3)
7878
export APP_NAME="mydjangoapp$RANDOM_SUFFIX"
79-
az webapp up --sku B1 --name $APP_NAME
80-
```
81-
82-
<!-- expected_similarity=0.3 -->
83-
```json
84-
{
85-
"defaultHostName": "mydjangoappxxx.azurewebsites.net",
86-
"location": "centralindia",
87-
"name": "mydjangoappxxx",
88-
"resourceGroup": "appsvc_rg_Linux_CentralUS",
89-
"state": "Running"
90-
}
79+
az webapp up --sku B1 --name $APP_NAME --runtime "PYTHON|3.10"
9180
```
9281

9382
- If the `az` command isn't recognized, be sure you have the Azure CLI installed as described in [Set up your initial environment](#set-up-your-initial-environment).
@@ -134,7 +123,7 @@ The Python sample code is running a Linux container in App Service using a built
134123
135124
# [Bash](#tab/bash)
136125
137-
```bash
126+
```text
138127
python3 manage.py runserver
139128
```
140129
@@ -167,6 +156,7 @@ In this section, you make a small code change and then redeploy the code to Azur
167156
Open *hello/views.py* in an editor and update the `hello` function to match the following code.
168157
169158
```bash
159+
cd python-docs-hello-django
170160
cat << 'EOF' > hello/views.py
171161
def hello(request):
172162
print("Handling request to home page.")
@@ -177,18 +167,7 @@ EOF
177167
Save your changes, then redeploy the app using the `az webapp up` command again:
178168
179169
```azurecli
180-
az webapp up
181-
```
182-
183-
<!-- expected_similarity=0.3 -->
184-
```json
185-
{
186-
"defaultHostName": "mydjangoappxxx.azurewebsites.net",
187-
"location": "centralindia",
188-
"name": "mydjangoappxxx",
189-
"resourceGroup": "appsvc_rg_Linux_CentralUS",
190-
"state": "Running"
191-
}
170+
az webapp up --runtime "PYTHON|3.10"
192171
```
193172
194173
Once deployment is complete, switch back to the browser window open to `http://<app-name>.azurewebsites.net`. Refresh the page, which should display the modified message:
@@ -207,7 +186,7 @@ You can access the console logs generated from inside the app and the container
207186
To stream logs, run the [az webapp log tail](/cli/azure/webapp/log#az-webapp-log-tail) command:
208187
209188
```azurecli
210-
az webapp log tail
189+
timeout 11 az webapp log tail
211190
```
212191
213192
You can also include the `--logs` parameter with the `az webapp up` command to automatically open the log stream on deployment.

tools/def.md renamed to scenarios/azure-docs/articles/app-service/quickstart-python-1-flask.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ In this section, you make a small code change and then redeploy the code to Azur
136136
Open *app.py* in an editor and update the `hello` function to match the following code.
137137

138138
```bash
139-
cd python-docs-hello-world
139+
cd python-docs-hello-world
140140
cat << 'EOF' > app.py
141141
from flask import Flask
142142
app = Flask(__name__)

scenarios/metadata.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,5 +1672,75 @@
16721672
"permissions": [],
16731673
"configurableParams": []
16741674
}
1675+
},
1676+
{
1677+
"status": "active",
1678+
"key": "azure-docs/articles/app-service/quickstart-python-1-flask.md",
1679+
"title": "Quickstart: Create a Python app on Linux using Flask",
1680+
"description": "Get started with Azure App Service by deploying a Python app to a Linux container in App Service using Flask.",
1681+
"stackDetails": "",
1682+
"sourceUrl": "https://raw.githubusercontent.com/MicrosoftDocs/executable-docs/main/scenarios/azure-docs/articles/app-service/quickstart-python-1-flask.md",
1683+
"documentationUrl": "https://learn.microsoft.com/en-us/azure/app-service/quickstart-python-1?tabs=bash&pivots=python-framework-flask",
1684+
"nextSteps": [
1685+
{
1686+
"title": "Tutorial: Python (Django) web app with PostgreSQL",
1687+
"url": "https://learn.microsoft.com/en-us/azure/app-service/tutorial-python-postgresql-app-django"
1688+
},
1689+
{
1690+
"title": "Configure Python app",
1691+
"url": "https://learn.microsoft.com/en-us/azure/app-service/configure-language-python"
1692+
},
1693+
{
1694+
"title": "Add user sign-in to a Python web app",
1695+
"url": "https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-python-webapp"
1696+
},
1697+
{
1698+
"title": "Tutorial: Run Python app in custom container",
1699+
"url": "https://learn.microsoft.com/en-us/azure/app-service/tutorial-custom-container"
1700+
},
1701+
{
1702+
"title": "Secure with custom domain and certificate",
1703+
"url": "https://learn.microsoft.com/en-us/azure/app-service/tutorial-secure-domain-certificate"
1704+
}
1705+
],
1706+
"configurations": {
1707+
"permissions": [],
1708+
"configurableParams": []
1709+
}
1710+
},
1711+
{
1712+
"status": "active",
1713+
"key": "azure-docs/articles/app-service/quickstart-python-1-django.md",
1714+
"title": "Quickstart: Create a Python app on Linux using Django",
1715+
"description": "Get started with Azure App Service by deploying a Python app to a Linux container in App Service using Django.",
1716+
"stackDetails": "",
1717+
"sourceUrl": "https://raw.githubusercontent.com/MicrosoftDocs/executable-docs/main/scenarios/azure-docs/articles/app-service/quickstart-python-1-django.md",
1718+
"documentationUrl": "https://learn.microsoft.com/en-us/azure/app-service/quickstart-python-1?tabs=bash&pivots=python-framework-django",
1719+
"nextSteps": [
1720+
{
1721+
"title": "Tutorial: Python (Django) web app with PostgreSQL",
1722+
"url": "https://learn.microsoft.com/en-us/azure/app-service/tutorial-python-postgresql-app-django"
1723+
},
1724+
{
1725+
"title": "Configure Python app",
1726+
"url": "https://learn.microsoft.com/en-us/azure/app-service/configure-language-python"
1727+
},
1728+
{
1729+
"title": "Add user sign-in to a Python web app",
1730+
"url": "https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-python-webapp"
1731+
},
1732+
{
1733+
"title": "Tutorial: Run Python app in custom container",
1734+
"url": "https://learn.microsoft.com/en-us/azure/app-service/tutorial-custom-container"
1735+
},
1736+
{
1737+
"title": "Secure with custom domain and certificate",
1738+
"url": "https://learn.microsoft.com/en-us/azure/app-service/tutorial-secure-domain-certificate"
1739+
}
1740+
],
1741+
"configurations": {
1742+
"permissions": [],
1743+
"configurableParams": []
1744+
}
16751745
}
16761746
]

tools/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
from flask import Flask
2+
app = Flask(__name__)
3+
4+
@app.route("/")
15
def hello():
26
print("Handling request to home page.")
37
return "Hello, Azure!"

0 commit comments

Comments
 (0)