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
23 changes: 22 additions & 1 deletion d365bap.tools/internal/configurations/configuration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,25 @@ Set-PSFConfig -FullName "d365bap.tools.tenant.details" -Value @{} -Initialize -D

Set-PSFConfig -FullName "d365bap.tools.path.azcopy" -Value "C:\temp\d365bap.tools\AzCopy\AzCopy.exe" -Initialize -Description "Path to the default location where AzCopy.exe is located."

Set-PSFConfig -FullName "d365bap.tools.ude.dbjit.cache" -Value @{} -Initialize -Description "Object that stores different Ude Database JIT credentials and their details."
Set-PSFConfig -FullName "d365bap.tools.ude.dbjit.cache" -Value @{} -Initialize -Description "Object that stores different Ude Database JIT credentials and their details."

Set-PSFConfig -FullName "d365bap.tools.bap.deploy.locations" -Value @{
"UnitedStates" = @("EastUS", "WestUS", "EastUS2", "CentralUS")
"UnitedStatesFirstRelease" = @("EastUS", "WestUS", "EastUS2", "CentralUS")
"Europe" = @("WestEurope", "NorthEurope")
"Asia" = @("EastAsia", "SoutheastAsia")
"Australia" = @("AustraliaEast", "AustraliaSoutheast")
"India" = @("CentralIndia", "SouthIndia")
"Japan" = @("JapanEast", "JapanWest")
"Canada" = @("CanadaCentral", "CanadaEast")
"UnitedKingdom" = @("UKSouth", "UKWest")
"SouthAmerica" = @("BrazilSouth")
"France" = @("FranceCentral", "FranceSouth")
"UnitedArabEmirates" = @("UAENorth")
"Germany" = @("GermanyNorth", "GermanyWestCentral")
"Switzerland" = @("SwitzerlandNorth", "SwitzerlandWest")
"Norway" = @("NorwayEast", "NorwayWest")
"Korea" = @("KoreaCentral", "KoreaSouth")
"SouthAfrica" = @("SouthAfricaNorth")
"Sweden" = @("SwedenCentral")
} -Initialize -Description "Object that stores different BAP deploy locations and their details."
3 changes: 1 addition & 2 deletions d365bap.tools/internal/tepp/assignment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ Register-PSFTeppArgumentCompleter -Command Start-UdeDbSsms -Parameter Id -Name "

Register-PSFTeppArgumentCompleter -Command Get-BapDeployLocation -Parameter Name -Name "d365bap.tools.tepp.bap.locations"
Register-PSFTeppArgumentCompleter -Command Get-BapDeployTemplate -Parameter Location -Name "d365bap.tools.tepp.bap.locations"
Register-PSFTeppArgumentCompleter -Command Get-BapDeployParameter -Parameter Location -Name "d365bap.tools.tepp.bap.locations"

Register-PSFTeppArgumentCompleter -Command New-UdeEnvironment -Parameter Location -Name "d365bap.tools.tepp.bap.locations"
Register-PSFTeppArgumentCompleter -Command New-UdeEnvironment -Parameter Region -Name "d365bap.tools.tepp.bap.regions"
Register-PSFTeppArgumentCompleter -Command New-UdeEnvironment -Parameter FnoTemplate -Name "d365bap.tools.tepp.bap.templates"

Register-PSFTeppArgumentCompleter -Command New-UseEnvironment -Parameter Location -Name "d365bap.tools.tepp.bap.locations"
Register-PSFTeppArgumentCompleter -Command New-UseEnvironment -Parameter Region -Name "d365bap.tools.tepp.bap.regions"
Register-PSFTeppArgumentCompleter -Command New-UdeEnvironment -Parameter FnoTemplate -Name "d365bap.tools.tepp.bap.templates"
Register-PSFTeppArgumentCompleter -Command New-UseEnvironment -Parameter FnoTemplate -Name "d365bap.tools.tepp.bap.templates"
29 changes: 7 additions & 22 deletions d365bap.tools/internal/tepp/configurations.tepp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,6 @@ $scriptBlock = { Get-UdeDbJitCache | Sort-Object Id | Select-Object -ExpandPrope

Register-PSFTeppScriptblock -Name "d365bap.tools.tepp.ude.dbjit.credentials" -ScriptBlock $scriptBlock -Mode Simple

$azureRegions = @{
"UnitedStates" = @("EastUS", "WestUS", "EastUS2", "CentralUS")
"UnitedStatesFirstRelease" = @("EastUS", "WestUS", "EastUS2", "CentralUS")
"Europe" = @("WestEurope", "NorthEurope")
"Asia" = @("EastAsia", "SoutheastAsia")
"Australia" = @("AustraliaEast", "AustraliaSoutheast")
"India" = @("CentralIndia", "SouthIndia")
"Japan" = @("JapanEast", "JapanWest")
"Canada" = @("CanadaCentral", "CanadaEast")
"UnitedKingdom" = @("UKSouth", "UKWest")
"SouthAmerica" = @("BrazilSouth")
"France" = @("FranceCentral", "FranceSouth")
"UnitedArabEmirates" = @("UAENorth")
"Germany" = @("GermanyNorth", "GermanyWestCentral")
"Switzerland" = @("SwitzerlandNorth", "SwitzerlandWest")
"Norway" = @("NorwayEast", "NorwayWest")
"Korea" = @("KoreaCentral", "KoreaSouth")
"SouthAfrica" = @("SouthAfricaNorth")
"Sweden" = @("SwedenCentral")
}

$scriptBlock = {
param (
$commandName,
Expand All @@ -44,6 +23,8 @@ $scriptBlock = {
return
}

$azureRegions = Get-PSFConfigValue -FullName "d365bap.tools.bap.deploy.locations"

# Filter items based on the location and what the user has typed
$filteredItems = $azureRegions[$location] | Where-Object { $_ -like "$wordToComplete*" } | Sort-Object

Expand All @@ -55,7 +36,11 @@ $scriptBlock = {

Register-PSFTeppScriptblock -Name "d365bap.tools.tepp.bap.regions" -ScriptBlock $scriptBlock -Mode Full

$scriptBlock = { @($azureRegions.Keys | Sort-Object) }
$scriptBlock = {
$azureRegions = Get-PSFConfigValue -FullName "d365bap.tools.bap.deploy.locations"

@($azureRegions.Keys | Sort-Object)
}

Register-PSFTeppScriptblock -Name "d365bap.tools.tepp.bap.locations" -ScriptBlock $scriptBlock -Mode Simple

Expand Down
Loading