- GitHub account and repository.
- Azure subscription.
- A Service Principal with Contributor role at subscription scope. This is the identity that will be used to access the Azure resources from GitHub Action.
- If you don't have a Service Principal, create one by following these steps.
- Deploy Azure Kubernetes Service, your can reuse this project and run GitHub Action called "Depoy AKS Env". Optional, you can also depoy this PoC on:
- EKS: "Deploy EKS Env"
- GKE: "Deploy GKE Env"
- Create an Azure Storage Account and get Connection String.
az storage account create --name <account-name> --resource-group <storage-resource-group> --location eastus --sku Standard_LRS --kind StorageV2
az storage account show-connection-string --name <account-name> --resource-group <storage-resource-group>
- Encode your "Azure Storage Account Connection String" o Create a Secret in Kubernetes called "storage-cs" and key "csc" with your "Azure Storage Account Connection String" .
echo '<<your_azure-storage-account_connectionstring>>' | based64
kubectl create secret generic storage-cs --dry-run=client -o yaml --from-literal=scs='<<your_azure-storage-account_connectionstring>>'
- Update YAML files called "logicapp-pod.yaml" with your encoded "Azure Storage Account Connection String" in line 8.
- Create Secrets refered in Gihub Actions called "build-push-image.yml"
- Build a Push Image to Container Registry (ACR), reuse GitHub Workflow called "build-push-image.yml"
- Optional, you can deploy the image to Docker Hub. You can reuse this Github Workflow to do it. "build-push-image-dockerhub.yml"
- Deploy Logic App on Kubernetes using YAML file called "logicapp-pod.yaml"
- Validate deployment, get ip address assignet to deployment and check if logic app is deployed.
kubectl get service -n logicapp
curl -I <<your_ip-address>>
-
Open Postmand and fetch logic app URL using callback URL
- Fetch master key from your Azure Blob Storage in container name "azure-webjobs-secrets" and file name "host.json", this key will help in fetching callback URL, Image reference.
- http://<<your_ip-address>>:80/runtime/webhooks/workflow/api/management/workflows/oapistaless/triggers/manual/listCallbackUrl?api-version=2020-05-01-preview&code=<<your_logicapp-master-key>>
-
Copy and Paste in your Bowser value from postman results (line 2). This this an example of url value:
- http://localhost:80/api/{your logic app workflow name}/triggers/manual/invoke?api-version=2020-05-01-preview&sp={value for sp}&sv={value for sv}&sig={value for sig}
- http://<<your_ip-address>>:80/api/oapistaless/triggers/manual/invoke?api-version=2020-05-01-preview&sp={value for sp}&sv={value for sv}&sig={value for sig}
-
A random number will be displayed in your browser.
-
Test and Enjoy PoC
You can learn more about Logic Apps here:
- What is Azure Logic Apps?
- Microsoft Learn: Build automated workflows to integrate data and apps with Azure Logic Apps
- New hosting options for Azure Logic Apps
- Build your first Single Tenant Logic App (Standard) with VS Code
- Azure Tips and Tricks: How to run Logic Apps in a Docker container
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.