Terraform’s `.tfstate` file is gold. If it’s lost or corrupted, Terraform cannot track what resources exist. You **must** store state remotely with locking. Azure Backend Configuration State Locking Azure Blob’s native lease mechanism prevents concurrent writes. Key Takeaways Never commit `.tfstate` to Git. Enable **soft delete** on the storage account to recover corrupted state. Use […]
Read more →Testing .NET 6 Applications: Integration Testing with WebApplicationFactory
Unit tests are not enough. Integration tests verify your app works end-to-end, including middleware, dependency injection, and database logic. `WebApplicationFactory` spins up an in-memory test host. Setup Customizing Services Replace the real database with an in-memory one. Key Takeaways Use **Testcontainers** (covered earlier) for real SQL testing. Check HTTP status codes, response bodies, and headers.
Read more →Kubernetes 1.22: API Removals
Kubernetes 1.22 removed multiple v1beta1 APIs that had been deprecated since 1.16. If your cluster upgraded without deploying updated manifests, things likely broke. Key Removals Old API New API extensions/v1beta1 Ingress networking.k8s.io/v1 Ingress rbac.authorization.k8s.io/v1beta1 rbac.authorization.k8s.io/v1 admissionregistration.k8s.io/v1beta1 admissionregistration.k8s.io/v1 How to Detect Key Takeaways Use **kubent** (kube no trouble) to scan for deprecated APIs before upgrading. Always […]
Read more →Designing for Nullability in C#
With Nullable Reference Types (NRTs) enabled by default in .NET 6 templates, designing APIs that clearly communicate nullability is no longer optional—it’s expected. Enabling NRTs Guard Clauses Use the new .NET 6 helper to throw if null. Key Takeaways Use `string?` to explicitly mark nullable strings. Use `!` (null-forgiving operator) sparingly—only when you truly know […]
Read more →.NET 6: Minimal APIs Explained
Minimal APIs are the biggest shift in ASP.NET Core since version 1.0. They remove the MVC ceremony (Controllers, Actions, Filters) in favor of a fluent lambda-based syntax. The Code Is it just for tiny apps? No. Performance is technically better than MVC (fewer allocations, no Filter Pipeline overhead). However, organization becomes the challenge. You don’t […]
Read more →GraphQL vs gRPC vs REST: The 2021 Guide
Choosing the right API paradigm is critical. It’s not about which is “better,” but which fits the consumption model. Decision Matrix Feature REST gRPC GraphQL Protocol HTTP/1.1 HTTP/2 HTTP/1.1 or 2 Data Format JSON Protobuf (Binary) JSON Use Case Public APIs Internal Microservices Mobile/Frontend BFF Browser Support Native Requires Proxy (gRPC-Web) Native Why GraphQL for […]
Read more →