Hello sir, if we want to provision postgresql flexible server on azure portal with Microsoft intra authentication only , so how to enable Microsoft intra authentication, could you please help me out
Sure, here is a basic Terraform code to create a PostgreSQL instance in Azure: provider "azurerm" { features {} } resource "azurerm_resource_group" "rg" { name = "my-resource-group" location = "East US" } resource "azurerm_postgresql_server" "pg" { name = "my-postgresql-server" location = azurerm_resource_group.rg.location resource_group_name = azurerm_resource_group.rg.name sku_name = "B_Gen5_1" storage_mb = 5120 backup_retention_days = 7 administrator_login = "myadminlogin" administrator_login_password = "H@Sh1CoR3!" } resource "azurerm_postgresql_database" "pgdb" { name = "mydatabase" server_name = azurerm_postgresql_server.pg.name resource_group_name = azurerm_resource_group.rg.name charset = "UTF8" collation = "English_United States.1252" } resource "azurerm_postgresql_firewall_rule" "fwrule" { name = "AllowMyIP" resource_group_name = azurerm_resource_group.rg.name server_name = azurerm_postgresql_server.pg.name start_ip_address = "1.2.3.4" end_ip_address = "1.2.3.4" } This Terraform code creates a new PostgreSQL server in Azure, a database within the server, and a firewall rule to allow traffic from a specific IP address. You can customize the code to meet your specific requirements, such as using a different SKU or storage configuration, adding additional databases or firewall rules, and so on. Note that you will need to have the azurerm provider installed and authenticated with your Azure account to use this code. You can also add more advanced configuration options, such as enabling high availability or creating read replicas, by referring to the Terraform documentation and Azure documentation.
superb learning. Thanks Bro!
Glad to hear that
Very Nice all videos.
My Pleasure :)
Hello sir, if we want to provision postgresql flexible server on azure portal with Microsoft intra authentication only , so how to enable Microsoft intra authentication, could you please help me out
Hi perfect, could you please share the git repo for this postgresql setup.
Sure, here is a basic Terraform code to create a PostgreSQL instance in Azure:
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "rg" {
name = "my-resource-group"
location = "East US"
}
resource "azurerm_postgresql_server" "pg" {
name = "my-postgresql-server"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
sku_name = "B_Gen5_1"
storage_mb = 5120
backup_retention_days = 7
administrator_login = "myadminlogin"
administrator_login_password = "H@Sh1CoR3!"
}
resource "azurerm_postgresql_database" "pgdb" {
name = "mydatabase"
server_name = azurerm_postgresql_server.pg.name
resource_group_name = azurerm_resource_group.rg.name
charset = "UTF8"
collation = "English_United States.1252"
}
resource "azurerm_postgresql_firewall_rule" "fwrule" {
name = "AllowMyIP"
resource_group_name = azurerm_resource_group.rg.name
server_name = azurerm_postgresql_server.pg.name
start_ip_address = "1.2.3.4"
end_ip_address = "1.2.3.4"
}
This Terraform code creates a new PostgreSQL server in Azure, a database within the server, and a firewall rule to allow traffic from a specific IP address. You can customize the code to meet your specific requirements, such as using a different SKU or storage configuration, adding additional databases or firewall rules, and so on.
Note that you will need to have the azurerm provider installed and authenticated with your Azure account to use this code. You can also add more advanced configuration options, such as enabling high availability or creating read replicas, by referring to the Terraform documentation and Azure documentation.