Skip to content
Merged
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
3 changes: 1 addition & 2 deletions .github/workflows/ms.resources.tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ jobs:
- name: 'Using test file [${{ matrix.moduleTestFilePaths }}]'
uses: ./.github/actions/templates/validateModuleDeployment
with:
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
parameterFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}'
templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}'
location: '${{ env.location }}'
resourceGroupName: '${{ env.resourceGroupName }}'
subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}'
Expand Down
5 changes: 0 additions & 5 deletions modules/Microsoft.Resources/tags/.test/min.parameters.json

This file was deleted.

17 changes: 17 additions & 0 deletions modules/Microsoft.Resources/tags/.test/min/deploy.test.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
targetScope = 'subscription'

// ========== //
// Parameters //
// ========== //
@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'rtmin'

// ============== //
// Test Execution //
// ============== //

module testDeployment '../../deploy.bicep' = {
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
params: {
}
}
18 changes: 0 additions & 18 deletions modules/Microsoft.Resources/tags/.test/rg.parameters.json

This file was deleted.

41 changes: 41 additions & 0 deletions modules/Microsoft.Resources/tags/.test/rg/deploy.test.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
targetScope = 'subscription'

// ========== //
// Parameters //
// ========== //
@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(90)
param resourceGroupName string = 'ms.resources.tags-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = deployment().location

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'rtrg'

// =========== //
// Deployments //
// =========== //

// General resources
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: location
}

// ============== //
// Test Execution //
// ============== //

module testDeployment '../../deploy.bicep' = {
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
params: {
onlyUpdate: false
resourceGroupName: resourceGroup.name
tags: {
Test: 'Yes'
TestToo: 'No'
}
}
}
15 changes: 0 additions & 15 deletions modules/Microsoft.Resources/tags/.test/sub.parameters.json

This file was deleted.

22 changes: 22 additions & 0 deletions modules/Microsoft.Resources/tags/.test/sub/deploy.test.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
targetScope = 'subscription'

// ========== //
// Parameters //
// ========== //
@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'rtsub'

// ============== //
// Test Execution //
// ============== //

module testDeployment '../../deploy.bicep' = {
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
params: {
onlyUpdate: true
tags: {
Test: 'Yes'
TestToo: 'No'
}
}
}
11 changes: 5 additions & 6 deletions modules/Microsoft.Resources/tags/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ The following module usage examples are retrieved from the content of the files

```bicep
module tags './Microsoft.Resources/tags/deploy.bicep' = {
name: '${uniqueString(deployment().name)}-Tags'
name: '${uniqueString(deployment().name)}-test-rtmin'
params: {

}
}
```
Expand Down Expand Up @@ -131,10 +130,10 @@ module tags './Microsoft.Resources/tags/deploy.bicep' = {

```bicep
module tags './Microsoft.Resources/tags/deploy.bicep' = {
name: '${uniqueString(deployment().name)}-Tags'
name: '${uniqueString(deployment().name)}-test-rtrg'
params: {
onlyUpdate: false
resourceGroupName: 'validation-rg'
resourceGroupName: '<resourceGroupName>'
tags: {
Test: 'Yes'
TestToo: 'No'
Expand All @@ -159,7 +158,7 @@ module tags './Microsoft.Resources/tags/deploy.bicep' = {
"value": false
},
"resourceGroupName": {
"value": "validation-rg"
"value": "<resourceGroupName>"
},
"tags": {
"value": {
Expand All @@ -182,7 +181,7 @@ module tags './Microsoft.Resources/tags/deploy.bicep' = {

```bicep
module tags './Microsoft.Resources/tags/deploy.bicep' = {
name: '${uniqueString(deployment().name)}-Tags'
name: '${uniqueString(deployment().name)}-test-rtsub'
params: {
onlyUpdate: true
tags: {
Expand Down