Skip to content

Commit d8e1c38

Browse files
authored
Merge pull request #100612 from ggailey777/cleanup
Implement tabs in DevOps article
2 parents 2b0d8b0 + c4259d9 commit d8e1c38

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

articles/azure-functions/functions-how-to-azure-devops.md

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To create a YAML-based pipeline, first build your app, and then deploy the app.
2525

2626
How you build your app in Azure Pipelines depends on your app's programming language. Each language has specific build steps that create a deployment artifact. A deployment artifact is used to deploy your function app in Azure.
2727

28-
#### .NET
28+
# [C\#](#tab/csharp)
2929

3030
You can use the following sample to create a YAML file to build a .NET app:
3131

@@ -56,7 +56,7 @@ steps:
5656
artifactName: 'drop'
5757
```
5858
59-
#### JavaScript
59+
# [JavaScript](#tab/javascript)
6060
6161
You can use the following sample to create a YAML file to build a JavaScript app:
6262
@@ -84,13 +84,44 @@ steps:
8484
artifactName: 'drop'
8585
```
8686
87-
#### Python
87+
# [Python](#tab/python)
8888
89-
You can use the following sample to create a YAML file to build a Python app. Python is supported only for Linux Azure Functions. The YAML for Python 3.7 can be built by replacing all the instances of 3.6 with 3.7 in this YAML.
89+
You can use one of the following samples to create a YAML file to build an app for a specific Python version. Python is supported only for function apps running on Linux.
90+
91+
**Version 3.7**
92+
93+
```yaml
94+
pool:
95+
vmImage: ubuntu-16.04
96+
steps:
97+
- task: UsePythonVersion@0
98+
displayName: "Setting python version to 3.7 as required by functions"
99+
inputs:
100+
versionSpec: '3.7'
101+
architecture: 'x64'
102+
- bash: |
103+
if [ -f extensions.csproj ]
104+
then
105+
dotnet build extensions.csproj --output ./bin
106+
fi
107+
pip install --target="./.python_packages/lib/site-packages" -r ./requirements.txt
108+
- task: ArchiveFiles@2
109+
displayName: "Archive files"
110+
inputs:
111+
rootFolderOrFile: "$(System.DefaultWorkingDirectory)"
112+
includeRootFolder: false
113+
archiveFile: "$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip"
114+
- task: PublishBuildArtifacts@1
115+
inputs:
116+
PathtoPublish: '$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip'
117+
artifactName: 'drop'
118+
```
119+
120+
**Version 3.6**
90121
91122
```yaml
92123
pool:
93-
vmImage: ubuntu-16.04
124+
vmImage: ubuntu-16.04
94125
steps:
95126
- task: UsePythonVersion@0
96127
displayName: "Setting python version to 3.6 as required by functions"
@@ -102,10 +133,7 @@ steps:
102133
then
103134
dotnet build extensions.csproj --output ./bin
104135
fi
105-
python3.6 -m venv worker_venv
106-
source worker_venv/bin/activate
107-
pip3.6 install setuptools
108-
pip3.6 install -r requirements.txt
136+
pip install --target="./.python_packages/lib/python3.6/site-packages" -r ./requirements.txt
109137
- task: ArchiveFiles@2
110138
displayName: "Archive files"
111139
inputs:
@@ -117,7 +145,8 @@ steps:
117145
PathtoPublish: '$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip'
118146
artifactName: 'drop'
119147
```
120-
#### PowerShell
148+
149+
# [PowerShell](#tab/powershell)
121150
122151
You can use the following sample to create a YAML file to package a PowerShell app. PowerShell is supported only for Windows Azure Functions.
123152
@@ -137,6 +166,8 @@ steps:
137166
artifactName: 'drop'
138167
```
139168
169+
---
170+
140171
### Deploy your app
141172
142173
You must include one of the following YAML samples in your YAML file, depending on the hosting OS.

0 commit comments

Comments
 (0)