Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions examples/bicep/storage/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Parameter name | Required | Description
-------------- | -------- | -----------
name | Yes | The name of the storage account.
location | No | The location of the storage account.
tags | No | Tags for the storage account.

### name

Expand All @@ -31,6 +32,12 @@ The location of the storage account.
[resourceGroup().location]
```

### tags

![Parameter Setting](https://img.shields.io/badge/parameter-optional-green?style=flat-square)

Tags for the storage account.

## Snippets

### Parameter file
Expand All @@ -45,6 +52,9 @@ The location of the storage account.
"parameters": {
"name": {
"value": ""
},
"tags": {
"value": {}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions examples/bicep/storage/v1/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ param name string
@sys.description('The location of the storage account.')
param location string = resourceGroup().location

@sys.description('Tags for the storage account.')
param tags object?

resource storage 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: name
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
tags: tags
}
10 changes: 9 additions & 1 deletion examples/bicep/storage/v1/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
"metadata": {
"description": "The location of the storage account."
}
},
"tags": {
"type": "object",
"nullable": true,
"metadata": {
"description": "Tags for the storage account."
}
}
},
"resources": [
Expand All @@ -35,7 +42,8 @@
"sku": {
"name": "Standard_LRS"
},
"kind": "StorageV2"
"kind": "StorageV2",
"tags": "[parameters('tags')]"
}
]
}
2 changes: 1 addition & 1 deletion src/PSDocs.Azure/docs/Azure.Template.Doc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function global:GetTemplateParameter {
if ([bool]$property.Value.PSObject.Properties['metadata'] -and [bool]$property.Value.metadata.PSObject.Properties['description']) {
$result.Description = $property.Value.metadata.description;
}
if ([bool]$property.Value.PSObject.Properties['defaultValue']) {
if ([bool]$property.Value.PSObject.Properties['defaultValue'] -or [bool]$property.Value.PSObject.Properties['nullable']) {
$result['defaultValue'] = $property.Value.defaultValue;
$result['Required'] = 'Optional'
}
Expand Down