How to use MSI authentication in IaaSDiagnostics extension

Manoj Subramani 0 Reputation points Microsoft Employee
2024-06-12T19:03:10.9533333+00:00

IaaSDiagnostics extension uses storage keys. Documentation here: https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/diagnostics-template#add-the-azure-diagnostics-extension-to-the-vm-resource-definition

"protectedSettings": { "storageAccountName": "[parameters('existingdiagnosticsStorageAccountName')]", "storageAccountKey": "[listkeys(variables('accountid'), '2015-05-01-preview').key1]", "storageAccountEndPoint": "https://core.windows.net"

I want to use MSI instead. How do I switch to MSI authentication?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,464 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Miguel Gonçalves | AVANADE 886 Reputation points
    2024-06-12T23:52:37.4866667+00:00

    Hi Manoj,

    You would need to modify your configuration to use Managed Identity instead of storage keys.

    1. Enable MI: https://learn.microsoft.com/en-us/azure/azure-monitor/agents/diagnostics-extension-windows-install
    2. Assign Role to MI: https://learn.microsoft.com/en-us/azure/azure-monitor/agents/diagnostics-extension-windows-install
    3. you would remove the storageAccountKey and storageAccountName from the protectedSettings section. Instead, you would add storageAccountResourceId, which is the Resource ID of the storage account. https://learn.microsoft.com/en-us/azure/azure-monitor/agents/diagnostics-extension-windows-install

    |-------------------------------->>> If the reply was helpful please don't forget to upvote and/or accept as answer, thank you