Dependencies Not Working

Attempting to create 3 resources:

resource “azurerm_resource_group” “res-0”

resource “azurerm_service_plan” “res-21”

resource “azurerm_windows_function_app” “res-22”

res-21 depends on res-0
res-22 depends on res-21

When running plan or apply I get an error that res-0 (Resource Group) cannot be found:

Error: could not read new Service Plan to check tier Service Plan: (Serverfarm Name “ASP-pilotdeveussecmsgrg-9b2b” / Resource Group “dss-eus-dmz-secmsg-rg”): web.AppServicePlansClient#Get: Failure responding to request: StatusCode=404 – Original Error: autorest/azure: Service returned an error. Status=404 Code=“ResourceGroupNotFound” Message=“Resource group ‘dss-eus-dmz-secmsg-rg’ could not be found.”

│ with azurerm_windows_function_app.res-22,
│ on main.tf line 151, in resource “azurerm_windows_function_app” “res-22”:
│ 151: resource “azurerm_windows_function_app” “res-22” {

Shouldn’t it be skipping that since the resource group is in the dependency chain?