Create Pull Request
| Date | Scan | Status | Result |
|---|---|---|---|
| 2026-01-14 00:00 | #250 | in_progress |
Biased
|
| 2026-01-13 00:00 | #246 | completed |
Biased
|
| 2026-01-11 00:00 | #240 | completed |
Biased
|
| 2026-01-10 00:00 | #237 | completed |
Biased
|
| 2026-01-09 00:34 | #234 | completed |
Clean
|
| 2026-01-08 00:53 | #231 | completed |
Clean
|
| 2026-01-06 18:15 | #225 | cancelled |
Clean
|
| 2025-08-17 00:01 | #83 | cancelled |
Clean
|
| 2025-07-13 21:37 | #48 | completed |
Clean
|
| 2025-07-12 23:44 | #41 | cancelled |
Biased
|
Connect-AzAccount
# If you have multiple subscriptions, uncomment to set the subscription
#Select-AzSubscription -SubscriptionName "name of your subscription"
# Create the resource group that contains everything
New-AzResourceGroup -Name $resourceGroupName -Location $location
# Create the subnet configuration
$defaultSubnetConfig = New-AzVirtualNetworkSubnetConfig -Name $defaultSubnetName `
-AddressPrefix $defaultSubnetPrefix
$gatewaySubnetConfig = New-AzVirtualNetworkSubnetConfig -Name $gatewaySubnetName `
-AddressPrefix $gatewaySubnetPrefix
# Create the subnet
New-AzVirtualNetwork -Name $networkName `
-ResourceGroupName $resourceGroupName `
-Location $location `
-AddressPrefix $networkAddressPrefix `
-Subnet $defaultSubnetConfig, $gatewaySubnetConfig
# Get the network & subnet that were created
$network = Get-AzVirtualNetwork -Name $networkName `
-ResourceGroupName $resourceGroupName
$gatewaySubnet = Get-AzVirtualNetworkSubnetConfig -Name $gatewaySubnetName `
-VirtualNetwork $network
$defaultSubnet = Get-AzVirtualNetworkSubnetConfig -Name $defaultSubnetName `
-VirtualNetwork $network
# Set a dynamic public IP address for the gateway subnet
$gatewayPublicIp = New-AzPublicIpAddress -Name $gatewayPublicIpName `
-ResourceGroupName $resourceGroupName `
-Location $location `
-AllocationMethod Dynamic
$gatewayIpConfig = New-AzVirtualNetworkGatewayIpConfig -Name $gatewayIpConfigName `
-Subnet $gatewaySubnet `
-PublicIpAddress $gatewayPublicIp
# Get the certificate info
# Get the full path in case a relative path was passed
$rootCertFile = Get-ChildItem $rootCert
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($rootCertFile)
$certBase64 = [System.Convert]::ToBase64String($cert.RawData)
$p2sRootCert = New-AzVpnClientRootCertificate -Name $vpnRootCertName `
-PublicCertData $certBase64
# Create the VPN gateway
New-AzVirtualNetworkGateway -Name $vpnName `
-ResourceGroupName $resourceGroupName `
-Location $location `
-IpConfigurations $gatewayIpConfig `
-GatewayType Vpn `
-VpnType RouteBased `
-EnableBgp $false `
-GatewaySku Standard `
-VpnClientAddressPool $vpnClientAddressPool `
-VpnClientRootCertificates $p2sRootCert
# Create the HDInsight cluster
New-AzHDInsightCluster `
-ResourceGroupName $resourceGroupName `
-ClusterName $clusterName `
-Location $location `
-ClusterSizeInNodes $hdiWorkerNodes `
-ClusterType $hdiType `
-OSType Linux `
-Version $hdiVersion `
-HttpCredential $adminCreds `
-SshCredential $sshCreds `
-DefaultStorageAccountName "$storageName.blob.core.windows.net" `
-DefaultStorageAccountKey $defaultStorageKey `
-DefaultStorageContainer $defaultContainerName `
-DisksPerWorkerNode 2 `
-VirtualNetworkId $network.Id `
-SubnetName $defaultSubnet.Id
# Prompt for generic information
$resourceGroupName = Read-Host "What is the resource group name?"
$baseName = Read-Host "What is the base name? It is used to create names for resources, such as 'net-basename' and 'kafka-basename':"
$location = Read-Host "What Azure Region do you want to create the resources in?"
$rootCert = Read-Host "What is the file path to the root certificate? It is used to secure the VPN gateway."
# Prompt for HDInsight credentials
$adminCreds = Get-Credential -Message "Enter the HTTPS user name and password for the HDInsight cluster" -UserName "admin"
$sshCreds = Get-Credential -Message "Enter the SSH user name and password for the HDInsight cluster" -UserName "sshuser"
# Names for Azure resources
$networkName = "net-$baseName"
$clusterName = "kafka-$baseName"
$storageName = "store$baseName" # Can't use dashes in storage names
$defaultContainerName = $clusterName
$defaultSubnetName = "default"
$gatewaySubnetName = "GatewaySubnet"
$gatewayPublicIpName = "GatewayIp"
$gatewayIpConfigName = "GatewayConfig"
$vpnRootCertName = "rootcert"
$vpnName = "VPNGateway"
# Network settings
$networkAddressPrefix = "10.0.0.0/16"
$defaultSubnetPrefix = "10.0.0.0/24"
$gatewaySubnetPrefix = "10.0.1.0/24"
$vpnClientAddressPool = "172.16.201.0/24"
# HDInsight settings
$hdiWorkerNodes = 4
$hdiVersion = "3.6"
$hdiType = "Kafka"
# Create the storage account
New-AzStorageAccount `
-ResourceGroupName $resourceGroupName `
-Name $storageName `
-SkuName Standard_GRS `
-Location $location `
-Kind StorageV2 `
-EnableHttpsTrafficOnly 1
# Get the storage account keys and create a context
$defaultStorageKey = (Get-AzStorageAccountKey -ResourceGroupName $resourceGroupName `
-Name $storageName)[0].Value
$storageContext = New-AzStorageContext -StorageAccountName $storageName `
-StorageAccountKey $defaultStorageKey
# Create the default storage container
New-AzStorageContainer -Name $defaultContainerName `
-Context $storageContext
$resourceGroupName = "The resource group that contains the virtual network used with HDInsight"
$clusterNICs = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | where-object {$_.Name -like "*node*"}
$nodes = @()
foreach($nic in $clusterNICs) {
$node = new-object System.Object
$node | add-member -MemberType NoteProperty -name "Type" -value $nic.Name.Split('-')[1]
$node | add-member -MemberType NoteProperty -name "InternalIP" -value $nic.IpConfigurations.PrivateIpAddress
$node | add-member -MemberType NoteProperty -name "InternalFQDN" -value $nic.DnsSettings.InternalFqdn
$nodes += $node
}
$nodes | sort-object Type