Skip to content

Instantly share code, notes, and snippets.

name: Python CI
on:
[push]
env:
AZURE_WEBAPP_NAME: anm-test # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
jobs:
<policies>
<inbound>
<base />
<validate-jwt header-name="Authorization" failed-validation-httpcode="401" failed-validation-error-message="Unauthorized">
<issuer-signing-keys>
<key>123456781234567812345678</key>
</issuer-signing-keys>
<required-claims>
<claim name="admin" match="any">
<value>true</value>
{
"sub": "1234567890",
"name": "Akash Mahale",
"admin" : true,
"exp": 1862842300
}
@anm237
anm237 / app.py
Last active July 11, 2022 06:01
Flask Application be deployed on Azure App Service
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
@app.route('/anm')
def anm():
return 'Hello, Anm!'
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: web-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/whitelist-source-range: 27.4.4.187/32 #the IP to be allowed
spec:
backend:
serviceName: web #name of the NodePort service
@anm237
anm237 / service.yaml
Created July 15, 2020 13:01
service file referring values file
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Values.Svc.namespace }}
name: {{ .Values.Svc.label }}
spec:
type: LoadBalancer
ports:
- port: {{ .Values.Svc.port }}
targetPort: {{ .Values.Svc.target_port }}
@anm237
anm237 / deployment.yaml
Created July 15, 2020 12:57
deployment file referring values file
apiVersion: apps/v1beta1
kind: Deployment
metadata:
namespace: {{ .Values.Dep.namespace }}
name: {{ .Values.Dep.label }}
spec:
replicas: {{ .Values.Dep.replicaCount }}
revisionHistoryLimit: 10
strategy:
rollingUpdate:
@anm237
anm237 / values.yaml
Last active July 15, 2020 12:53
Values file conatin key values
appVersion: v1
Dep:
namespace: default
label: helm-demo
replicaCount: 1
image:
repo: anm237/helloworldnode
tag: v1
resources:
@anm237
anm237 / Chart.yaml
Created July 15, 2020 12:49
Chart file for helm
apiVersion: v1
description: A Helm chart based deplyoment for GKE
name: helm-demo
version: v1