diff --git a/examples/bicep/storage/v1/README.md b/examples/bicep/storage/v1/README.md index 16f7731d..7b8ea41e 100644 --- a/examples/bicep/storage/v1/README.md +++ b/examples/bicep/storage/v1/README.md @@ -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 @@ -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 @@ -45,6 +52,9 @@ The location of the storage account. "parameters": { "name": { "value": "" + }, + "tags": { + "value": {} } } } diff --git a/examples/bicep/storage/v1/main.bicep b/examples/bicep/storage/v1/main.bicep index 3ac20f98..a4b3b647 100644 --- a/examples/bicep/storage/v1/main.bicep +++ b/examples/bicep/storage/v1/main.bicep @@ -13,6 +13,9 @@ 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 @@ -20,4 +23,5 @@ resource storage 'Microsoft.Storage/storageAccounts@2022-09-01' = { name: 'Standard_LRS' } kind: 'StorageV2' + tags: tags } diff --git a/examples/bicep/storage/v1/main.json b/examples/bicep/storage/v1/main.json index c1c0f51e..f13b6cd1 100644 --- a/examples/bicep/storage/v1/main.json +++ b/examples/bicep/storage/v1/main.json @@ -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": [ @@ -35,7 +42,8 @@ "sku": { "name": "Standard_LRS" }, - "kind": "StorageV2" + "kind": "StorageV2", + "tags": "[parameters('tags')]" } ] } \ No newline at end of file diff --git a/src/PSDocs.Azure/docs/Azure.Template.Doc.ps1 b/src/PSDocs.Azure/docs/Azure.Template.Doc.ps1 index b449c2f3..c9368f8b 100644 --- a/src/PSDocs.Azure/docs/Azure.Template.Doc.ps1 +++ b/src/PSDocs.Azure/docs/Azure.Template.Doc.ps1 @@ -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' }