Giter Club home page Giter Club logo

privateendpoint's Introduction

PrivateEndpoint

This repository is to help you get started with deploying and managing Private Endpoints for your Azure resources. Everything is deployed using Bicep.

What are Private Endpoints?

Private Endpoints connects your existing PaaS services in Azure to a virtual network, allowing other services inside Azure or on-premises to connect to the Private Endpoint enabled services over your private network. Enabling Private Endpoint on a service does not give it outbound connectivity, it only handles inbound.

Deploy Private Link DNS Zones

To get started you'll first need to deploy all the private DNS zones for the services you require. Remove the zones you don't need from the deploy-privatelink-zones\dns.parameters.json file, or deploy them all at once.

  • Deploy zones to resource group, replace ResourceGroupName with your own
    • New-AzResourceGroupDeployment -ResourceGroupName central-dns-rg -TemplateFile .\deploy-privatelink-zones\dns.bicep -TemplateParameterFile .\deploy-privatelink-zones\dns.parameters.json

Create links to virtual networks

Once the zones are created you'll need to create virtual network links for each zone to your virtual networks that host services that should be able to resolve the Private Endpoints to their Private IPs. Doing this by hand for each zone can be very time consuming, instead add the required virtual networks in the deploy-privatelink-zones\dns.parameters.json file and redeploy every time a new network is in need of the links.

  • Give your link a name

  • Add the virtual network resource id

    DnsVnetLink

  • Deploy to add virtual network links

    • New-AzResourceGroupDeployment -ResourceGroupName central-dns-rg -TemplateFile .\deploy-privatelink-zones\dns.bicep -TemplateParameterFile .\deploy-privatelink-zones\dns.parameters.json

    DnsVnetLink2

Manage Private Endpoints using Azure Policy

Now that the zones and links are in place we want an automated and reliable way of creating the DNS records for each Private Endpoint that you enable for your different Azure services. Provided here is a complete policy package that takes care of all the services.

Parameter Description
location Location can be any Azure location
privateLinkZonesSubscriptionId Subscription id that holds your private DNS zones
privateLinkZonesResourceGroup Resource group that holds your private DNS zones
policyInitiativeName Name of the policy initiative that will be deployed

  • Deploy policy package, replace ManagementGroupId with your own
    • New-AzManagementGroupDeployment -ManagementGroupId mg-policy -TemplateFile .\policy-package\main.bicep -TemplateParameterFile .\policy-package\main.parameters.json
  • Assign your newly created initiative
    • Requires Network Contributor on Private Endpoint resources and Private DNS Zone Contributor on resource group containing all your zones (Network Contributor does the job)

Deployed policies

PolicyPackage


Deployed initiative containing all policies

PolicyPackage2

Credit

Special thanks to Stefan and Simon for all their Bicep knowledge.

privateendpoint's People

Contributors

hardstl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.