- Azure provides several different ways to host and execute code or workflows without using VMs including Azure Functions, Power Automate, Azure Logic Apps, and Azure WebJobs.
- A company that operates a bike rental system at a university. Company recently acquired to operate at another university.
- The other university also has a rental system in place. Need to integrate with those existing systems too (bike tracking, inventory management, rental scheme registration, and more).
- As you expand into other universities, you need to be able to scale efficiently in order to keep costs down and your low margins viable.
- In this module, we’ll describe the Azure technologies that are available to you and teach you how to evaluate each one for your business needs.
-
Explore the Azure technology options that are available to automate and integrate your business processes.
-
Common business issues
- Each process may run in a simple line of activities that workers perform one after the other or they may branch or loop. Each process may also run quickly or take days or weeks to complete.
- Business processes modeled in software are often called workflows. Azure includes 4 different workflow technologies: Logic Apps, Power Automate, WebJobs, Functions. Have some similarities. For example:
- Accept inputs - is a piece of data or a file that is supplied to the workflow.
- Run actions - is a simple operation that the workflow executes and may often modify data or cause another action to be performed.
- Include conditions - is a test, often run against an input, that may decide which action to execute next.
- Produce outputs - is a piece of data or a file that is created by the workflow.
- In addition, workflows can either start based on a schedule or they can be triggered by some external event.
-
Design-first technologies (DFT) - With Logic Apps and Power Automate UI, designing a workflow. We call this approach a DFT.
-
- It's a service within Azure to automate, orchestrate, and integrate disparate components of a distributed application. By using the DFT approach in Logic Apps, you can draw out complex workflows that model complex business processes.
- Alternatively, you can create or edit a workflow in JSON notation by using the code view
- Logic App supports over 200 pre-built connectors. A connector is a Logic Apps component that provides an interface to an external service. For example, the X connector allows you to send and retrieve tweets, while the Office 365 Outlook connector lets you manage your email, calendar, and contacts. Create your own connector if your system exposes a REST API.
-
- It's a service to create workflows even when you have no development or IT Pro experience. There are 4 different types of flow that you can create:
- Automated: Starts by a trigger from some event. For example, the event could be the arrival of a new tweet or a new file being uploaded.
- Button: Runs a repetitive task with a single click from your mobile device.
- Scheduled: Runs regularly. For example, once a week, on a specific date, or after 10 hours.
- Business process: Models a business process such as the stock ordering process or the complaints procedure. The flow process can have: notifications to required people; with their approval recorded; calendar dates for steps; and recorded time of flow steps.
- Power Automate supports the same range of connectors and actions as Logic Apps.
- It's a service to create workflows even when you have no development or IT Pro experience. There are 4 different types of flow that you can create:
-
DFT compared - Power Automate is more appropriate for use by non-technical staff. If your workflow designers are IT professionals, developers, or DevOps practitioners, Logic Apps is usually a better fit.
Microsoft Power Automate Logic Apps Intended users Office workers and business analysts Intended scenarios Self-service workflow creation Design tools GUI only. Browser and mobile app Application Lifecycle Management Power Automate includes testing and production environments
-
-
Code-first technologies (CFT) - write custom code to orchestrate and integrate different business applications into a single workflow. For such people, Azure includes WebJobs and Functions.
-
WebJobs and the WebJobs SDK
- The Azure App Service is a cloud-based hosting service for web applications, mobile back-ends, and RESTful APIs. These applications often need to perform some kind of background task. For example, in your bike rental system, when a user uploads a photo of a bike, you may need to generate a smaller thumbnail photograph.
- WebJobs are a part of the Azure App Service that you can use to run a program or script automatically. There are two kinds of WebJob:
- Continuous. Starts immediately when the WebJob is created and runs in a continuous loop. For example, you could use a continuous WebJob to check a shared folder for a new photo.
- Triggered. Starts based on a binding event, on a schedule, or when you trigger it manually (on demand).
- Write code in several different languages.
- WebJobs SDK includes a range of classes, such as JobHostConfiguration and HostBuilder, which reduce the amount of code required to interact with the Azure App Service.
- The WebJobs SDK only supports C# and the NuGet package manager.
-
- It's a simple way to run small pieces of code in the cloud, without worry about the infrastructure required to host that code.
- Only pay for the time when the code runs. Azure automatically scales your function in response to the demand from users.
- To create an Azure Function, choose from the range of templates. The following list is a sample of some of the templates available to you:
- HTTPTrigger. When you want the code to execute in response to a request sent through the HTTP protocol.
- TimerTrigger. When you want the code to execute according to a schedule.
- BlobTrigger. When you want the code to execute when a new blob is added to an Azure Storage account.
- CosmosDBTrigger. When you want the code to execute in response to new or updated documents in a NoSQL database.
- Azure Functions can integrate with many different services both within Azure and from third parties. These services can trigger your function, or send data input to your function, or receive data output from your function.
-
CFT compared
- The simple administration and more flexible coding model provided by Azure Functions
- Choose WebJobs for the following reasons:
- You want the code to be a part of an existing App Service application and to be managed as part of that application, for example in the same Azure DevOps environment.
- You need close control over the object that listens for events that trigger the code. This object in question is the JobHost class, and you have more flexibility to modify its behavior in WebJobs.
Azure WebJobs Azure Functions Supported languages C# if you're using the WebJobs SDK C#, Java, JavaScript, PowerShell, and so on Automatic scaling No Yes Development and testing in a browser No Yes Pay-per-use pricing No Yes Integration with Logic Apps No Yes Package managers NuGet if you're using the WebJobs SDK NuGet and NPM Can be part of an App Service application Yes Yes (hosted under App Service plan) Provides close control of JobHost Yes No
-
- There are several different business processes that run your bicycle rental business. For example, there's the bike rental process, a return process, a bike booking process, and processes that don't directly relate to bikes, such as holiday booking for the staff.
- Choose a technology to automate the booking process for your bike rental business.
- Integrate a bike tracking technology that is used on the new univerisity (campus).
- In this exercise, we'll examine this scenario in detail and choose which technology to use.
- Scenario
- Existing campus, 5 bike rental shops. Each shop has a list of bikes for rent and its own database that records the bikes and their features and whether they're already rented or in the shop.
- Currently, each bike can only be rented from its home shop. When a customer returns a bike to another shop, staff moves it back to the shop where it's listed on the database. Change the process so that each bike can be rented from any shop. However, you want to ensure staff can find out quickly where each bike is.
- New campus, the bike rental business invested in a third party system to track bike locations. When a bike arrives back at a store, a unique barcode on the crossbar is scanned. The bike tracking database is automatically updated with the name of the shop that scanned the barcode. When a bike leaves a shop with a customer, the location is changed to "On Hire" and the customer name is recorded in a separate column.
- This system has proved helpful when a customer asks for a bike with specific frame size and/or specific features, such as an electric motor or all-terrain suspension. If a shop doesn't have a bike with the right equipment, the shop can quickly find out where such a bike is and get it or send the customer to the right shop. This bike location database has a REST API that you can call from other systems.
- There were problems in the past when documentation hasn't been kept in-sync with custom code and your director wants to see the process as it's implemented.
- Business process
- Update the bike reservation and rental process on both campuses to the following workflow:
- The details are as follows:
- A customer requests a bike on the phone, in person, or through the website.
- Shop staff record the customer's details and frame size.
- Does the customer need specific features such as an electric motor, suspension, or a child trailer? If so what are those features?
- Where are all the bikes with that frame size and those features? This information is obtained from the bike location database and is kept up-to-date by the barcode scanning system.
- Is there a bike with the right features and frame size in the right shop? If yes book that bike.
- If not, where is the nearest bike? Reserve that bike.
- Send an email to staff to move the bike to the customer.
- Scan barcode in new location.
- Give the bike to the customer and update location to "On Hire".
- Take payment from the customer.
- This is a simplification of the entire process. For simplicity, omitted edge cases such as no bike with the desired frame size or features is available for rent.
- Choose a technology
- Design-first or code-first? - design-first
- Store Staff understand the workflow at a higher level than examining the code and implementation. Also doesn't like separate documents describing a process, because it so easily becomes out-of-date when the process changes. 1.It's visualized in an easy-to-understand design surface and not a separate document.Also diagram is not updated when the process is changed.
- Microsoft Power Automate or Azure Logic Apps? - Azure Logic Apps
- Not modify the business process. Connect to the bike location database through REST API, so create a custom connector.
- Design-first or code-first? - design-first
- Scenario
- Your bike technicians currently use a spreadsheet to record the actions they take to repair and maintain each bike.
- Difficulties have arisen when spare parts are needed, because the staff has no way of knowing when a bike is waiting for repairs or parts.
- This problem has resulted in bikes being rented to customers with worn brake pads, flat tires, and other faults that may damage the companies brand as a high-quality bike rental company.
- Build a system that governs the maintenance and repair process and allows everyone to find answers to the following questions.
- What jobs have been completed on a bike?
- What jobs remain to be completed before the bike can be rented out again?
- Which bikes are currently available to rent?
- Which bikes are currently unavailable to rent?
- For each bike that is unavailable:
- Why can't we rent them out?
- Are we waiting for any parts, and what are those parts?
- When is the bike likely to be available again for rent?
- Integrate this system with the bike booking and rental process from the last unit. So, Staff find only those bicycles that are currently available to rent.
- Business process
- The details are as follows:
- A customer returns a bike to any location. The bike maintenance process starts.
- A technician marks the bike as unavailable.
- A technician completes a full list of checks including the tires, brakes, drive chain, and lights.
- Are new parts required?
- New parts are required, but we don't have the parts in stock.
- The technician orders new parts
- Parts arrive
- Fit new parts
- New parts are required, but we don't have the parts in stock.
- A technician completes final changes.
- A technician marks the bike as available for rent.
- Choose a technology
- Design-first or code-first? - code-first
- To implement this workflow using just Logic Apps or Power Automate would be difficult. This process needs to access an inventory system and place orders with a third-party parts company.
- Azure Functions or Azure Apps Service WebJobs? - Azure Functions
- Cost: With Web Jobs, you pay for the entire VM or App Service Plan. Azure Function pay when the function runs. Since this process only kicks off when a bike is returned, selecting Azure Functions.
- Integrations: Integrate the maintenance workflow with the Logic App that you build for the bike booking and rental process in the previous unit. Although it's possible to call a WebJob from a Logic App, the integration between Logic Apps and Functions is closer. For example, you can more easily control your call to a Function from the Logic Apps designer.
- Design-first or code-first? - code-first
-
Scenario 1 - TV Adverts
- You work for a company that makes TV adverts. You want to formalize two business processes:
- The advert review process. A completed advert is put through this editorial process to ensure that it meets the standards of taste, decency, grammar, style, and legal requirements in the jurisdiction where it will be broadcast.
- The feedback collection process. A completed advert is also put through this process in which customers, the director, and members of the board of directors, can give feedback.
- The advert review process should be managed by members of the creative team, because it will need to change regularly. The creative team would prefer not to have to wait for a developer to become available whenever a change is needed.
- The feedback collection process calls an on-premises SharePoint server. Because this server isn't as reliable as a cloud-based server would be, developers want to carefully control the way the workflow retries this connection, if there's a failure.
- You work for a company that makes TV adverts. You want to formalize two business processes:
-
Scenario 2 - Camera Company Merger
- You work for a company that makes digital cameras. The company has recently acquired a smaller company that makes lenses. You want to ensure that the same procedures are in use throughout the company for the following processes:
- Lens quality control. The company you acquired has a good reputation for lens reliability because of its quality control procedure. You want to implement this procedure across the merged company and integrate it with your parts ordering system, which includes a REST API.
- Ordering and dispatch. The company you acquired had no formal order and dispatch procedure, so you want to ensure its employees use your original business procedure. The ordering system has a user interface that is built as an Azure App service web app but you want to manage the order and dispatch workflow as a separate project.
- You've hired a small team of developers to do the work and you prefer a design-first approach.
- You work for a company that makes digital cameras. The company has recently acquired a smaller company that makes lenses. You want to ensure that the same procedures are in use throughout the company for the following processes:
-
Check your knowledge
- In the television advert company, which technology would you use for the advert review process?
- Microsoft Power Automate - allows the creative team members, who aren't developers, to manage the flow.
- Azure Logic Apps - doesn't permit the creative team, who aren't developers, to manage the process.
- Azure Functions
- Azure App Service WebJobs
- In the television advert company, which technology would you use for the feedback collection process?
- Microsoft Power Automate
- Azure Logic Apps
- Azure Functions
- Azure App Service WebJobs - permits developers to control retry policies.
- In the merged camera company, which technology would you use for the lens quality control procedure?
- Microsoft Power Automate
- Azure Logic Apps - is the only one of the 4 technologies that provides a design-first approach intended for developers.
- Azure Functions
- Azure App Service WebJobs
- In the merged camera company, which technology would you use for the ordering and dispatch procedure?
- Microsoft Power Automate
- Azure Logic Apps - is the only one of the 4 technologies that provides a design-first approach intended for developers.
- Azure Functions
- Azure App Service WebJobs - It's not necessary to write a WebJob as part of the existing Azure App Service application, because you want to manage the procedure code separately.
- In the television advert company, which technology would you use for the advert review process?