Overview: APIM can be setup in multiple regions and incoming request will be routed to the closest APIM endpoint. If there is only 1 APIM region, it is best to ensure the API/App Service/Function is hosted in the same region. With multiple APIM's you can also host a API in the same region. The routing is either done automatically using Azure Front Door or via policy on the APIM.
Monday, 19 October 2020
APIM High Availability and Performance across Regions
WAF Options
- Azure WAF simple in 1 region for a WAF especially with APIM and if you are an Azure customer simple got for an Azure Application Gateway with WAF enabled. DDoS is s separate service that can be integrated before Azure WAF or Azure Firewall. Cheaper per IP SKU option for specific IP adrs.
- Azure Front Door WAF is pretty amazing, Cloudflare is historically the leader with similar functionality. On Microsoft Azure the main two options for WAF are Front Door WAF (Best, most expensive) and Azure Application Gateway WAF.
- Competitor options: Barracuda WAF SaaS Service or Any software firewall KEMP, F5, Check Point, Fortinet/Fortigate, Cloudflare WAF, Akamai, AWS WAF, AWS Network Firewall, Cloud Armor is GCPs WAF I believe, ....
- Check WAF service has protection at least for DDoS, XSS, SQL injection attacks, SSL Termination if you need it, Managed RuleSets.
- AWS WAF is for web traffic (layer 7), there is a separate AWS Shield service that is used for DDos attacks. AFS can be applied at a Application Load Balancer, Amazons API Gateway, and Amazon CloudFront. With AWS WAF you also get Shield (standard free). Shield adds advanced features and the standard version that is always included by default with AWS WAF has monitoring and DDoS protection.
- Barracuda WAF is a SaaS Service that has worked fairly well for me. Has a fair amount of options and rules. Has add-ons like anti-virus scanning.
- Imperva WAF was previously called Incapsula WAF, that provides a SaaS WAF service including Smart DDoS (block dodgy traffic and passes thru good requests), API Security, SQL injections, Xss. Multiple data centers around the world.
- Cloudflare is a Secure access service edge (SASE). Cloudflare provides a WAF service at hundreds of endpoints around the globe (for instance there are 5 Cloudflare endpoints in Australia). WAF functionality like SSL, DDoS (L7), customer rule e.g. rate limiting, OWASP rules applied, "api protection", et al. is done close to the user request (nice low latency) and then if successful it is pushed to the backend.
Last Updated: 2022-03-15
Friday, 9 October 2020
App Insights - Website and API Monitoring
Overview: App Insights has functionality to run scheduled web requests and log the output in App Insights. There are multiple advantages to this including end to end active monitoring of web sites and API's, and keeping the application warm.
Below I show a simple request to my blog (public website) and the results, Azure refers to this test type as a URL Ping test which is basically a URL HTTP GET request.
Wait a few minutes and Refresh to see the results:
- The image above shows a dashboard that can be used to monitor a SaaS applications PaaS Infrastructure.
- It's a good idea to create multiple dashboards and they can show the overview and allow the user to drill into specific areas.
- Internal boards watching key API's, HTTP uptime ping type requests is also a good idea.
Thursday, 1 October 2020
App Insights - Basic Introduction
- All Azure Services can be configured to send service logs to a specific App Insight instance.
- Instrument packages can be added to services to capture logs such as IIS, or background services. You can pull in telemetry from infrastructure into App insights e.g. Docker logs, system events.
- Custom code can also call the App Insight instance to add logging and hook into exceptions handling. There are .NET, Node.JS, Python and other SDK's that should e used to add logging, exception capturing, performance and usage statistics.
"What kinds of data are collected?
The main categories are:
- Web server telemetry - HTTP requests. Uri, time taken to process the request, response code, client IP address.
Session id
. - Web pages - Page, user and session counts. Page load times. Exceptions. Ajax calls.
- Performance counters - Memory, CPU, IO, Network occupancy.
- Client and server context - OS, locale, device type, browser, screen resolution.
- Exceptions and crashes - stack dumps,
build id
, CPU type. - Dependencies - calls to external services such as REST, SQL, AJAX. URI or connection string, duration, success, command.
- Availability tests - duration of test and steps, responses.
- Trace logs and custom telemetry - anything you code into your logs or telemetry."
- Collect: Track infra/PaaS via instrumentation (throughput, speed, response times, failure rates, exceptions etc.), and via SDK (e.g. JavaScript SDK, C#) to add custom logging and tracing. Blue boxes
- Store: Stores the data. Purple Box
- Insights: Alerts, PowerBI, live metrics, REST API. Green Box
Tuesday, 29 September 2020
Secure APIM using AAD B2C
Overview: I have never connected AAD B2C to APIM myself, other on my project teams havde done it so I went thru it and it was super easy.
Followed the instructions:
Postman to validate:
Sunday, 13 September 2020
Building better Software Thoughts
Overview: I see a lot of development teams, and they always seem to have areas they are good at and capabilities teams need improvement on. Key is culture and building a happy team where team members trust and help one another.
Building a culture where teams enjoy code reviews is also key for successful Software projects. To improve software, reviewing various areas not only code reviews are essential. For me, clear requirements are the number 1 factor in improving teams performance.
Companies are getting better at building software; I aim to work on these topics to improve the delivery of software within scrum teams:
- Code Reviews & Peer Reviews (Daily reviews are awesome, should be pretty short and enjoyable not someone trying to show off or hours long)
- Collaboration (Standups, Slack/Teams, Code tools have collaboration built in)
- Documentation & Requirements Reviews
- Better tooling including better CI/CD tooling including static analysis tools
- Unit Testing, automate coding standards, Integration testing, UI Testing, and API testing
- Requirements (Use Stories are clear and Acceptance Criteria)
- Cadence is improving thanks predominately to Agile practices; I like short release cycles (2-3 weeks depending on the team and industry). Changing requirements, indecision kills software projects. Agile helps, but decisive knowledgeable product owners increase the likelihood of the project succeeding.
Benefits of Code, Documentation and Requirement Reviews:
- Improved software quality & product delivery
- Share domain knowledge
- Training team members (useful for onboarding new team members)
- Reduce support and fix costs
- Lower cost & faster development
Options Layering API's on Data Sources - Micrososervices kind of
Hasura takes data sources such as SQL, Postgress & MySQL and converts it into GraphQL API's. SQL Server is in preview. Service is available on Azure and hooks into AAD and AAD B2C. Hasuru looks extremely interesting and useful. Potentially a great time saver.
CDS/DataFelx/Oakdale - Allows for Entity creation and provides REST API's.
SharePoint lists provide HTTP API's for CRUD operations.
REST API's vs GraphQL