Skip to content

Commit 0ea3cca

Browse files
authored
Update docs with web app example (#101)
1 parent 62868ea commit 0ea3cca

4 files changed

Lines changed: 46 additions & 61 deletions

File tree

docs/creating-your-pipeline.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ Within the root directory of your Infrastructure as Code (IaC) repository:
3030
- uses: actions/checkout@v2
3131

3232
# Generate markdown files using PSDocs
33-
# Scan for Azure template file recursively in the templates/ directory
33+
# Scan for Azure template file recursively in sub-directories
3434
# Then generate a docs using a standard naming convention. i.e. <name>_<version>.md
3535
- name: Generate docs
36-
run: |
37-
Install-Module -Name 'PSDocs.Azure' -Repository PSGallery -Force;
38-
Get-AzDocTemplateFile -Path templates/ | ForEach-Object {
39-
Invoke-PSDocument -Module PSDocs.Azure -OutputPath out/docs/ -InputObject $_.TemplateFile -Convention 'Azure.NameByParentPath';
40-
}
41-
shell: pwsh
36+
uses: microsoft/ps-docs@main
37+
with:
38+
conventions: Azure.NameByParentPath
39+
modules: PSDocs,PSDocs.Azure
40+
inputPath: templates/
41+
outputPath: out/docs/
42+
prerelease: true
4243
```
4344

4445
This will automatically install compatible versions of all dependencies.

docs/publish/azure-webapp.md

Lines changed: 35 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ Two open source examples are:
1616
MkDocs is fast and can be customized with corporate branding fairly easily.
1717
A wide-range of themes are also available.
1818
- **DocFX** &mdash; A .NET-based static site generator.
19-
DocFX is slightly easier to get up and running.
19+
DocFX is slightly easier to get up and running but require more work to customize and brand.
2020

2121
### With MkDocs
2222

2323
Markdown content generated with PSDocs for Azure can be published as HTML with [MkDocs][1].
2424
MkDocs is a command-line tool that converts markdown into HTML.
2525

26+
!!! Tip
27+
We recommend you start from our [Quick Start template][2].
28+
2629
[1]: https://www.mkdocs.org/
30+
[2]: https://aka.ms/ps-docs-azure-quickstart
2731

2832
=== "GitHub Actions"
2933

@@ -48,56 +52,34 @@ MkDocs is a command-line tool that converts markdown into HTML.
4852
run: mkdocs build
4953
```
5054

51-
- Create a `requirements-docs.txt` file in the root of the repository.
52-
This file is used by Python to install the required package dependencies.
55+
- [Create a convention][3] to name and add metadata to output markdown files.
56+
A conventions allows generated markdown to be modified before it is written.
57+
We use one with MkDocs to add front matter to markdown files and organize them.
5358

54-
```text
55-
mkdocs==1.2.1
56-
mkdocs-material==7.1.8
57-
pymdown-extensions==8.2
58-
mkdocs-git-revision-date-plugin==0.3.1
59-
mdx-truly-sane-lists==1.2
60-
mkdocs-awesome-pages-plugin==2.5.0
59+
- Update action parameters to set output path and reference convention.
60+
61+
```yaml
62+
# Generate markdown files using PSDocs
63+
# Scan for Azure template file recursively in sub-directories
64+
- name: Generate docs
65+
uses: microsoft/ps-docs@main
66+
with:
67+
conventions: AddMkDocsMeta
68+
modules: PSDocs,PSDocs.Azure
69+
outputPath: docs/azure/templates/
70+
prerelease: true
6171
```
6272
63-
- Create a `mkdocs.yaml` file in the root of the repository.
73+
- Create a [mkdocs.yaml][4] file in the root of the repository.
6474
This file configures MkDocs.
6575
By configuring this file you can change common settings such as theme and layout.
6676
67-
```yaml
68-
site_name: Contoso Docs for Azure
69-
site_url: https://docs.contoso.com/
70-
site_description: Azure documentation for Contoso's modern cloud environment.
71-
72-
repo_url: https://github.com/Azure/PSDocs.Azure/
73-
edit_uri: ''
74-
75-
theme:
76-
name: material
77-
font:
78-
text: Roboto
79-
palette:
80-
primary: blue
81-
icon:
82-
repo: fontawesome/brands/github
83-
logo: material/microsoft-azure
84-
features:
85-
- navigation.instant
86-
- navigation.indexes
87-
- navigation.sections:
88-
level: 1
89-
- navigation.tabs
90-
91-
markdown_extensions:
92-
- toc:
93-
permalink: '#'
94-
separator: '-'
95-
96-
plugins:
97-
- search
98-
- git-revision-date
99-
- awesome-pages
100-
```
77+
- Create a [requirements-docs.txt][5] file in the root of the repository.
78+
This file is used by Python to install the required package dependencies.
79+
80+
[3]: https://github.com/Azure/PSDocs.Azure-quickstart/blob/main/.ps-docs/MkDocs.Doc.ps1
81+
[4]: https://github.com/Azure/PSDocs.Azure-quickstart/blob/main/mkdocs.yml
82+
[5]: https://github.com/Azure/PSDocs.Azure-quickstart/blob/main/requirements-docs.txt
10183
10284
<!--
10385
@@ -230,28 +212,30 @@ With documentation generated as HTML the content can be published to an Azure we
230212

231213
```yaml
232214
- name: Azure Login
233-
uses: azure/login@v1.1
215+
uses: azure/login@v1.3.0
234216
with:
235217
creds: ${{ secrets.AZURE_CREDENTIALS }}
236218
237219
- name: Publish to Azure
238220
run: |
239221
cd ./site
240-
az webapp up -l eastus -n '<enter>' -g '<enter>' --subscription '<enter>' --html
222+
az webapp up -l '<enter>' -n '<enter>' -g '<enter>' --subscription '<enter>' --html
241223
```
242224

243-
- Create an [deployment credentials][4] `AZURE_CREDENTIALS` for the workflow to use to authenticate to Azure.
225+
- Create an [deployment credentials][6] `AZURE_CREDENTIALS` for the workflow to use to authenticate to Azure.
226+
- Set `-l` with the location of the Web App.
227+
e.g. `eastus`.
244228
- Set `-n` with the name of the Web App.
245229
- Set `-g` with the name of the Resource Group containing the Web App.
246230
- Set `--subscription` with the name or GUID of the subscription to deploy to.
247231

248-
[4]: https://github.com/azure/login#configure-deployment-credentials
232+
[6]: https://github.com/azure/login#configure-deployment-credentials
249233

250234
## Configuring authorization
251235

252236
Azure Web Apps have built-in support for integrated with Azure AD.
253237
By using this feature Azure AD takes care of all the heavy lifting in regards to auth.
254238

255-
Read [Configure your App Service or Azure Functions app to use Azure AD login][5] to find out how to configure it.
239+
Read [Configure your App Service or Azure Functions app to use Azure AD login][7] to find out how to configure it.
256240

257-
[5]: https://docs.microsoft.com/azure/app-service/configure-authentication-provider-aad
241+
[7]: https://docs.microsoft.com/azure/app-service/configure-authentication-provider-aad

docs/using-metadata.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ Field | Scope | Type | Description
8787
`ignore` | Parameter | `boolean` | When `true` the parameter is not included in the JSON snippet.
8888
`description` | Output | `string` | Used as the description for the output.
8989

90-
An example of an Azure Storage Account template with metadata included is available [here][source-template].
90+
<!-- An example of an Azure Storage Account template with metadata included is available [here][source-template].
9191
9292
### Template metadata
9393
9494
### Parameter metadata
9595
96-
### Output metadata
96+
### Output metadata -->

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ nav:
4141
- Publishing:
4242
- Publish to Azure Storage: publish/blob-storage.md
4343
# - Publish to Azure DevOps Wiki: publish/devops-wiki.md
44-
# - Publish to Azure Web App: publish/azure-webapp.md
44+
- Publish to Azure Web App: publish/azure-webapp.md
4545
- Using metadata: using-metadata.md
4646
- Troubleshooting: troubleshooting.md
4747
- License and contributing: license-contributing.md

0 commit comments

Comments
 (0)