I'm having an existing Vnet. I tried to follow approach from the below link. created two subnets(public and private) and NSGs and NSG Associations through terraform code and then use the custom_parameters block to provide the Network id and private_subnet_network_security_group_association_id. I'm deploying the code from Azure DevOps. It's throwing me errors:
creating/updating Workspace (Subscription: "xxxx-xxxx-xxx-xxx" Resource Group Name: "rg-xxxxx-test" Workspace Name: "xxxx-test-workspace"): polling after CreateOrUpdate: polling failed: the Azure API returned the following error: Status: "GatewayAuthenticationFailed" Code: "" Message: "Failed to prepare subnet 'xxxx-test-private'. Please try again later. Error details: 'Gateway authentication failed for 'Microsoft.Network'.
any clue on the above error?
I tried the below terraform code to create two subnets
resource "azurerm_subnet" "public" {
name = "${var.dbname}-public-subnet"
resource_group_name = data.azurerm_resource_group.qa.name
virtual_network_name = data.azurerm_virtual_network.vnet.name
address_prefixes = ["1.2.3.4/24"]
delegation {
name = "databricks_public"
service_delegation {
name = "Microsoft.Databricks/workspaces"
}
}
}
resource "azurerm_network_security_group" "nsg" {
name = "${var.dbname}-qa-databricks-nsg"
resource_group_name = data.azurerm_resource_group.qa.name
location= data.azurerm_resource_group.qa.location
}
resource "azurerm_subnet_network_security_group_association" "nsga_public" {
network_security_group_id = azurerm_network_security_group.nsg.id
subnet_id = azurerm_subnet.public.id
}
and the custom_parameter block in databricks workspace creation.
custom_parameters {
public_subnet_name = azurerm_subnet.public.name
public_subnet_network_security_group_association_id = azurerm_subnet_network_security_group_association.nsga_public.id
private_subnet_name = azurerm_subnet.private.name
private_subnet_network_security_group_association_id = azurerm_subnet_network_security_group_association.nsga_private.id
virtual_network_id = data.azurerm_virtual_network.vnet.id
}
My subnets are getting created but while creation of workspace it is failing with errors.
The error you're encountering, "GatewayAuthenticationFailed", typically indicates a problem with the network gateway, such as the Virtual Network Gateway or the Application Gateway within the Azure environment. This could be due to incorrect configuration, lack of permissions, or a failure in the service itself.
you're setting up subnets and associating them with a Network Security Group (NSG). The code structure appears to be correct for creating a subnet and an NSG, but there are a few points to consider:
My terraform configuration:
main.tf:
Output: