diff --git a/azure/logs/scripts/LinuxVM/README.md b/azure/logs/scripts/LinuxVM/README.md index 0477c1c..8298f28 100644 --- a/azure/logs/scripts/LinuxVM/README.md +++ b/azure/logs/scripts/LinuxVM/README.md @@ -7,14 +7,22 @@ Required arguments: - `$vmResourceGroup` Virtual machine resource group -- `$storageAccountName` Name of the Storage account. If the SolarWinds log processing pipeline was created using [default parameters](../../template/deploy-swi-azure-logs-forwarder.ps1), the storage account name is `fnstorswilogs`. +- `$storageAccountName` Name of the Storage account that was created using [default parameters](../../template/deploy-swi-azure-logs-forwarder.ps1) - `$storageAccountResourceGroup` Resource group where the Storage is located. If the SolarWinds log processing pipeline was created using [default parameters](../../template/deploy-swi-azure-logs-forwarder.ps1), the storage account name is `swi-logs`. - `$eventHubUri` Event hub URI in the format `https://.servicebus.windows.net/`, for example `https://swi-logsns.servicebus.windows.net/swi-logs`. -- `$eventHubPolicyName` and `$eventHubAccessPolicyKey` Name of the policy and policy key for accessing the SolarWinds log processing pipeline event hub. You can copy the values from the Azure Portal. Go to "Your Event Hub" > Shared access policies. -The default policy name for the SolarWinds pipeline is `sendlogs`. +- `$eventHubPolicyName` and `$eventHubAccessPolicyKey` Name of the policy and policy key for accessing the SolarWinds log processing pipeline event hub. You can copy the values from the Azure Portal. Go to "Your Event Hub Namespace" > Shared access policies. + The default policy name for the SolarWinds pipeline is `RootManageSharedAccessKey`. + +Pre-requisites: +- The Linux diagnostic extension requires Python 2. If your virtual machine uses a distribution that doesn't include Python 2, install it. +- Refer to https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/diagnostics-linux-v3#python-requirement + +Usage: +- `./install_linux_diag_ext.ps1 -vmName my-vm-name -vmResourceGroup -storageAccountName storage-account-name -storageAccountResourceGroup swi-logs -eventHubUri swi-logsns-xyz123.servicebus.windows.net/swi-logs -eventHubPolicyName RootManageSharedAccessKey -eventHubAccessPolicyKey ` + ## Additional information diff --git a/azure/logs/scripts/LinuxVM/install_linux_diag_ext.ps1 b/azure/logs/scripts/LinuxVM/install_linux_diag_ext.ps1 index 8562b77..5a977cf 100644 --- a/azure/logs/scripts/LinuxVM/install_linux_diag_ext.ps1 +++ b/azure/logs/scripts/LinuxVM/install_linux_diag_ext.ps1 @@ -55,7 +55,7 @@ $HMAC.key = [Text.Encoding]::ASCII.GetBytes($eventHubAccessPolicyKey) $Signature = $HMAC.ComputeHash([Text.Encoding]::ASCII.GetBytes($SignatureString)) $Signature = [Convert]::ToBase64String($Signature) $token = "sr=" + [System.Web.HttpUtility]::UrlEncode($eventHubUri) + "&sig=" + [System.Web.HttpUtility]::UrlEncode($Signature) + "&se=" + $Expires + "&skn=" + $eventHubPolicyName -$sasUrl = "https://" + $eventHubUri + '?' + $token +$sasUrl = $eventHubUri + '?' + $token # Generate a SAS token for the agent to authenticate with the storage account $sasToken = New-AzStorageAccountSASToken -Service Blob,Table -ResourceType Service,Container,Object -Permission "racwdlup" -Context (Get-AzStorageAccount -ResourceGroupName $storageAccountResourceGroup -AccountName $storageAccountName).Context -ExpiryTime $([System.DateTime]::Now.AddYears(2)) diff --git a/azure/logs/scripts/WindowsVM/README.md b/azure/logs/scripts/WindowsVM/README.md index 0d214ee..e0ab905 100644 --- a/azure/logs/scripts/WindowsVM/README.md +++ b/azure/logs/scripts/WindowsVM/README.md @@ -7,7 +7,7 @@ Required arguments: - `$vmResourceGroup` Virtual machine resource group -- `$storageAccountName` Name of the Storage account. If the SolarWinds log processing pipeline was created using [default parameters](../../template/deploy-swi-azure-logs-forwarder.ps1), the storage account name is `fnstorswilogs`. +- `$storageAccountName` Name of the Storage account that was created using [default parameters](../../template/deploy-swi-azure-logs-forwarder.ps1) - `$storageAccountKey` API key for accessing storage account. You can copy its value from the Azure Portal. Go to "Your Storage Account" > "Access keys" and copy key1.