Update snapshot Property by using Azure Automation account

Hanh Trinh 41 Reputation points
2024-04-23T14:49:55.79+00:00

Hello,

I have a Backup vault that takes snapshot for OS disks and shared disks everyday, during 14 days.

When checking the snapshot file, the network setting is enabled public access from all network. Because there are a lot of snapshot file that I need to change network setting to Disable public and private access, so I can't do it manually.

Look forward for so a solution change network setting by using Automation account, please .

Below is my script in automation account, but it was failed :

$snapshotnames = (Get-AzSnapshot -resourceGroupName 'td.hanh').Name  

az snapshot update -snapshotnames $snapshot --network-access-policy DenyAll

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,132 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,124 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,079 questions
{count} votes