Forum Widgets
Latest Discussions
API Guide: Resubmitting from a specific Action in Logic Apps Standard
In collaboration with Sofia Hubendick This how-to article explains the process of resubmitting a Logic App Standard from a specific action via API. If you want to resubmit the workflow from the beginning, you can use the https://learn.microsoft.com/sv-se/rest/api/appservice/workflow-trigger-histories/resubmit?view=rest-appservice-2024-04-01&tabs=HTTP instead. Workflow Run Histories - Resubmit Authentication I used a managed identity for authentication, which simplifies the process by eliminating the need to obtain a token manually. Additionally, I implemented the new Logic App Standard Operator role. URL The URL for resubmitting an action looks like this: https://management.azure.com/subscriptions/[subscriptionId]/resourceGroups/[resourceGroupName]/providers/Microsoft.Web/sites/[logicAppName]/hostruntime/runtime/webhooks/workflow/api/management/workflows/[workflowName]/runs/[runId]/resubmit?api-version=2022-03-01 Mandatory URL Path Parameters Name Description subscriptionId The Azure subscription Id resourceGroupName The name of the resource group containing the Logic App logicAppName The name of the Logic App workflowName The name of the workflow runId The id of the workflow run to be resubmitted Request Body The API request body is structured as follows; replace the placeholder with the name of the action: { "actionsToResubmit": [ { "name": "[action name]" } ] } Response Name Description 202 Accepted OK Other Status Codes Error response describing why the operation failed.andevjenOct 13, 2024Copper Contributor502Views0likes0CommentsSemantic Kernel: Develop your AI Integrated Web App on Azure and .NET 8.0
How to create a Smart Career Advice and Job Search Engine with Semantic Kernel The concept The Rise of Semantic Kernel Semantic Kernel, an open-source development kit, has taken the .NET community by storm. With support for C#, Python, and Java, it seamlessly integrates with dotnet services and applications. But what makes it truly remarkable? Let’s dive into the details. A Perfect Match: Semantic Kernel and .NET Picture this: you’re building a web app, and you want to infuse it with AI magic. Enter Semantic Kernel. It’s like the secret sauce that binds your dotnet services and AI capabilities into a harmonious blend. Whether you’re a seasoned developer or just dipping your toes into AI waters, Semantic Kernel simplifies the process. As part of the Semantic Kernel community, I’ve witnessed its evolution firsthand. The collaborative spirit, the shared knowledge—it’s electrifying! We’re not just building software; we’re shaping the future of AI-driven web applications. The Web App Our initial plan was simple: create a job recommendations engine. But Semantic Kernel had other ideas. It took us on an exhilarating ride. Now, our web application not only suggests career paths but also taps into third-party APIs to fetch relevant job listings. And that’s not all—it even crafts personalized skilling plans and preps candidates for interviews. Talk about exceeding expectations! Build Since i have already created the repository on GitHub i don’t think it is critical to re post Terraform files here. We are building our main Infrastructure with Terraform and also invoke an Azure Cli script to automate the Container Image build and push. We will have these resources at the end: Before deployment make sure to assign the Service Principal with the role “RBAC Administrator” and narrow down the assignments to AcrPull, AcrPush, so you can create a User Assigned Managed Identity with these roles. Since we are building and pushing the Container Images with local-exec and Az Cli scripts within Terraform you will notice some explicit dependencies, for us to make sure everything builds in order. It is really amazing the fact that we can build all the Infra including the Apps with Terraform ! Architecture Upon completion you will have a functioning React Web App with the ASP NET Core webapi, utilizing Semantic Kernel and an external Job Listings API, to get advice, find Jobs and get a Skilling Plan for a specific recommended role! The following is a reference Architecture. Aside the Private Endpoints the same deployment is available in GitHub. Kernel SDK The SDK provides a simple yet powerful array of commands to configure and “set” the Semantic Kernel characteristics. Let’s the first endpoint, where users ask for recommended career paths: [HttpPost("get-recommendations")] public async Task<IActionResult> GetRecommendations([FromBody] UserInput userInput) { _logger.LogInformation("Received user input: {Skills}, {Interests}, {Experience}", userInput.Skills, userInput.Interests, userInput.Experience); var query = $"I have the following skills: {userInput.Skills}. " + $"My interests are: {userInput.Interests}. " + $"My experience includes: {userInput.Experience}. " + "Based on this information, what career paths would you recommend for me?"; var history = new ChatHistory(); history.AddUserMessage(query); ChatMessageContent? result = await _chatCompletionService.GetChatMessageContentAsync(history); if (result == null) { _logger.LogError("Received null result from the chat completion service."); return StatusCode(500, "Error processing your request."); } string content = result.Content; _logger.LogInformation("Received content: {Content}", content); var recommendations = ParseRecommendations(content); _logger.LogInformation("Returning recommendations: {Count}", recommendations.Count); return Ok(new { recommendations }); The actual data flow is depicted below, and we can see the Interaction with the local Endpoints and the external endpoint as well. The user provides Skills, Interests, Experience and Level of current position and the API sends the Payload to Semantic kernel with a constructed prompt asking for positions recommendations. The recommendations return with clickable buttons, one to find relevant positions from LinkedIn listings using the external API, and another to ask again the Semantic Kernel for skill up advice! The UI experience : Recommendations: Skill Up Plan: Job Listings: The Project can be extended to a point of automation and AI Integration where users can upload their CVs and ask the Semantic Kernel to provide feedback as well as apply for a specific position! As we discussed earlier some additional optimizations are good to have, like the Private Endpoints, Azure Front Door and/or Azure Firewall, but the point is to see Semantic Kernel in action with it’s amazing capabilities especially when used within the .NET SDK. Important Note: This could have been a one shot deployment but we cannot add the custom domain with Terraform ( unless we use Azure DNS) and the Cors Settings. So we have to add these details for our Solution to function properly! Once the Terraform completes, add the Custom Domains to both Container Apps. The advantage here is that we will know the Frontend and Backend FQDNs, since we decide the Domain name, and the React Environment Value is preconfigured with the backend URL. Same for the Backend, we have set as Environment Value for the ALLOWED_ORIGINS, the frontend URL. So we can just go to Custom Domain on each App, and add the domain names after selecting the Certificate which will be already there, since we have uploaded it via Terraform! Lessons Learned This was a real adventure and i want to share with you important lessons learned and hopefully save you some time and effort. Prepare ahead with a Certificate. I was having problems from the get go with ASP NET refusing to build on Containers until i integrated the certificate. The local development works fine without it. Cross Origin is very important, do not underestimate it ! Configure it correctly and in this example i went directly to Custom Domains, so i can have better overall control. This solution worked both on Azure Web Apps and Azure Container Apps. The Git Hub repo has the Container Apps solution but you can go with Web Apps. Finally don’t waste you time to go with Dapr. React does not ‘react’ well with the Dapr Client and my lesson learned here is that Dapr is made for same framework invocation or you are going to need a middleware. Since we cannot create the Custom Domain with Terraform there are solutions we can use, like using AzApi, We utilized a small portion of what really Semantic Kernel can do and i stopped when i realized that this project will never end if i continue pursuing ideas ! It is much better to have it on GiHub and probably we can come back and add some more features ! Conclusion In this journey through the intersection of technology and career guidance, we’ve explored the powerful capabilities of Azure Container Apps and the transformative potential of Semantic Kernel, Microsoft’s open-source development kit. By seamlessly integrating AI into .NET applications, Semantic Kernel has not only simplified the development process but also opened new doors for innovation in career advice. Our adventure began with a simple idea—creating a job recommendations engine. However, with the help of Semantic Kernel, this idea evolved into a sophisticated web application that goes beyond recommendations. It connects to third-party APIs, crafts personalized skilling plans, and prepares candidates for interviews, demonstrating the true power of AI-driven solutions. By leveraging Terraform for infrastructure management and Azure CLI for automating container builds, we successfully deployed a robust architecture that includes a React Web App, ASP.NET Core web API, and integrated AI services. This project highlights the ease and efficiency of building and deploying cloud-based applications with modern tools. The code is available in GitHub for you to explore, contribute and extend as mush as you want to ! Git Hub Repo: Semantic Kernel - Career Advice Links\References Intro to Semantic Kernel Understanding the kernel Chat completion Deep dive into Semantic Kernel Azure Container Apps documentation1.3KViews0likes0CommentsAzure Text to Speech with Container Apps
Azure Text to Speech with Container Apps Imagine interacting with not just one, but three distinct speaking agents, each bringing their unique flair to life right through your React web UI. Whether it’s getting the latest weather updates, catching up on breaking news, or staying on top of the Stock Exchange, our agents have got you covered. We’ve seamlessly integrated the Azure Speech SDK with a modular architecture and dynamic external API calls, creating an experience that’s as efficient as it is enjoyable. What sets this application apart is its versatility. Choose your preferred agent, like the News Agent, and watch as it transforms data fetched from a news API into speech, courtesy of the Azure Speech Service. The result? Crisp, clear audio that you can either savor live on the UI or download as an MP3 file for on-the-go convenience. But that’s not all. We’ve infused the application with a range of Python modules, each offering different voices, adding layers of personality and depth to the user experience. A testament to the power of AI Speech capabilities and modern web development, making it an exciting project for any IT professional to explore and build upon. Requirements Our Project is build with the help of VSCode, Azure CLI, React and Python. We need an Azure Subscription to create Azure Container Apps and an Azure Speech service resource. We will build our Docker images directly to Azure Container Registry and create the relevant ingress configurations. Additional security should be taken in account like Private Endpoints and Front Door in case you want this as a production application. Build We are building a simple React Web UI and containerizing it, while the interesting part of our code lays into the modular design of the Python backend. It is also a Docker container Image with a main application and three different python modules each one responsible for it's respective agent. Visual elements make the UI quite friendly and simple to understand and use. The user selects the agent and presses the 'TALK" button. The backend fetches data from the selected API ( GNEWS, OpenMeteo and Alphavantage) interacts the text with Azure Speech Service and returns the audio to be played on the UI with a small player, providing also a Download link for the MP3. Each time we select and activate a different agent the file is updated with the new audio. Let's have a look on the React build: import React, { useState } from 'react'; import './App.css'; import logo from './logo.png'; import avatarRita from './assets/rita.png'; import avatarMark from './assets/mark.png'; import avatarMary from './assets/mary.png'; function App() { const [activeAgent, setActiveAgent] = useState(null); const [audioUrl, setAudioUrl] = useState(null); // Add this line to define audioUrl and setAudioUrl const [audioStream, setAudioStream] = useState(null); // Add this line to define audioStream and setAudioStream const [stockSymbol, setStockSymbol] = useState(''); const handleAgentClick = (agent) => { setActiveAgent(agent); }; /*const handleCommand = async (command) => { if (activeAgent === 'rita' && command === 'TALK') { try { // Default text to send const defaultText = { text: "Good Morning to everyone" }; const response = await fetch(`${process.env.REACT_APP_API_BASE_URL}/talk-to-rita`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(defaultText), // Include default text in the request body }); const data = await response.json();*/ const handleCommand = async (command) => { if (command === 'TALK') { let endpoint = ''; let bodyData = {}; if (activeAgent === 'rita') { endpoint = '/talk-to-rita'; bodyData = { text: "Good Morning to everyone" };// Add any specific data or parameters for RITA if required } else if (activeAgent === 'mark') { endpoint = '/talk-to-mark'; // Add any specific data or parameters for MARK if required } else if (activeAgent === 'mary' && stockSymbol) { endpoint = '/talk-to-mary'; bodyData = { symbol: stockSymbol }; } else { console.error('Agent not selected or stock symbol not provided'); return; } try { const response = await fetch(`${process.env.REACT_APP_API_BASE_URL}${endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(bodyData),// Add body data if needed for the specific agent }); const data = await response.json(); if (response.ok) { const audioContent = base64ToArrayBuffer(data.audioContent); // Convert base64 to ArrayBuffer const blob = new Blob([audioContent], { type: 'audio/mp3' }); const url = URL.createObjectURL(blob); setAudioUrl(url); // Update state setAudioStream(url); } else { console.error('Response error:', data); } } catch (error) { console.error('Error:', error); } } }; // Function to convert base64 to ArrayBuffer function base64ToArrayBuffer(base64) { const binaryString = window.atob(base64); const len = binaryString.length; const bytes = new Uint8Array(len); for (let i = 0; i < len; i++) { bytes[i] = binaryString.charCodeAt(i); } return bytes.buffer; } return ( <div className="App"> <header className="navbar"> <span>DATE: {new Date().toLocaleDateString()}</span> <span> </span> </header> <h1>Welcome to MultiChat!</h1> <h2>Choose an agent to start the conversation</h2> <h3>Select Rita for Weather, Mark for Headlines and Mary for Stocks</h3> <img src={logo} className="logo" alt="logo" /> <div className="avatar-container"> <div className={`avatar ${activeAgent === 'rita' ? 'active' : ''}`} onClick={() => handleAgentClick('rita')}> <img src={avatarRita} alt="Rita" /> <p>RITA</p> </div> <div className={`avatar ${activeAgent === 'mark' ? 'active' : ''}`} onClick={() => handleAgentClick('mark')}> <img src={avatarMark} alt="Mark" /> <p>MARK</p> </div> <div className={`avatar ${activeAgent === 'mary' ? 'active' : ''}`} onClick={() => handleAgentClick('mary')}> <img src={avatarMary} alt="Mary" /> <p>MARY</p> </div> </div> <div> {activeAgent === 'mary' && ( <input type="text" placeholder="Enter Stock Symbol" value={stockSymbol} onChange={(e) => setStockSymbol(e.target.value)} className="stock-input" /> )} </div> <div className="controls"> <button onClick={() => handleCommand('TALK')}>TALK</button> </div> <div className="audio-container"> {audioStream && <audio src={audioStream} controls autoPlay />} {audioUrl && ( <a href={audioUrl} download="speech.mp3" className="download-link"> Download MP3 </a> )} </div> </div> ); } export default App; The CSS is available on GitHub and this is the final result: Now the Python backend is the force that makes this Web App a real Application ! Let’s have a look on our app.py , and the 3 different modules of weather_service.py, news_service.py and stock_service.py. Keep in mind that the external APIs used here are free and we can adjust our calls to our needs, based on the documentation of each API and its capabilities. For example the Stock agent brings up a text box to write the Stock symbol which you want information from. import os import base64 from flask import Flask, request, jsonify import azure.cognitiveservices.speech as speechsdk import weather_service import news_service import stock_service from flask_cors import CORS app = Flask(__name__) CORS(app) # Azure Speech Service configuration using environment variables speech_key = os.getenv('SPEECH_KEY') speech_region = os.getenv('SPEECH_REGION') speech_config = speechsdk.SpeechConfig(subscription=speech_key, region=speech_region) # Set the voice name (optional, remove if you want to use the default voice) speech_config.speech_synthesis_voice_name='en-US-JennyNeural' def text_to_speech(text, voice_name='en-US-JennyNeural'): try: # Set the synthesis output format to MP3 speech_config.set_speech_synthesis_output_format(speechsdk.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3) # Set the voice name dynamically speech_config.speech_synthesis_voice_name = voice_name # Create a synthesizer with no audio output (null output) synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=None) result = synthesizer.speak_text_async(text).get() # Check result if result.reason == speechsdk.ResultReason.SynthesizingAudioCompleted: print("Speech synthesized for text [{}]".format(text)) return result.audio_data # This is in MP3 format elif result.reason == speechsdk.ResultReason.Canceled: cancellation_details = result.cancellation_details print("Speech synthesis canceled: {}".format(cancellation_details.reason)) print("Error details: {}".format(cancellation_details.error_details)) return None except Exception as e: print(f"Error in text_to_speech: {e}") return None @app.route('/talk-to-rita', methods=['POST']) def talk_to_rita(): try: # Use default coordinates or get them from request latitude = 37.98 # Default latitude longitude = 23.72 # Default longitude data = request.json if data: latitude = data.get('latitude', latitude) longitude = data.get('longitude', longitude) # Get weather description using the weather service descriptive_text = weather_service.get_weather_description(latitude, longitude) if descriptive_text: audio_content = text_to_speech(descriptive_text, 'en-US-JennyNeural') # Use the US voice #audio_content = text_to_speech(descriptive_text) if audio_content: # Convert audio_content to base64 for JSON response audio_base64 = base64.b64encode(audio_content).decode('utf-8') return jsonify({"audioContent": audio_base64}), 200 else: return jsonify({"error": "Failed to synthesize speech"}), 500 else: return jsonify({"error": "Failed to get weather description"}), 500 except Exception as e: return jsonify({"error": str(e)}), 500 @app.route('/talk-to-mark', methods=['POST']) def talk_to_mark(): try: gnews_api_key = os.getenv('GNEWS_API_KEY') news_headlines = news_service.fetch_greek_news(gnews_api_key) # Set the language to Greek for MARK # speech_config.speech_synthesis_voice_name = 'el-GR-AthinaNeural' # Example Greek voice audio_content = text_to_speech(news_headlines, 'el-GR-NestorasNeural') # Use the Greek voice if audio_content: audio_base64 = base64.b64encode(audio_content).decode('utf-8') return jsonify({"audioContent": audio_base64}), 200 else: return jsonify({"error": "Failed to synthesize speech"}), 500 except Exception as e: return jsonify({"error": str(e)}), 500 @app.route('/talk-to-mary', methods=['POST']) def talk_to_mary(): try: data = request.json stock_symbol = data.get('symbol') # Extract the stock symbol from the request if not stock_symbol: return jsonify({"error": "No stock symbol provided"}), 400 api_key = os.getenv('ALPHAVANTAGE_API_KEY') # Get your Alpha Vantage API key from the environment variable stock_info = stock_service.fetch_stock_quote(api_key, stock_symbol) audio_content = text_to_speech(stock_info, 'en-US-JennyNeural') # Use an English voice for Mary if audio_content: audio_base64 = base64.b64encode(audio_content).decode('utf-8') return jsonify({"audioContent": audio_base64}), 200 else: return jsonify({"error": "Failed to synthesize speech"}), 500 except Exception as e: print(f"Error in /talk-to-mary: {e}") return jsonify({"error": str(e)}), 500 if __name__ == '__main__': app.run(debug=True) and here is the sample weather_service.py: import requests_cache import pandas as pd from retry_requests import retry import openmeteo_requests # Function to create descriptive text for each day's weather def create_weather_descriptions(df): descriptions = [] for index, row in df.iterrows(): description = (f"On {row['date'].strftime('%Y-%m-%d')}, the maximum temperature is {row['temperature_2m_max']}°C, " f"the minimum temperature is {row['temperature_2m_min']}°C, " f"and the total rainfall is {row['rain_sum']}mm.") descriptions.append(description) return descriptions # Setup the Open-Meteo API client with cache and retry on error cache_session = requests_cache.CachedSession('.cache', expire_after=3600) retry_session = retry(cache_session, retries=5, backoff_factor=0.2) openmeteo = openmeteo_requests.Client(session=retry_session) def fetch_weather_data(latitude=37.98, longitude=23.72): # Default coordinates for Athens, Greece # Define the API request parameters params = { "latitude": latitude, "longitude": longitude, "daily": ["weather_code", "temperature_2m_max", "temperature_2m_min", "rain_sum"], "timezone": "auto" } # Make the API call url = "https://api.open-meteo.com/v1/forecast" responses = openmeteo.weather_api(url, params=params) # Process the response and return daily data as a DataFrame response = responses[0] daily = response.Daily() daily_dataframe = pd.DataFrame({ "date": pd.date_range( start=pd.to_datetime(daily.Time(), unit="s", utc=True), end=pd.to_datetime(daily.TimeEnd(), unit="s", utc=True), freq=pd.Timedelta(seconds=daily.Interval()), inclusive="left" ), "weather_code": daily.Variables(0).ValuesAsNumpy(), "temperature_2m_max": daily.Variables(1).ValuesAsNumpy(), "temperature_2m_min": daily.Variables(2).ValuesAsNumpy(), "rain_sum": daily.Variables(3).ValuesAsNumpy() }) return daily_dataframe def get_weather_description(latitude, longitude): # Fetch the weather data weather_data = fetch_weather_data(latitude, longitude) # Create weather descriptions from the data weather_descriptions = create_weather_descriptions(weather_data) return ' '.join(weather_descriptions) Refer to the GitHub Repo for the other modules , and the Dockerfiles as well. Now here is the Azure Cli scripts that we need to execute in order to build, tag and push our Images to Container Registry and pull them as Container Apps to our Environment on Azure: ## Run these before anything ! : az login az extension add --name containerapp --upgrade az provider register --namespace Microsoft.App az provider register --namespace Microsoft.OperationalInsights ## Load your resources to variables $RESOURCE_GROUP="rg-demo24" $LOCATION="northeurope" $ENVIRONMENT="env-web-x24" $FRONTEND="frontend" $BACKEND="backend" $ACR="acrx2024" ## Create a Resource Group, a Container Registry and a Container Apps Environment: az group create --name $RESOURCE_GROUP --location "$LOCATION" az acr create --resource-group $RESOURCE_GROUP --name $ACR --sku Basic --admin-enabled true az containerapp env create --name $ENVIRONMENT -g $RESOURCE_GROUP --location "$LOCATION" ## Login from your Terminal to ACR: az acr login --name $(az acr list -g rg-demo24 --query "[].{name: name}" -o tsv) ## Build your backend: az acr build --registry $ACR --image backendtts . ## Create your Backend Container App: az containerapp create \ --name backendtts \ --resource-group $RESOURCE_GROUP \ --environment $ENVIRONMENT \ --image "$ACR.azurecr.io/backendtts:latest" \ --target-port 5000 \ --env-vars SPEECH_KEY=xxxxxxxxxx SPEECH_REGION=northeurope \ --ingress 'external' \ --registry-server "$ACR.azurecr.io" \ --query properties.configuration.ingress.fqdn ## Make sure to cd into the React Frontend directory where your Dockerfile is: az acr build --registry $ACR --image frontendtts . ## Create your Frontend: az containerapp create --name frontendtts --resource-group $RESOURCE_GROUP \ --environment $ENVIRONMENT \ --image "$ACR.azurecr.io/frontendtts:latest" \ --target-port 80 --ingress 'external' \ --registry-server "$ACR.azurecr.io" \ --query properties.configuration.ingress.fqdn Now we usually need to have the Web UI up and running so what we do is to set the scaling on each Container App to minimum 1 instance, but this is up to you ! That’s it ! Select your agents and make calls. Hear the audio, download the MP3 and make any changes to your App, just remember to rebuild your image and restart the revision ! Closing As we wrap up this exciting project showcasing the seamless integration of Azure Speech Service with React, Python, and Azure Container Apps, we hope it has sparked your imagination and inspired you to explore the endless possibilities of modern cloud technologies. It’s been an exciting journey combining these powerful tools to create an application that truly speaks to its users. We eagerly look forward to seeing how you, our innovative community, will use these insights to build your own extraordinary projects. References: GitHub Repo Azure Container Apps Azure Speech SDK Azure Speech Service Quickstart Text to Speech Architecture:KonstantinosPassadisMar 15, 2024Learn Expert745Views0likes0CommentsDeploy BizTalk Application Azure DevOps extension
Is the source code for the “Deploy BizTalk Application” Azure DevOps extension open source or will it be made available? Can anyone confirm if this extension creates a shared folder and sets share permissions as one Reviewer has posted? If so, which of the deployment operations creates a shared folder and how is it used in deployment? Also, can a shared folder be instead set-up beforehand on the build/deploy agent server by server admins/security team and would the pipelines task use this existing share? Extension’s Visual Studio Marketplace page: https://marketplace.visualstudio.com/items?itemName=ms-biztalk.deploy-biztalk-applicationtara-anderson-bcDec 06, 2023Copper Contributor269Views0likes0CommentsHuge time taking while transfer data from Azure Synapses notebook to Azure Synapses SQL
- We utilize Azure Synapses, comprising Synapse Notebooks and Synapse SQL. - After data transformation in Azure Synapses, we insert data into Azure SQL. - In a specific scenario, we need to insert 42K records from an Azure notebook to SQL. - Currently, it takes 3 to 4 hours, whereas our expectation is that it should take a maximum of 1 to 3 seconds.SpattanayakNov 21, 2023Copper Contributor307Views0likes0CommentsNew User Call
Hello, I am new to Azure. I want to use Azure to send our employee details from IFS10 to Kallidus Learning Portal(third party) using API's. We use IFS10(on premise) and with the available IFS10 API's. We are doing a proof of concept on Azure Integration Services. Question is, when a new employee is made active in the database, how would Azure know there is a new record? Thanks RossrosscortbOct 17, 2023Tin Contributor378Views0likes0Comments2 x Request URL
Hello, Sorry, but I'm just learning Azure Integration Services. I set up a blank test api using - http:// https://dummy.restapiexample.com/api/v1/employees I get a 404 error but i've noticed in the Request URL is has the auto generated base url and then that url above, so two urls, it should just be that url on its own without the base url? Thanks RossrosscortbSep 19, 2023Tin Contributor348Views0likes0CommentsZAP Scan Automation using Azure DevOps to get the access token from Azure AD B2C or B2E.
Hey Team, I have implemented ZAP Scan for one of the microservices. I need to get the access token from the Azure AD B2C using client assertion for the microservice. I have registered my application under the Azure AD B2C, to generate the client assertion which technique should I follow(like MSAL) or any insights from your end. Are there any other approach to get the access token from Azure AD B2C or Azure AD B2E with out passing the client secret. If there is a solution how I need to automate the whole process using the powershell or python. Please share your valid thoughts. Thank you for your patience.ranjithreddy976Sep 10, 2023Copper Contributor398Views0likes0CommentsAre Custom Properties of Service Bus (Connector) Message in Logic App Always Parsed As String Value?
I am trying to send integer values in custom properties of a service bus (connector) message in logic app but the issue is that the value is automatically parsed to String value even if I pass a number in JSON object. For Reference - The JSON object that I am trying to pass is - { "DemoNumber": 2 } but here 2 is getting parsed as string at service bus side, The issue is that the connector treat the text as string in spite of providing numeric values. The link that I followed for the reference to use properties as {key: value} pair and possible types of values are- https://learn.microsoft.com/en-us/connectors/servicebus/#send-message & https://learn.microsoft.com/en-us/rest/api/servicebus/message-headers-and-properties#message-properties So, is there any way to pass the integer value that can be fetched as a integer at service bus side also.Ashish_Yadav5Aug 04, 2023Copper Contributor528Views0likes0CommentsAZURE LOGICAPPS: BLOB FROM DEFENDER ADVANCED HUNTING DATA
This Workshop is an integration of Microsoft Defender Advanced Hunting queries, and Logic Apps. As we already know Infrastructure as a Code is the way and for our Workshops we will utilize Azure DevOps , Terraform and GitHub. For this one we will use DevOps pipelines to run our az cli script on a Self Hosted Windows Agent, grabbing the templates from GitHub Repos. What we need: Azure Subscription Microsoft 365 Admin Access to the Security Portal Azure DevOps account, sign in here: https://aex.dev.azure.com/ GitHub account You can deploy without the need of a Self Hosted Agent, but as we are proceeding with more demanding deployments a Hosted Agent is coming very handy. We can have a look at the Microsoft Hosted Agents limitations, and decide when it is best to deploy our Self Hosted agent. Create the resources (Azure Pipelines) Let’s create a Service Principal with Contributor rights to connect our DevOps Project with our Azure Subscription, and a Personal Token from GitHub. From Azure Cloud Shell run the command, give a name and add your Subscription Id : az ad sp create-for-rbac --name azdev-sp --role Contributor --scopes /subscriptions/xxxxxxx-xxxxxxxx-xxxxxxx Keep the output values. Login to https://aex.dev.azure.com/ and select or create an Organization and a Project. On the Project Settings you will find Service Connections and the option to create a new one: Select Azure Resource Manager, Service Principal ( Manual ) , and add the details in the fields. You may create the connection with the Automatic option as well, my preference is Manual. Verify the Service Connection, give a name and an optional Description and check Grant Access to all Pipelines, for our Workshop. Fork or Copy the https://github.com/Azure/azure-quickstart-templates Repo and create a new one let’s name it logicappworkflow. Now in the GitHub Portal select in the upper right Profile section the Settings and in the left vertical menu access the ‘Developer Settings”. Generate a new Personal Access Token, give it a name with Repo:All Checkboxes permissions and copy it somewhere safe. Return to Azure DevOps Project Settings and in a similar manner create a new Service Connection with GitHub of Type Personal Access Token. Allow the Repos “azure-quickstart-templates” and the “logicappworkflow‘ , verify and save. The Template for a blank Consumption Logic App Workflow is this , followed by the parameters.json : template.json { "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "logicAppApiVersion": { "type": "string" }, "name": { "type": "string" }, "location": { "type": "string" }, "workflowSchema": { "type": "string" }, "logicAppState": { "type": "string", "defaultValue": "Enabled" }, "definition": { "type": "string", "defaultValue": "[concat('{\"contentVersion\":\"1.0.0.0\",\"parameters\":{},\"actions\":{},\"triggers\":{},\"outputs\":{},\"$schema\":\"', parameters('workflowSchema'), '\"}')]" }, "parameters": { "type": "object", "defaultValue": {} } }, "resources": [ { "apiVersion": "[parameters('logicAppApiVersion')]", "name": "[parameters('name')]", "type": "Microsoft.Logic/workflows", "location": "[parameters('location')]", "tags": {}, "properties": { "definition": "[json(parameters('definition'))]", "parameters": "[parameters('parameters')]", "state": "[parameters('logicAppState')]" } } ] } parameters.json { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "logicAppApiVersion": { "value": "2016-10-01" }, "name": { "value": "logicdemo" }, "location": { "value": "North Europe" }, "workflowSchema": { "value": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#" } } } Upload\Create these files as template.json and parameters.json to your logicappworkflow repo. In this example we created a folder inside the repository named logic. So far we have created the DevOps connections to Azure and GitHub and we are ready to deploy! I know it would be much easier to use the Portal, but we may consider this approaches as introductory to DevOps. Trust me you will like it … a lot! So , this time we will create a Release Pipeline, with 2 Tasks. One task to create the resource group and the storage account, and the other one to create a blank Logic App workflow. From the DevOps portal, Pipelines -Releases- New Release Pipeline, select Empty Job , leave default “Stage 1” and close the Pop Up. We won’t need an Artifact since we will use Az CLI with Remote Template Deployment, so we should be on this screen: When we click on the 1 Job, 0 Tasks link, we can start adding Tasks to this Stage. The first thing we see is the Agent Job, it is the Compute where we will run our scripts; here we can leave the preset selection or change the Pool to our own pool where we have added our Self Hosted Agent. Now we are ready to write our Release Pipeline, which will create an Azure Resource group with two Deployments, one for the Storage account and another one for the Logic App. Again, several options are available from cloning the Template repos to uploading them to Azure and so on. We are going to run a release pipeline with 2 tasks, the Az Cli scripts for Remote Template deployments. Here are the 2 scripts, insert them as Batch type and Inline Script : call az group create --name rg-demo-01 --location "North Europe" call az deployment group create --name "DeployStorage" --resource-group rg-demo-01 --template-uri "https://raw.githubusercontent.com/passadis/azure-quickstart-templates/master/quickstarts/microsoft.storage/storage-account-create/azuredeploy.json" --parameters storageAccountType=Standard_LRS call az deployment group create --name "DeployLogic" --resource-group rg-demos --template-uri "https://raw.githubusercontent.com/passadis/webapp2021az/master/logic/template.json" --parameters "https://raw.githubusercontent.com/passadis/webapp2021az/master/logic/parameters.json" Go to the Repo, select the first file from which we want the link and click Raw, so the correct link is opened. Copy the link and insert to the relevant Script inputs (–template-uri & –parameters): We have our Pipeline ready , so Save and create a new Release. Select that Stage1 is triggered manually and deploy! We will see in Azure Management Portal the resource group and the deployements we created, as each Task from the Pipeline completes. Design the Logic App Workflow, Create CSV to Azure Blob. Now we are going to use the Logic App Designer to create our Workflow. The trigger is what will activate our workflow so it is the first step to create. Next are the ingestion of the Results from the Defender Advanced Hunting query of our choice. We have already seen the Schema and the capabilities regarding information, and the Kusto Language in a previous post. We make the connection to our Azure AD with an account which must have Security Administrator permissions on the Tenant ( additional settings if RBAC is turned on for Defender). So far , so good! Create a sample Query and test it on the Defender Portal. For now we have : DeviceEvents | where ActionType contains "Antivirus" | where Timestamp > ago(15days) The next part does all the trick for us! We have a number of Device Events and we want these to create a CSV file and Upload to an Azure Blob. There is an action called Initialize Variable which allows us to create different types of variables, among them is the array variable. Pretty cool right ? Nice and neat the Results output is declared as the variable “myArray”, or whatever name, so we can work with it into the next steps. We have our array ready, the only thing now is to create our CSV. The Data Operation “Create CSV table” is here for us! Select the array we declared earlier as the input, and customize the Columns. It is a little tricky to make it work so the trick is to write as an expression the data. So for the Name header we add into the value a custom expressin item()?['DeviceName'] , for the Type item()?['ActionType'] and we need one more detail, which file is affected so item()?['FileName']. Ok lets add another one, that shows which process initiated the Action. This step will look like this: Now we have declared our Outputs and these exist in our CSV table. So let’s put the table into our Blob Storage.The “Update Blob (V2)” step authenticates with Managed Identity, so we must create for our Logic App a System Managed Identity with the Storage Blob Data Owner Role assignment. The new connection asks for the Storage Account name or Endpoint ( Detailed explanations HERE, is a must for you to understand which one needs what). We add the connection, set the Content to “Output” from the previous step ( remember to select Output from the Dynamic Content search bar), and add the content-type as application/octet-stream since we are dealing with CSV files. Alright i know what are you thinking about…What if the Blob is not there ? Our action Updates the Blob it does not create anything! Well, a Logic App should apply logic right ? yes! We will create a next step which Creates the Blob , only if the previous one fails! That’s right! On the dotted selection of each step we can see the “Configure Run After” option. This simple command allows us to select when the step will run based on the success, failure, expiration or skipped outcome of the previous step. So, we will add a new step with the “Create Blob V2” task , and select to Run after the previous step has failed! Notice the Output is collected via the Dynamic Expression search bar And the Final Designer view : And now we have our Files Uploaded to Azure Blob Storage , files that contain critical info as they are constructed from Defender for Endpoint Advanced Hunting Queries. Since Logic Apps now supports Data Lake Storage V2, we will explore in another workshop the beauty of Data Analytics with the help of Azure Data Factory, and Azure Synapse Analytics. We may also have a peek on the final stage of Data Ingestion and Analysis with PowerBI Reports and Dashboards! Remember this example is a basic “blueprint”. It’s purpose is to present and explore the various Deployment methods with Azure DevOps, the Integration of different Microsoft services through Applications and Connectors, and to give a taste of the vast amount of Scenarios and Deployments that can make our digital assets safer, making the better use of the enormous possibilities that come with Cloud , Software and Platform as a Service offerings. References : Data Operations in Logic Apps How to use ARM deployment templates with Azure CLIKonstantinosPassadisJul 29, 2023Learn Expert1.2KViews0likes0Comments
Tags
- logic apps12 Topics
- azure api management4 Topics
- Event Grid4 Topics
- Biztalk 20202 Topics
- biztalk2 Topics
- azure2 Topics
- biztalk server1 Topic
- Visual Studio 20191 Topic
- azure devops1 Topic