Skip to content

Commit 7776848

Browse files
authored
Merge pull request #163 from Barts-Life-Science/bug/windows-shared-storage-mount
temporary fix windows storage keys
2 parents ab8e11e + 00d0c10 commit 7776848

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/terraform/vm_config.ps1

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
Remove-Item -LiteralPath "C:\AzureData" -Force -Recurse
22
$ErrorActionPreference = "Stop"
33

4-
if( ${SharedStorageAccess} -eq 1 )
4+
if( ${SharedStorageAccess} -eq 1 -And ${StorageAccountKey1} -match "/")
55
{
6-
$Command = "net use z: \\${StorageAccountFileHost}\${FileShareName} /u:AZURE\${StorageAccountName} ${StorageAccountKey}"
6+
$Command = "net use z: \\${StorageAccountFileHost}\${FileShareName} /u:AZURE\${StorageAccountName} ${StorageAccountKey2}"
7+
$Command | Out-File "C:\ProgramData\Start Menu\Programs\StartUp\attach_storage.cmd" -encoding ascii
8+
} else
9+
{
10+
$Command = "net use z: \\${StorageAccountFileHost}\${FileShareName} /u:AZURE\${StorageAccountName} ${StorageAccountKey1}"
711
$Command | Out-File "C:\ProgramData\Start Menu\Programs\StartUp\attach_storage.cmd" -encoding ascii
812
}
913

templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/terraform/windowsvm.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ resource "azurerm_windows_virtual_machine" "windowsvm" {
5252
nexus_proxy_url = local.nexus_proxy_url
5353
SharedStorageAccess = var.shared_storage_access ? 1 : 0
5454
StorageAccountName = data.azurerm_storage_account.stg.name
55-
StorageAccountKey = data.azurerm_storage_account.stg.primary_access_key
55+
StorageAccountKey1 = data.azurerm_storage_account.stg.primary_access_key
56+
StorageAccountkey2 = data.azurerm_storage_account.stg.secondary_access_key
5657
StorageAccountFileHost = data.azurerm_storage_account.stg.primary_file_host
5758
FileShareName = var.shared_storage_access ? data.azurerm_storage_share.shared_storage[0].name : ""
5859
CondaConfig = local.selected_image.conda_config ? 1 : 0

0 commit comments

Comments
 (0)