Create Docker Picture Of Azure Logic App Normal And Deploy In Azure Kubernetes Service
This text provides you an outline of,
- How one can create Docker Picture of Azure Logic app
- How one can push picture into azure Container Registry (ACR) and
- How one can deploy ACR picture into AKS
Pre-requisites
- Docker for Desktop
- Docker extension for VS code
- Logic App (Normal) Extension
- C# Extension
- Azure Account
- Stoarge account
Create a stateless workflow domestically in Visual Studio Code
I’m utilizing VS Code for growing Azure Logic App Normal.
It should create a skeleton of workflow
UseDevelopmentStorage=true property lets us run logic apps domestically utilizing Azure Storage Emulator.
Proper click on on the workflow.json file and choose open in Designer to view the workflow designer
Choose Run->Begin Debugging or F5 to start out the logic apps domestically, lastly the execution shows the next to point out the logic apps is up and operating.
Add a docker file to your mission as beneath named “DockerFile”.
FROM mcr.microsoft.com/azure-functions/node:3.0
ENV AzureWebJobsStorage DefaultEndpointsProtocol=<BlobStorageConnectionString>
ENV AzureWebJobsScriptRoot=/house/web site/wwwroot AzureFunctionsJobHost__Logging__Console__IsEnabled=true FUNCTIONS_V2_COMPATIBILITY_MODE=true
ENV WEBSITE_HOSTNAME localhost
ENV WEBSITE_SITE_NAME weatherforecast
ENV AZURE_FUNCTIONS_ENVIRONMENT Growth
COPY . /house/web site/wwwroot
And modify the native.settings.json to have the storage account because the
Construct the docker container picture by utilizing the docker file by operating the beneath command
Be certain to tag like .azurecr.ioimagename to push picture into ACR
docker construct --tag <ImageName> .
Run the container domestically by utilizing the beneath command
docker run -p 8080:80 <ImageName>
You’ll be able to see photos and cases in Docker extension
Navigate to the Azure storage account offered within the docker definition and open blob containers. You will note the next folders
Push Docker Picture to Azure Container Registry
Create Azure Container registry manually on Azure Portal
Allow Entry key to login into ACR
This helps to login into acr and push photos
Login into Docker Registry
docker login laacr.azurecr.io
Tag and Push Picture to ACR
Use docker tag to create an alias of the picture with the absolutely certified path to your registry.
docker tag laimage laacr.azurecr.io/laimage
docker push laacr.azurecr.io/laimage
Create Azure Kubernetes cluster – AKS
Hyperlink ACR with AKS
az aks replace -n laaks -g acr --attach-acr laacr
Deploy Logic App Picture from ACR into AKS
Go to AKS – >
- apiVersion: v1
sort: Namespace
metadata:
identify: azure-la
spec:
finalizers:
- kubernetes
- apiVersion: apps/v1
sort: Deployment
metadata:
identify: azure-la-front
namespace: azure-la
spec:
replicas: 1
selector:
matchLabels:
app: azure-la-front
template:
metadata:
labels:
app: azure-la-front
spec:
nodeSelector:
beta.kubernetes.io/os: linux
containers:
- identify: azure-la-front
picture: laacr.azurecr.io/laimage
assets:
requests:
cpu: 100m
reminiscence: 128Mi
limits:
cpu: 250m
reminiscence: 256Mi
ports:
- containerPort: 80
env:
- identify: AzureWebJobsStorage
worth: <<connectionstring>>
- apiVersion: v1
sort: Service
metadata:
identify: azure-la-front
namespace: azure-la
spec:
sort: LoadBalancer
ports:
- port: 80
selector:
app: azure-la-front
Verify if app service is deployed
Fetch logic app URL utilizing callback URL
Fetch grasp key from blob storage which is able to assist in fetching callback URL
Fetch callback URL utilizing URL
http://20.76.240.221:80/runtime/webhooks/workflow/api/administration/workflows/Stateful1/triggers/handbook/listCallbackUrl?api-version=2020-05-01-preview&code=
You need to use postman to check logic app
Logic App URL – http://20.76.240.221:80/api/Stateful1/triggers/handbook/invoke?api-version=2020-05-01-preview&sp=%2Ftriggerspercent2Fmanualpercent2Frun&sv=1.0&sig=