This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string ClientId = "guid-from-portal"; | |
string resource = "00000002-0000-0000-c000-000000000000"; | |
public class DCR | |
{ | |
public string device_code { get; set; } | |
public string message { get; set; } | |
public string user_code { get; set; } | |
public string interval { get; set; } | |
public string expires_in { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet] | |
public async Task<IActionResult> LoginADAL() | |
{ | |
AuthenticationContext ctx = null; | |
ctx = new AuthenticationContext("https://login.microsoftonline.com/common"); | |
DeviceCodeResult codeResult = ctx.AcquireDeviceCodeAsync(resource, ClientId).Result; | |
DCR dcr = new DCR { message = codeResult.Message, | |
device_code = codeResult.DeviceCode, | |
expires_in = codeResult.ExpiresOn.ToString(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1beta1 | |
kind: Deployment | |
metadata: | |
name: api-playground | |
spec: | |
template: | |
metadata: | |
labels: | |
app: api-playground | |
spec: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: external-dns | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
kind: ClusterRole | |
metadata: | |
name: external-dns | |
rules: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: api-playground-ingress | |
annotations: | |
nginx.ingress.kubernetes.io/rewrite-target: / | |
kubernetes.io/tls-acme: 'true' | |
spec: | |
tls: | |
- hosts: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1beta1 | |
kind: Deployment | |
metadata: | |
name: api-playground | |
spec: | |
template: | |
metadata: | |
labels: | |
app: api-playground | |
spec: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM microsoft/aspnetcore-build:2.0 AS build-env | |
WORKDIR /app | |
# Copy csproj and restore as distinct layers | |
COPY *.csproj ./ | |
RUN dotnet restore | |
# Copy everything else and build | |
COPY . ./ | |
RUN dotnet publish -c Release -o out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: StorageClass | |
apiVersion: storage.k8s.io/v1 | |
metadata: | |
name: azurefile | |
provisioner: kubernetes.io/azure-file | |
parameters: | |
storageAccount: k8sazurefiles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: azurefile | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
storageClassName: azurefile | |
resources: | |
requests: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spec: | |
containers: | |
- name: myfrontend | |
image: nginx | |
volumeMounts: | |
- mountPath: "/mnt/azure" | |
name: volume | |
volumes: | |
- name: volume | |
persistentVolumeClaim: |