Skip to content

Instantly share code, notes, and snippets.

View tomkerkhove's full-sized avatar
🤓
Writing bugs faster than his own shadow.

Tom Kerkhove tomkerkhove

🤓
Writing bugs faster than his own shadow.
View GitHub Profile
using Arcus.WebApi.Logging;
using Microsoft.AspNetCore.Mvc;
[ApiController]
[Route("/api/v1/health")]
public class HealthController : ControllerBase
{
[HttpGet]
[ExcludeRequestTracking]
public IActionResult Get()
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"AppService.Kubernetes.Environment.Id" : {
"type": "string",
"defaultValue": "/subscriptions/c1537527-c126-428d-8f72-1ac9f2c63c1f/resourceGroups/codit-preview-project-lima-us-east/providers/Microsoft.Web/kubeEnvironments/codit-project-lima-kube"
},
"AppService.Plan.Name": {
"type": "string",
az k8s-extension create -g $groupName --name $extensionName --cluster-type connectedClusters -c $clusterName --extension-type 'Microsoft.Web.Appservice' --release-train stable --auto-upgrade-minor-version true --scope cluster --release-namespace $appServiceNamespace --configuration-settings "Microsoft.CustomLocation.ServiceAccount=default" --configuration-settings "appsNamespace=${appServiceNamespace}" --configuration-settings "clusterName=${kubeEnvironmentName}" --configuration-settings "loadBalancerIp=${staticIp}" --configuration-settings "buildService.storageClassName=default" --configuration-settings "buildService.storageAccessMode=ReadWriteOnce" --configuration-settings "customConfigMap=${appServiceNamespace}/kube-environment-config" --configuration-settings "envoy.annotations.service.beta.kubernetes.io/azure-load-balancer-resource-group=${aksClusterGroupName}" --configuration-settings "logProcessor.appLogs.destination=log-analytics" --configuration-protected-settings "logProcessor.appLogs.logAnalyticsCo
$extensionId = az k8s-extension show –cluster-type connectedClusters -c $clusterName -g $groupName –name $extensionName –query id -o tsv
$customLocationId = az customlocation show -g $groupName -n $customLocationName --query id -o tsv
az webapp create --resource-group $groupName --name codit-project-lima-web-app-bacon-api --custom-location $customLocationId --deployment-container-image-name ghcr.io/tomkerkhove/bacon-api --plan $appPlanName
az appservice plan create --name $appPlanName --resource-group $groupName --custom-location $customLocationId --is-linux --per-site-scaling
az appservice kube create -g $groupName -n $kubeEnvironmentName --custom-location $customLocationId --static-ip "$staticIp"
az customlocation create -g $groupName -n $customLocationName --host-resource-id $connectedClusterId --namespace $appServiceNamespace -c $extensionId
az connectedk8s connect --name $clusterName –resource-group $groupName