Skip to content

Commit

Permalink
Merge pull request #167 from Barts-Life-Science/fix-storage-key-again
Browse files Browse the repository at this point in the history
Fix case of StorageAccountkey2, and fix logic in PowerShell script
  • Loading branch information
BIOKU-BH authored Sep 25, 2024
2 parents ed46fde + 2c0d64b commit 79c0806
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Remove-Item -LiteralPath "C:\AzureData" -Force -Recurse
$ErrorActionPreference = "Stop"

if( ${SharedStorageAccess} -eq 1 -And ${StorageAccountKey1} -match "/")
if( $SharedStorageAccess -eq 1 -and $StorageAccountKey1 -match "/")
{
$Command = "net use z: \\${StorageAccountFileHost}\${FileShareName} /u:AZURE\${StorageAccountName} ${StorageAccountKey2}"
$Command | Out-File "C:\ProgramData\Start Menu\Programs\StartUp\attach_storage.cmd" -encoding ascii
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ resource "azurerm_windows_virtual_machine" "windowsvm" {
SharedStorageAccess = var.shared_storage_access ? 1 : 0
StorageAccountName = data.azurerm_storage_account.stg.name
StorageAccountKey1 = data.azurerm_storage_account.stg.primary_access_key
StorageAccountkey2 = data.azurerm_storage_account.stg.secondary_access_key
StorageAccountKey2 = data.azurerm_storage_account.stg.secondary_access_key
StorageAccountFileHost = data.azurerm_storage_account.stg.primary_file_host
FileShareName = var.shared_storage_access ? data.azurerm_storage_share.shared_storage[0].name : ""
CondaConfig = local.selected_image.conda_config ? 1 : 0
Expand Down

0 comments on commit 79c0806

Please sign in to comment.