Why is Azure's naming convention a nightmare for Terraform? A developer using Terraform to provision Microsoft Azure AI Foundry resources reports difficulty deploying a GPT-4o model, citing unclear naming conventions and uncertainty about which resource block to use. The developer asks whether `azurerm_cognitive_deployment` is appropriate or if a newer resource is needed, and whether the deployment automatically creates the endpoint for use with a LangChain agent. Why is Azure's naming convention a nightmare for Terraform? LangChain /en/tags/langchain/ agent, and I've hit a wall with the Microsoft Foundry setup. The goal was simple: provision a Foundry hub and a GPT-4o deployment via code so I don't have to click around the portal like it's 2010. Instead, I spent my morning staring at documentation that feels like it was written in riddles. I managed to get the hub and project standing, but the actual model deployment is where things fall apart. If you've ever tried to "wire up" an LLM in Azure via Terraform, you know the pain of wondering whether you need a specific azurerm resource or if you have to resort to azapi because the official provider is lagging behind the actual API. Here is the broken state of my config: provider "azurerm" { features {} } resource "azurerm ai foundry" "hub" { name = "my-foundry-hub" resource group name = azurerm resource group.rg.name location = azurerm resource group.rg.location } resource "azurerm ai foundry project" "project" { name = "my-foundry-project" location = azurerm ai foundry.hub.location ai services hub id = azurerm ai foundry.hub.id } This is where the magic stops and the frustration begins I'm missing the actual GPT-4o deployment block The real headache is that I can't figure out if the deployment resource itself exposes the endpoint or if there's some hidden "connection" resource I'm missing to make this callable from an external AI workflow. I'm basically trying to build a production-ready deployment from scratch, but I feel like I'm guessing. If you've actually succeeded in doing a deep dive into this, I have two specific questions: 1. Which resource block actually works for GPT-4o? Is azurerm cognitive deployment the move here, or is that too legacy for the new Foundry Hub structure? 2. Does the deployment automatically create the endpoint, or am I supposed to be hunting for a separate resource to get the API key and URL for my LangChain agent? I'm hoping for a practical tutorial or even just a snippet that doesn't result in a ResourceNotFound error. If anyone has a working deployment pattern that doesn't involve praying to the Azure gods, please share. Next Unsloth Desktop finally lets us train models locally without a → /en/threads/5937/