Code Monkey home page Code Monkey logo

private-endpoint-network-setup's Introduction

Private Endpoint network setup

Architecture

Here is example private endpoint network setup in hub-spoke network topology:

private endpoint network setup architecture

This architecture deploys Private DNS Zone to the hub network. Spoke deployments then update the private IP addresses of the services deployed to the spoke networks.

Step-by-step walkthrough

If you want to mimic typical Enterprise environment, then create 3 different service principals to your environment (here using simplified naming conventions):

  • hub: contributor in rg-pedemo-hub resource group
  • spoke1: contributor in rg-pedemo-spoke1 resource group
  • spoke2: contributor in rg-pedemo-spoke2 resource group

On top of the contributor role you need to have additional permissions for service principals for VNet peering and Private DNS Zone. E.g. spoke1 needs to update Private DNS Zone record set in rg-pedemo-hub and make VNet peering between spoke1 and hub VNets (same permissions apply for spoke2). You can choose to use e.g. Network Contributor role in your setup, if don't want to create custom role.

You can use following code to login as service principal:

$tenantId = "<your tenant id>"
$clientID = "<your service principal Application (client) ID>"
$clientSecret = "<your service principal secret>"
$clientPassword = ConvertTo-SecureString $clientSecret -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential($clientID, $clientPassword)
Login-AzAccount -Credential $credentials -ServicePrincipal -TenantId $tenantId

# Verify correct context
Get-AzSubscription

Now you can use correct service principals for deploying their individual templates.

Deploy example

bicep build .\hub\main.bicep && .\hub\deploy.ps1
bicep build .\spoke1\main.bicep && .\spoke1\deploy.ps1
bicep build .\spoke2\main.bicep && .\spoke2\deploy.ps1

private-endpoint-network-setup's People

Contributors

jannemattila avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.