Azure Linux VM AAD Login in Bicep

作者: lesca 分类: Azure,Tutorials 发布时间: 2024-09-26 14:34

This is a simple example to show how to enable AAD Login for a Linux VM in Azure using Bicep. There is little resource I can find on the internet regarding this, so I decided to write it myself.

resource aadLoginExtension 'Microsoft.Compute/virtualMachines/extensions@2023-03-01' = {
  parent: vm
  name: 'AADLoginForLinux'
  location: location
  properties: {
    publisher: 'Microsoft.Azure.ActiveDirectory'
    type: 'AADSSHLoginForLinux'
    typeHandlerVersion: '1.0'
  }
}

The key is to make sure the publisher and type match the ones in the az cli command.

az vm extension set \
    --publisher Microsoft.Azure.ActiveDirectory \
    --name AADSSHLoginForLinux \
    --resource-group AzureADLinuxVM \
    --vm-name myVM

You can also use the following command to check if the extension is installed:

az vm extension show -g resourceGroupName --vm-name vmName --name AADSSHLoginForLinux 

Reference:

版权声明

本文出自 Lesca 技术宅,转载时请注明出处及相应链接。

本文永久链接: https://www.lesca.cn/archives/azure-linux-vm-aad-login-in-bicep.html

如果觉得我的文章对您有用,请随意赞赏。您的支持将鼓励我继续创作!

Leave a Reply

Your email address will not be published. Required fields are marked *