Finally, we have reached the point of automating the manual tasks that have been implemented so far.
Automating the tasks
Adding a service endpoint to an existing virtual network using PowerShell
Adding a service endpoint to an existing virtual network is pretty straightforward. All you need to do is run the following cmdlet:
Get-AzureRmVirtualNetwork -ResourceGroupName PacktPub -Name PSVNet | Set-AzureRmVirtualNetworkSubnetConfig -Name NSubnet -AddressPrefix "192.168.1.0/24" -ServiceEndpoint "Microsoft.Storage" | Set-AzureRmVirtualNetwork