Category Archives: Logic App

Developer Tools for Logic Apps 4: Using the Visual Studio Code to create your Logic Apps

Posted On February 9, 2021 by Yogesh Gore Posted in

VS Code is the light weight and yet powerful editor to create logic app. In order to create logic app in VS code you must have Visual Studio Code 1.31.0 (January 2019) or later. To start with, first, you must install the extension from the marketplace. To do that, search Azure Logic Apps extension in the marketplace and Click on Install. Open your Visual Studio Code and bring up the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of VS Code. And search Azure Logic Apps; After the installation of these extensions, you will find the two Azure Logic Apps section and then click on the Sign In Azure option. After you sign in then navigate to  your subscriptions and create new Logic app (for this you need to right click on the subscription and select create new logic app) This will open a small Logic App creation wizard on the top, in the center of the Visual Studio Code window, asking if we want to Create a new resource group or choose an existing one. If we select Create new resource group, then a new window appears asking for you to provide the resource group name Then we need to select a location to where the resource will be added In last step of the wizard will be providing a name for your Logic App

Share Story :

How to Read value from App Configuration in Logic App

Posted On February 9, 2021 by Yogesh Gore Posted in

Azure App Configuration is a managed service that helps developers centralize their application configuration and feature settings simply and securely. Use Azure App Configuration to store and secure configuration settings for your application in a single location. App configuration offer the following benefits. A fully managed service that can be set up in minutes Flexible key representations and mappings Tagging with labels Point-in-time replay of settings Dedicated UI for feature flag management App configuration is useful in following Scenario. Centralize management and distribution of hierarchical configuration data for different environments and geographies Dynamically change application settings without the need to redeploy or restart an application Control feature availability in real-time The only problem was that unlike Key Vault, which has an available connector to be used inside Logic Apps, App Configuration doesn’t have a connector available. So in order to implement this scenario we’ll going to use Azure function app Create an Azure Function App: The Azure Functions project template in Visual Studio creates a project that you can publish to a function app in Azure. From the Visual Studio menu, select File > New > Project. In Create a new project, enter functions in the search box, choose the Azure Functions template, and then select Next. In Configure your new project, enter a Project name for your project, and then select Create. The function app name must be valid as a C# namespace, so don’t use underscores, hyphens, or any other nonalphanumeric characters. Select Httptrigger function app Connect to App configuration store: Right-click your project, and select Manage NuGet Packages. On the Browse tab, search for and add the Microsoft.Extensions.Configuration.AzureAppConfiguration NuGet package to your project. Add the following namespaces of the .NET Core configuration and the App Configuration provider. using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration.AzureAppConfiguration; The key that we want to read should be passed by query parameter. string appKey = req.Query[“appKey”]; And finally, the function should raise proper HTTP response status codes according to the situation: 200 Ok if successful returns a value for that key 500 Internal Server Error if something fails, for example, there is no connection string to the App Configuration defined and 404 Not Found if the key is not found Use below code for reference if(string.IsNullOrEmpty(appKey))                 return new BadRequestObjectResult(“parameter ‘appKey’ not found or empty.”);             try             {                 string connectionString = Environment.GetEnvironmentVariable(“AppConfigConnection”);                 var builder = new ConfigurationBuilder();                 builder.AddAzureAppConfiguration(connectionString);                 var build = builder.Build();                 string keyValue = build[appKey.ToString()];                 if (string.IsNullOrEmpty(keyValue))                 {                     var result = new ObjectResult(“Azure Configuration Key not found – ” + appKey);                     result.StatusCode = StatusCodes.Status404NotFound;                     return result;                 }                 else return new OkObjectResult(keyValue);             }             catch(Exception ex)             {                 var result = new ObjectResult(ex.Message);                 result.StatusCode = StatusCodes.Status500InternalServerError;                 return result;             } Once you create your Function App and all you key-values inside App Configuration, you have to: Go to your Function App Configuration option under Settings  And create a new application settings call AppConfigConnection containing the connection string to your App Configuration resource. Once we done that you can call Azure Function in your logic app

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange