Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvand committed Dec 4, 2024
1 parent 30c0dce commit fcdf28d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 36 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@
"reveal": "silent"
}
},
{
"label": "deploy template",
"type": "shell",
"command": "${workspaceFolder}/DeployTemplate.ps1",
"args": ["-password", "${input:accountsPassword}"],
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true,
"focus": true
},
"problemMatcher": []
},
{
"label": "generate all dsc archives",
"type": "shell",
Expand Down Expand Up @@ -65,6 +78,13 @@
"id": "resourceGrouppName",
"description": "Name of the resource group.",
"default": "resource-groupp-name"
},
{
"type": "promptString",
"id": "accountsPassword",
"description": "The password requires at least 8 characters.",
"default": "",
"password": true
}
]
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
#Requires -PSEdition Core
#Requires -Module Az.Resources

param(
[string] $resourceGroupLocation = "francecentral",
[string] $resourceGroupName = "ydtlfull1",
[string] $password = ""
)

### Set variables
$resourceGroupLocation = 'westeurope'
$resourceGroupLocation = 'francecentral'
$resourceGroupName = "ydtlfull1"
$templateFileName = 'main.bicep'
$templateParametersFileName = 'azuredeploy.parameters.json'

### Set passwords
# $securePassword = $password| ConvertTo-SecureString -AsPlainText -Force
$securePassword = $password | ConvertTo-SecureString -AsPlainText -Force -ErrorAction SilentlyContinue
if ($null -eq $securePassword) { $securePassword = Read-Host "Type the password of admin and service accounts" -AsSecureString }
$passwords = New-Object -TypeName HashTable
$passwords.adminPassword = $securePassword
$passwords.otherAccountsPassword = $securePassword

# ### Set parameters
$scriptRoot = $PSScriptRoot
#$scriptRoot = "C:\Job\Dev\Github\AzureRM-Templates\SharePoint\SharePoint-ADFS"
$TemplateFile = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($scriptRoot, $templateFileName))
#$scriptRoot = "C:\YvanData\repos\AzureRM-Templates\Azure Resource Manager\SharePoint-ADFS"
$templateFile = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($scriptRoot, $templateFileName))
$templateParametersFile = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($scriptRoot, $templateParametersFileName))
# $parameters = New-Object -TypeName HashTable
# $parameters.adminPassword = $securePassword
Expand Down Expand Up @@ -55,7 +58,7 @@ if ($null -eq (Get-AzResourceGroup -ResourceGroupName $resourceGroupName -ErrorA
### Test template and deploy if it is valid, otherwise display error details
$checkTemplate = Test-AzResourceGroupDeployment `
-ResourceGroupName $resourceGroupName `
-TemplateFile $TemplateFile `
-TemplateFile $templateFile `
-Verbose `
-TemplateParameterFile $templateParametersFile `
@passwords
Expand All @@ -69,7 +72,7 @@ if ($checkTemplate.Count -eq 0) {
$result = New-AzResourceGroupDeployment `
-Name $resourceDeploymentName `
-ResourceGroupName $resourceGroupName `
-TemplateFile $TemplateFile `
-TemplateFile $templateFile `
-Verbose -Force `
-TemplateParameterFile $templateParametersFile `
@passwords
Expand Down

0 comments on commit fcdf28d

Please sign in to comment.