PowerShell ile Azure Private Endpoint Yapılandırması

Azure Private Endpoint, servislere internet yerine özel ağınız üzerinden erişim sağlar. Bu yaklaşım güvenlik açısından kritiktir ve PowerShell ile yapılandırması sistemlidir.

Private Endpoint Oluşturmak

PowerShell

$storageId = (Get-AzStorageAccount -ResourceGroupName "ai" -Name "filesharetest01234").Id

$subnet= (Get-AzVirtualNetwork -Name "vpntest-vnet" -ResourceGroupName "vpntest").Subnets |
             Where-Object { $_.Name -eq "ggg" }
 
$plsConn = New-AzPrivateLinkServiceConnection -Name "storage-conn" `
    -PrivateLinkServiceId $storageId -GroupId "blob"
 
New-AzPrivateEndpoint -ResourceGroupName "newrg-" `
    -Name "pe-storage-blob" -Location "eastus" `
    -Subnet $subnet -PrivateLinkServiceConnection $plsConn
Write-Host "Private Endpoint olusturuldu." -ForegroundColor Green
 

Private DNS Zone Bağlamak

PowerShell

$dnsZone = New-AzPrivateDnsZone -ResourceGroupName "newrg-" `
    -Name "privatelink.blob.core.windows.net"
 
New-AzPrivateDnsVirtualNetworkLink -ResourceGroupName "newrg- " `
    -ZoneName "privatelink.blob.core.windows.net" `
    -Name "blob-dns-link" `
    -VirtualNetworkId (Get-AzVirtualNetwork -Name "vpntest-vnet" -ResourceGroupName "vpntest").Id `
    -EnableRegistration
Write-Host "Private DNS Zone baglnadı." -ForegroundColor Green