awacke1 commited on
Commit
ae53587
ยท
1 Parent(s): 461f956

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +130 -0
app.py ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # Azure Container Apps
3
+ 1. ๐Ÿ‘ฅ Users
4
+ - ๐Ÿ“ฅ Inbound Traffic
5
+
6
+ 2. ๐ŸŒ Load Balancer w Public IP
7
+ - ๐Ÿ•ธ๏ธ Virtual Network
8
+ - ๐Ÿ”’ Private Endpoints
9
+ - ๐Ÿ“ฆ External Container App env w Ingress IP restrictions
10
+
11
+ 3. ๐Ÿ”’ Private Endpoints
12
+ - ๐Ÿ—๏ธ Key Vault
13
+ - ๐Ÿ›ข๏ธ Container Registry
14
+ - ๐Ÿš€ Cache for REDIS
15
+ - ๐Ÿ’พ Storage
16
+ - ๐Ÿš Service Bus
17
+
18
+ 4. ๐Ÿ“ค Outbound Traffic
19
+ - ๐Ÿ”ฅ Firewall
20
+ - ๐Ÿ—บ๏ธ Route Table
21
+
22
+
23
+ ## ๐ŸŒ Azure Container Apps - Outline
24
+ 1. ๐Ÿ“ฆ Container Apps Overview
25
+ - ๐ŸŒŸ ACA is serverless microservices mashup of Open Source:
26
+ 1. ๐Ÿณ Kubernetes: Container
27
+ 2. ๐Ÿš€ Dapr: Runtime and API
28
+ 3. ๐Ÿ“ˆ KEDA: Kube based autoscaler
29
+ 4. ๐Ÿ›ก๏ธ Envoy: Proxy w Endpoint SSL
30
+ - ๐Ÿ” Service Discovery
31
+ - ๐Ÿšฆ Traffic Splitting
32
+ - ๐Ÿ“Š Event driven scaling based on traffic
33
+ - ๐Ÿ“ฎ Event source queues
34
+ - โฌ‡๏ธ Scales down to zero
35
+ - ๐Ÿ”„ Long running processes and background tasks
36
+ 2. ๐ŸŒ Environment Internal vs External
37
+ - ๐ŸŒ External: Public VIP
38
+ - ๐Ÿ”’ Internal: VIP and ILB
39
+ 3. ๐Ÿ—๏ธ Infrastructure w/ Azure Bicep
40
+ 4. โš–๏ธ Load Balancing Options
41
+
42
+
43
+
44
+
45
+ # ๐ŸŒ Azure Bicep vs ๐Ÿ—๏ธ HashiCorp Terraform
46
+
47
+ ## Overview
48
+ - Azure Bicep
49
+ - ๐ŸŽฏ Domain-specific language (DSL) for deploying Azure resources
50
+ - ๐Ÿ’ผ Developed and maintained by Microsoft
51
+ - ๐ŸŒ Azure-centric; specifically designed for Azure Resource Manager (ARM) templates
52
+ - HashiCorp Terraform
53
+ - ๐ŸŽฏ Open-source infrastructure as code (IaC) tool
54
+ - ๐Ÿ’ผ Developed and maintained by HashiCorp
55
+ - ๐Ÿข Multi-cloud and multi-provider support
56
+
57
+ ## Language and Syntax
58
+ - Azure Bicep
59
+ - ๐Ÿ“ Easier, simplified syntax compared to ARM templates
60
+ - ๐Ÿš€ Transpiles to ARM templates
61
+ - HashiCorp Terraform
62
+ - ๐Ÿ“ HashiCorp Configuration Language (HCL); more complex syntax than Bicep
63
+ - ๐Ÿ—‚๏ธ Uses provider-specific resource definitions
64
+
65
+ ## Provider Support
66
+ - Azure Bicep
67
+ - ๐Ÿ”’ Limited to Azure services and resources
68
+ - HashiCorp Terraform
69
+ - ๐ŸŒฉ๏ธ Supports multiple cloud providers (e.g., AWS, GCP, Azure) and non-cloud services
70
+ - ๐Ÿ“ฆ Extensible through custom providers
71
+
72
+ ## Community and Ecosystem
73
+ - Azure Bicep
74
+ - ๐ŸŒฑ Growing community focused on Azure resources
75
+ - ๐Ÿ“š Limited to Azure documentation and resources
76
+ - HashiCorp Terraform
77
+ - ๐ŸŒณ Mature and established community and ecosystem
78
+ - ๐Ÿ“š Extensive documentation and resources for various cloud providers and platforms
79
+
80
+ ## Conclusion
81
+ - Azure Bicep is best suited for organizations and developers primarily focused on Azure resources with a need for a simple, Azure-centric IaC solution.
82
+ - HashiCorp Terraform is ideal for organizations and developers with multi-cloud or multi-provider requirements, as it offers greater flexibility and extensibility across different platforms.
83
+
84
+
85
+ # ๐Ÿ“ฅ Ingress vs Egress
86
+
87
+ 1. ๐Ÿ“ฅ Ingress
88
+ - ๐ŸŒ External Traffic
89
+ - Incoming traffic from users, clients, or other services outside the network
90
+ - Accessing resources within the network or system (e.g., API, web services)
91
+ - ๐Ÿ”’ Internal Traffic
92
+ - Communication between components within the network or system (e.g., microservices)
93
+ - Typically restricted access for improved security
94
+
95
+ 2. ๐Ÿ“ค Egress
96
+ - ๐ŸŒ External Traffic
97
+ - Outgoing traffic from the network or system to users, clients, or other services
98
+ - Sending responses or data to external entities
99
+ - ๐Ÿ”’ Internal Traffic
100
+ - Communication between components within the network or system (e.g., microservices)
101
+ - Typically restricted access for improved security
102
+
103
+ For Ingress: Azure Container Apps supports HTTPS and TCP types of ingress.
104
+
105
+ With HTTPS ingress enabled container apps support TLS, HTTP/1.1 and 2, Websocket, gRPC. TLS1.2 is used for HTTPS. Endpoints expose port 80, 443. 80 is redirected to 443. App accessed on FQDN. Request timeout is 240 seconds.
106
+
107
+ FrontDoor app delivery net provides global load balanceand site acceleration similar to L7. Available in Std and Premium.
108
+
109
+
110
+
111
+
112
+ # Terraform Import:
113
+
114
+ ![image](https://user-images.githubusercontent.com/30595158/231140616-a6089091-e195-451a-95e5-54ea3c94fe80.png)
115
+
116
+ Usage: terraform import ADDR ID
117
+
118
+
119
+ # Azure Container Registry
120
+ Admin user - enable to access via CLI
121
+
122
+ Name and Resource Group
123
+ Location (Central) -
124
+
125
+ # Github Actions YAML:
126
+
127
+ 1. Azure Build Docker Image, Push ACR
128
+ 2. Azure Container App Deploy
129
+ 3. Dockerfile (Image Push)
130
+