Azure Linux VM AAD Login in Bicep
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