title: Terraform Azure AKS - Terraform Plan failing due to "connection refused" errors
body: <p>I am working with in an Azure Environment that was 100% deployed using Terraform (All Networking, Servers, Firewall, Everything). This environment was abandoned for some time but the IAC code was been constantly upgraded against other Environments. Recently I had to run the initial terraform plan that completed successfully. The apply took a long time and it was deleting a lot of objects. Somewhere down the process apply failed. Since then been having issues with subsequent &quot;terraform plan&quot;. Most of the errors were related to AKS so decided to cleanup everything related to AKS.</p>
  <p>I started by disabled any terraform job that would create AKS objects. Now I am to the poing where stuck with a bunch of Error messages:</p>
  <pre><code>null_resource.storage_account_enc_keys[&quot;event_hub&quot;]: Refreshing state... [id=7769823871044950433]
  null_resource.storage_account_enc_keys[&quot;network&quot;]: Refreshing state... [id=4738858682472456831]
  null_resource.storage_account_enc_keys[&quot;ssrs&quot;]: Refreshing state... [id=7895464809071918822]
  null_resource.storage_account_enc_keys[&quot;cdn&quot;]: Refreshing state... [id=6960405350375997435]
  null_resource.storage_account_enc_keys[&quot;webjob&quot;]: Refreshing state... [id=1824168849553984961]
  null_resource.storage_account_enc_keys[&quot;app&quot;]: Refreshing state... [id=4341458091367408638]
  null_resource.storage_account_enc_keys[&quot;media_services&quot;]: Refreshing state... [id=7860082878767368564]
  Error: Get &quot;http://localhost/apis/rbac.authorization.k8s.io/v1/clusterroles/k8s-cluster-reader&quot;: dial tcp 127.0.0.1:80: connect: connection refused
  Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
  Error: Get &quot;http://localhost/apis/rbac.authorization.k8s.io/v1/clusterroles/cluster-writers&quot;: dial tcp 127.0.0.1:80: connect: connection refused
  Error: Get &quot;http://localhost/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/cluster-admins-binding&quot;: dial tcp 127.0.0.1:80: connect: connection refused
  Error: Get &quot;http://localhost/api/v1/namespaces/pod-identity/limitranges/pod-identity&quot;: dial tcp 127.0.0.1:80: connect: connection refused
  Error: Get &quot;http://localhost/api/v1/namespaces/nginx-ingress/limitranges/nginx-ingress&quot;: dial tcp 127.0.0.1:80: connect: connection refused
  Error: Get &quot;http://localhost/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/k8s-cluster-writer-binding&quot;: dial tcp 127.0.0.1:80: connect: connection refused
  Error: Get &quot;http://localhost/api/v1/namespaces/linkerd/limitranges/linkerd&quot;: dial tcp 127.0.0.1:80: connect: connection refused
  
  Terraform Plan Exit Code: 1
  </code></pre>
  <p>Any idea how i can get past this without having to rebuild the environment completely???</p>
  <p>Note: Most reference found only regarding this error points to adding load_config_file = false to the kubernetes provider. This was already in there. Plus my goal is using the next apply to remove anything related to AKS.</p>