-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cj-refactor-app-config
- Loading branch information
Showing
142 changed files
with
8,315 additions
and
2,132 deletions.
There are no files selected for viewing
File renamed without changes.
6 changes: 0 additions & 6 deletions
6
.../common/data/resource-provider/FoundationaLLM.Configuration/_api-endpoint-references.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
...-start/data/resource-provider/FoundationaLLM.Configuration/AuthorizationAPI.template.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.azure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Deployment Configurations and Scripts | ||
|
||
The deployment configurations and scripts are located in this `deploy` directory. | ||
If you are looking for the deployment instructions, please refer to the [documentation](https://docs.foundationallm.ai) and it is also available in this repository in the `docs` directory as markdown files. | ||
[Setup Guides in Markdown format](https://github.com/solliancenet/foundationallm/blob/main/docs/setup-guides/index.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/usr/bin/env pwsh | ||
|
||
Set-PSDebug -Trace 0 # Echo every command (0 to disable, 1 to enable) | ||
Set-StrictMode -Version 3.0 | ||
$ErrorActionPreference = "Stop" | ||
|
||
# Load utility functions | ||
Push-Location $($MyInvocation.InvocationName | Split-Path) | ||
try { | ||
. ./utility/Load-Utility-Functions.ps1 | ||
} | ||
finally { | ||
Pop-Location | ||
} | ||
|
||
$dnsServerIp = "${env:DNS_RESOLVER_ENDPOINT_IP}" | ||
$outputFolderPath = "../standard-hub/config/vpn" | Get-AbsolutePath | ||
$outputFilePath = Join-Path $outputFolderPath "VpnClientConfiguration.zip" | ||
$resourceGroupName = "${env:RESOURCE_GROUP_NAME}" | ||
$vpnGatewayName = "${env:VPN_GATEWAY_NAME}" | ||
$xmlFilePath = Join-Path $outputFolderPath "AzureVPN" "azurevpnconfig.xml" # Assuming the XML file is inside the extracted folder | ||
|
||
# Add the dns-resolver extension to the cli | ||
az extension add --name dns-resolver --allow-preview true --yes --only-show-errors | ||
|
||
# Get the VPN client configuration package URL | ||
$vpnClientPackageUrl = az network vnet-gateway vpn-client generate ` | ||
--name $vpnGatewayName ` | ||
--resource-group $resourceGroupName ` | ||
--output tsv | ||
|
||
# Download the package and extract | ||
Invoke-WebRequest -Uri $vpnClientPackageUrl -OutFile $outputFilePath | ||
Expand-Archive -Path $outputFilePath -DestinationPath $outputFolderPath -Force | ||
|
||
# Assuming the XML file is directly inside the expanded folder & Read the XML file | ||
$expandedFolder = (Get-ChildItem -Directory -Path $outputFolderPath)[0].FullName | ||
$xmlFilePath = Join-Path -Path $expandedFolder -ChildPath "azurevpnconfig.xml" | ||
$xmlContent = Get-Content -Path $xmlFilePath | ||
$azureVpnClientConfig = [xml]$xmlContent | ||
|
||
# Create a namespace manager | ||
$namespaceManager = New-Object System.Xml.XmlNamespaceManager($azureVpnClientConfig.NameTable) | ||
$namespaceManager.AddNamespace("ns", "http://schemas.datacontract.org/2004/07/") | ||
$namespaceManager.AddNamespace("i", "http://www.w3.org/2001/XMLSchema-instance") | ||
|
||
# Remove <clientconfig i:nil="true" /> node if it exists | ||
$nilClientConfigNode = $azureVpnClientConfig.SelectSingleNode("//ns:clientconfig[@i:nil='true']", $namespaceManager) | ||
if ($nilClientConfigNode -ne $null) { | ||
$nilClientConfigNode.ParentNode.RemoveChild($nilClientConfigNode) | Out-Null | ||
} | ||
|
||
# Create DNS servers XML nodes | ||
$dnsServersNode = $azureVpnClientConfig.CreateElement("dnsservers", "http://schemas.datacontract.org/2004/07/") | ||
$dnsServer1 = $azureVpnClientConfig.CreateElement("dnsserver", "http://schemas.datacontract.org/2004/07/") | ||
$dnsServer1.InnerText = $dnsServerIp | ||
$dnsServersNode.AppendChild($dnsServer1) | Out-Null | ||
|
||
# Locate the clientconfig node or create it if it doesn't exist | ||
$clientConfigNode = $azureVpnClientConfig.SelectSingleNode("//ns:clientconfig", $namespaceManager) | ||
if ($clientConfigNode -eq $null) { | ||
$clientConfigNode = $azureVpnClientConfig.CreateElement("clientconfig", "http://schemas.datacontract.org/2004/07/") | ||
$azureVpnClientConfig.DocumentElement.AppendChild($clientConfigNode) | Out-Null | ||
} | ||
|
||
# Append DNS servers to clientconfig | ||
$clientConfigNode.AppendChild($dnsServersNode) | Out-Null | ||
|
||
# Save the updated XML file | ||
$azureVpnClientConfig.Save($xmlFilePath) | ||
|
||
Write-Host -ForegroundColor Yellow ` | ||
"Please Install the Azure VPN client via https://aka.ms/azvpnclientdownload, and | ||
then import the VPN client configuration package downloaded to $xmlFilePath. Make sure to connect | ||
to the VPN prior to running the next step of the FLLM Install for Standard." |
18 changes: 18 additions & 0 deletions
18
deploy/standard-hub/azd-hooks/utility/Get-AbsolutePath.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#! /usr/bin/pwsh | ||
|
||
Set-PSDebug -Trace 0 # Echo every command (0 to disable, 1 to enable) | ||
Set-StrictMode -Version 3.0 | ||
$ErrorActionPreference = "Stop" | ||
|
||
function Get-AbsolutePath { | ||
<# | ||
.SYNOPSIS | ||
Get the absolute path of a file or directory. Relative path does not need to exist. | ||
#> | ||
param ( | ||
[Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)] | ||
[string]$RelatviePath | ||
) | ||
|
||
return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($RelatviePath) | ||
} |
9 changes: 9 additions & 0 deletions
9
deploy/standard-hub/azd-hooks/utility/Load-Utility-Functions.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env pwsh | ||
|
||
Push-Location $($MyInvocation.InvocationName | Split-Path) | ||
try { | ||
. ./utility/Get-AbsolutePath.ps1 | ||
} | ||
finally { | ||
Pop-Location | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json | ||
|
||
# Name of the application. | ||
name: foundationallm-standard-hub | ||
hooks: | ||
postprovision: | ||
shell: pwsh | ||
continueOnError: false | ||
interactive: true | ||
run: azd-hooks/postprovision.ps1 |
Oops, something went wrong.