Azure Logic Apps Resources

repository·master·Indexed 19 days ago

https://github.com/azure/logicapps

A collection of resources for Azure Logic Apps, including custom connector samples, workflow templates, and enterprise adoption whitepapers. It provides detailed guides for implementing a 'Chat with Your Data' project using Azure OpenAI and AI Search, deploying Arc-enabled Logic Apps to Kubernetes clusters, and setting up single-tenant local development and CI/CD pipelines via Azure DevOps and ARM templates.

Tokens
13.3K
Snippets
24
Records
70
Agent score
64%

What's inside azure-logicapps

  1. Overview of Logic Apps Preview features

    master

    The Logic Apps Preview enables local development and offers several key capabilities:

    • Local Development: Run workflows on your local machine.
    • VS Code Designer: Support for designing workflows via a VS Code add-in.
    • Docker Support: Ability to run workflows in Docker containers.
    • Operating Modes: Choice between stateless or stateful operating modes.
    • Built-in Connectors: Access to additional 'built-in' connectors.
    • Runtime Support: Runs on the Azure Functions runtime with support for deployment to Azure App Service.
  2. Build a Social Dashboard Lab Overview

    master
    This lab demonstrates how to build a real-time social dashboard using Azure Serverless technologies. The workflow listens for specific search terms on Twitter, uses Azure Text Analytics to detect sentiment and key phrases, processes those phrases via an Azure Function, and streams the resulting data into a Power BI dashboard for real-time visualization.
  3. Explore Azure Logic Apps custom connector samples

    master

    The repository contains samples of custom connectors that can be used in Azure Logic Apps. These samples include deployment templates that can be used to provision resources directly via the Azure Portal.

    Key connector samples available:

    • Azure VM: Provides actions such as Start, Stop, Deallocate, and Restart.
    • Microsoft Graph: Provides actions such as Add User, Assign Manager, and Assign License.
  4. Understand the Logic Apps DevOps Pipeline structure

    master

    The sample project demonstrates a split pipeline approach to separate Infrastructure as Code (IaC) from application logic:

    • IaC Pipeline (IaC_deploy.yml): Deploys infrastructure (Logic Apps, App Service Plans, Storage, API Connections) into their respective resource groups, sets access policies, and updates Logic App app settings with connection credentials.
    • Application Pipeline (logicapp_deploy.yml): Builds and deploys the Logic App logic itself.

    Workflow Patterns:

    • Infrastructure Change: Pushing changes to the ARM folder or manually triggering IaC_deploy updates the environment and then triggers the application deployment.
    • Logic Change: Pushing changes to the logic folder only triggers the application deployment, avoiding unnecessary infrastructure updates.
    • Multi-environment: To deploy to new environments, create new parameter files for the IaC deployment and update the azure-specific parameters.json for the Logic App.
  5. Understand the Logic Apps template structure

    master

    A Logic Apps template is a JSON object containing metadata and workflow definitions. The top-level structure includes:

    PropertyDescription
    idThe template ID, must end with a GUID (e.g., "/providers/Microsoft.Logic/galleries/public/templates/{guid}")
    nameThe same GUID used in the id
    typeMust be Microsoft.Logic/galleries/templates
    properties.authorThe name of the template author
    properties.categoryNamesCategories for the template. Valid values: "enterprise_integration", "schedule", "producitivity", "social", "sync", and "general"
    properties.descriptionText description of the template
    properties.displayNameThe name shown in the template gallery
    properties.definitionThe workflow definition object
    properties.connectionReferencesConnection references for connectors used in the workflow
    properties.apiSummariesCollection of connections referenced, used for gallery display
    properties.popularityAlways use 99 when submitting a new template
    properties.createTime / properties.changedTimeISO 8601 timestamps
  6. Advanced deployment patterns in recurrence-jobs

    master

    The recurrence jobs scripts demonstrate several advanced deployment patterns for high-scale Logic App environments:

    • High Throughput via Connection Randomization: Define multiple connections and use logic to randomly select one at runtime to distribute load.
    • Handling Circular References: To deploy Logic Apps with circular references, use a two-step deployment: first deploy a blank Logic App, then redeploy it with the actual references.
    • Scaling via Redundancy: Deploy multiple copies of the Logic Apps to increase availability and throughput.
  7. Test the Arc-enabled Logic App workflow

    master

    After deployment, you can verify the workflow by injecting data into Azure Table Storage and observing the output in Azure Blob Storage.

    Verification Steps

    1. Import Data: Use Azure Storage Explorer to connect to the storage account provided by the deployment script. Open the ratings table and use the Import button to upload the ratings.csv file located in the workspace's data folder.
    2. Monitor Workflow: Open the Logic App via the URL provided during deployment. Navigate to the RatingsWorfklow workflow and wait for a new run to complete.
    3. Verify Table Update: In Azure Storage Explorer, refresh the ratings table. The publishDate field for the imported items should now be updated to the time the workflow executed.
    4. Verify Blob Output: Open the ratings blob container in the same storage account. Locate the blob named 3 (or similar) to see the aggregated JSON ratings data.

    Testing Variations

    • Add more data with different product IDs to the ratings table.
    • Change the publishDate of an existing item to 00/00/0000 to trigger the addition to the blobs.
  8. Deploy the Azure VM Connector

    master

    You can deploy the Azure VM connector using the provided ARM template azuredeploy.json or via the Azure Portal deployment button.

    Once deployed, the Azure VM connector will be available for use in any Logic App within the same region where the connector was deployed. You can deploy multiple instances of this connector to different regions as needed.

    // Deployment is performed using the azuredeploy.json ARM template
    // or via the Azure Portal deployment button.
  9. Prerequisites for Chat with Your Data Project

    master

    To set up the Chat with Your Data project, ensure you have the following installed and configured:

    VS Code Extensions

    • Visual Studio Code
    • Azure Logic Apps extension for Visual Studio Code
    • Azure Functions extension for Visual Studio Code
    • Azurite extension for Visual Studio Code

    Required AI Services

    1. Azure OpenAI Service: Requires deployments for both an embedding model (e.g., text-embedding-ada-002) and a chat model (e.g., gpt-35-turbo). Note the deployment names.
    2. Azure AI Search Service: Requires an index to store document content and embeddings. You can initialize this using the aisearch_index.json file found in the ai-sample/Deployment folder.
  10. Configure authentication for the Azure VM Connector

    master

    The Azure VM connector requires Azure Active Directory (AAD) authentication. To set this up:

    1. Register an AAD Application: Create an application with User + app access so the connector can act on behalf of the authenticated user. Ensure the application is configured to get delegate access to the Windows Azure application.
    2. Provide Credentials: During deployment, you must provide the client ID and client Secret for the AAD Application.
    3. Configure Redirect URLs:
      • Deploy the connector.
      • Open the deployed connector (named azure-vm-connector).
      • Navigate to the Security tab and copy the Redirect URL.
      • Update your Azure AD Application's Reply URLs to include this redirect URL to support the logic app consent flow.
  11. Prerequisites for Logic Apps (Single-tenant) DevOps

    master

    Before setting up the project, ensure you have the following:

    • An Azure Subscription.
    • An Azure Storage Account or an emulator (like Azurite) to serve as a local data store.
    • Visual Studio Code installed.
    • The Logic App Tools installed in VS Code.
  12. Create a new Logic App template

    master

    To create a template, start by building your logic app using the Logic Apps Designer. Once the workflow is functional, you can convert it into a template using one of these methods:

    1. Manual Edit: Edit the logic app directly in the Logic App Code View.
    2. Visual Studio: Download your logic app into Visual Studio using Cloud Explorer.
    3. Script: Use the Logic Apps template creator script.

    After creation, plug the template into the sample.json file and add the required metadata.