question

John-8849 avatar image
0 Votes"
John-8849 asked VireshMathapati-2926 edited

List of VM's associated with Key Vault

How to import the list of Azure Vm's associated with the specific key vault through powershell ?
Kindly help me with steps.

azure-key-vault
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JamesTran-MSFT avatar image
0 Votes"
JamesTran-MSFT answered JamesTran-MSFT commented

@John-8849
Thank you for your post and I apologize for the delayed response!

To get a list of VMs associated with a specific Key Vault, you can run the Get-AzKeyVault PowerShell command. Using the output, you can see what access policies are assigned and to which VM.

 Get-AzKeyVault -VaultName 'myvault'

130307-image.png

Additional Links:
Get-AzKeyVault
Az.KeyVault



I hope this helps, if you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.


Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.


image.png (46.7 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@John-8849
I just wanted to check in and see if you had any other questions or if you were able to resolve this issue?

0 Votes 0 ·
VireshMathapati-2926 avatar image
0 Votes"
VireshMathapati-2926 answered VireshMathapati-2926 edited

I tried Get-AzKeyVault -VaultName 'myvault' but this isn't helpful to get list of VM's associated with Key Vault, it only displays the access policies of the key vault not the list of VMs encrypted using the key vault.

There is another manual way I found, go to particular Key Vault>>Secrets>>Select and open the particular Secret then you will be able to see the tags there and one of the tag should have contained the VM name.

182928-key-vault-secret-vm-name.png



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.