Skip to content

Instantly share code, notes, and snippets.

View kunalworldwide's full-sized avatar
🎯
Focusing

Kunal Das kunalworldwide

🎯
Focusing
View GitHub Profile
az synapse workspace firewall-rule create --name devops-build-agent-ip\
--workspace-name synapse-prod --resource-group synapse-prod-rg\
--start-ip-address (Invoke-RestMethod http://ipinfo.io/json | Select -exp ip) \
--end-ip-address (Invoke-RestMethod http://ipinfo.io/json | Select -exp ip)
resource "azurerm_mssql_database" "SQLDatabase" {
name = "SQLDatabase Name"
server_id = azurerm_mssql_server.SQLServer.id
collation = "SQL_collation"
max_size_gb = "SQLDatabase MaxSizeGB"
sku_name = "SQLDatabase SKU"
zone_redundant = "SQLDatabase ZoneRedundant"
}
resource "azurerm_mssql_server" "SQLServer" {
name = "SQLServer Name"
resource_group_name = azurerm_resource_group.RG.name
location = azurerm_resource_group.RG.location
version = "SQLServer Version"
administrator_login = "SQLServer AdministratorLogin"
administrator_login_password = random_string.SQLAdminPassword.result
minimum_tls_version = "SQLServer TLS Version"
}
resource "random_string" "SQLAdminPassword" {
length = 5
special = true
min_upper = 2
min_numeric = 2
min_special = 2
}
resource "azurerm_storage_container" "DataLakeContainer" {
for_each = "DataLake Container"
name = each.key
storage_account_name = azurerm_storage_account.DataLake.name
container_access_type = "private"
}
resource "azurerm_storage_account" "DataLake" {
name = "DataLake Name"
resource_group_name = azurerm_resource_group.RG.name
location = azurerm_resource_group.RG.location
account_tier = "DataLake Tier"
account_replication_type = "DataLake Replication"
is_hns_enabled = true
min_tls_version = "DataLake TLSVersion"
network_rules {
resource "azurerm_subnet_network_security_group_association" "private" {
subnet_id = azurerm_subnet.DatabricksSubnetPrivate.id
network_security_group_id = azurerm_network_security_group.DatabricksNSG.id
}
resource "azurerm_subnet_network_security_group_association" "public" {
subnet_id = azurerm_subnet.DatabricksSubnetPublic.id
network_security_group_id = azurerm_network_security_group.DatabricksNSG.id
}
resource "azurerm_subnet" "DatabricksSubnetPrivate" {
name = "VirtualNetwork PrivateSubnet Name"
resource_group_name = azurerm_resource_group.RG.name
virtual_network_name = azurerm_virtual_network.DatabricksVnet.name
address_prefixes = ["VirtualNetwork PrivateSubnet CIDR"]
delegation {
name = "Microsoft.Databricks.workspaces"
service_delegation {
name = "Microsoft.Databricks/workspaces"
resource "azurerm_network_security_group" "DatabricksNSG" {
name = "VirtualNetwork NSG Name"
resource_group_name = azurerm_resource_group.RG.name
location = azurerm_resource_group.RG.location
}