Controlling the initial state of a Logic App

Controlling the initial state of a Logic App

Sometimes I have the need to have a Logic App (LA) disabled when I deploy it. For instance, when deploying to Production, I like to have my LAs disabled, because I want to double check everything before starting the process.

This is helpful because usually, when using the “Recurrence” trigger, the LA will start immediately. If for some reason, a connector has the wrong configuration or is broken or the end system is offline, the execution will fail. Other scenarios can happen as well, but that’s another story.

An interesting fact is that you don’t have a proper way to control this in the Portal. You can add the control line to the code, but you won’t be able to control it with CI CD.

So, in comes Rocket science (or not).

The resource code contains a property that will allow you to control the state of a LA and it’s quite easy to set. If you do not specify this property, the LA will start enabled and will trigger if it can.

The property is called “state” and lies within the “properties” node. Setting this property as a global parameter, allows you to prepare your CI/CD pipeline also allowing to parameterize this in your release.

This is quite and easy and simple insert, that should take no more than 5 minutes for you to configure.

If you choose the “Disabled” state, the LA will not start unless you specifically activate it.

Happy coding!

The post Controlling the initial state of a Logic App appeared first on SANDRO PEREIRA BIZTALK BLOG.

December 28, 2020 Weekly Update on Microsoft Integration Platform & Azure iPaaS

December 28, 2020 Weekly Update on Microsoft Integration Platform & Azure iPaaS

Do you feel difficult to keep up to date on all the frequent updates and announcements in the Microsoft Integration platform and Azure iPaaS?

Integration weekly updates can be your solution. It’s a weekly update on the topics related to Integration – enterprise integration, robust & scalable messaging capabilities and Citizen Integration capabilities empowered by Microsoft platform to deliver value to the business.

Microsoft Announcements and Updates

Community Blog Posts

Videos

Podcasts

How to get started with iPaaS design & development in Azure?

  • Robust Cloud Integration with Azure
  • Microsoft Azure for Developers: What to Use When
  • Serverless Computing: The Big Picture
  • Azure Logic Apps: Getting Started
  • Azure Logic Apps: Fundamentals
  • Microsoft Azure Developer: Creating Enterprise Logic Apps
  • Microsoft Azure API Management Essentials
  • Azure Functions Fundamentals
  • Cloud Design Patterns for Azure: Availability and Resilience
  • Architecting for High Availability in Microsoft Azure

Feedback

Hope this would be helpful. Please feel free to reach out to me with your feedback and questions.

The post December 28, 2020 Weekly Update on Microsoft Integration Platform & Azure iPaaS appeared first on Hooking Stuff Together.

Merry Christmas & Happy New Year 2021

Merry Christmas & Happy New Year 2021

HO HO HO, yes, it is that magical time of the year again!… More than other years, this year Christmas is about spending time with close family, the small number possible and family members that you are in contact with every day to due this COVID 19 pandemic. It’s about creating happy memories that will last a lifetime, and we need it more than ever!

This was without a doubt a challenging year for everyone, a year not to forget but to learn and remember, and hoping to start 2021 with a blank page for us to write a better story.

To all my readers, friends, coworkers, customer, partners, to all Microsoft Integration and Azure Community (BizTalk Server, Logic Apps, API Management, Service Bus, and so on), MSFT Product Groups, all the Portuguese Communities, my MVP “family” and of course to my family, my sincere wishes for a Merry Christmas and a Happy New Year!

Thanks in advance for all the support and encouragement given throughout this year. I hope that the next will be a year filled with new distinct contributions. I promise that I will continue to share knowledge, hoping that they can help someone.

This year I had the privilege of receiving a surprise Christmas gift from good friends that intentionally or unintentionally (I believe it was intentional) combine two of my passions/hobbies:

  • Wine enthusiasm and the passion for exploring and taste new wines (you can find more in my Instagram account)
  • And my blog.

So I got this fantastic Blog (Black Label) 2016 Red Wine. Thanks for this amazing gift! No need to mention names. You know who you are 🙂

All the best for the coming year, and most importantly, stay safe!

The post Merry Christmas & Happy New Year 2021 appeared first on SANDRO PEREIRA BIZTALK BLOG.

Logic Apps: Moving from Azure Portal to Visual Studio

Logic Apps: Moving from Azure Portal to Visual Studio

Most developers start working with Logic Apps through Azure Portal, because it’s fast and direct. You just open the Portal, create your resource and start working. This is fine but it comes with a cost. There are several limitations to what you can do, specially when it comes to CI/CD (Continuous Integration/Continuous Delivery).

To handle this, there is the need to move to Visual Studio and start working from there. For this to happen, you need tools to help you and there’s a few available. In this post, I will approach a very good one and how to use it.

This tool is a collection of powershell scripts that will download to file your Logic App code and it also can create a parameters file.

The creator of this collection is Jeff Hollan, PM Lead for Microsoft. You can check his work at his GitHub repo. https://github.com/jeffhollan

The project that we’re going to use is LogicAppTemplateCreator. It’s a C# project that creates a DLL and that we will import and use.

https://github.com/jeffhollan/LogicAppTemplateCreator

Let’s begin our process. After cloning the solution and rebuilding it, the DLL will be in the usual folder ($sourcefolder/bin/debug/).

After the solution is built, open Powershell and import this DLL, using the following command:

 Import-Module C:{​​​​​​​pathToSolution}​​​​​​​LogicAppTemplateCreatorLogicAppTemplatebinDebugLogicAppTemplate.dll 

I dropped into a Shared folder, because I’ve referenced it in a Repo for other people to consume in our projects, but this is not necessary, although I recommend it so that it becomes easier for future developers in your company.

After executing this, you’ll be ready to download your ARM template. So, get your Resource Group ID, you Subscription ID and prepare an output folder. You will also need to enter your credentials to login by powershell.

The script should be changed according to your IDs. Do note that it should not be case sensitive. If you don’t set the Out-File, the output will be set in the powershell console, you’ll still be able to copy it and paste in a file, but it’s an unnecessary step.

armclient token {subscription ID} | Get-LogicAppTemplate -LogicApp {LogicAppName} -ResourceGroup {ResourceGroup} -SubscriptionId {subcriptionID}  | Out-File {ARMTemplateOutput}

After the ARM template is created, a parameter template file can be generated  by running the following script.

get-ParameterTemplate -GenerateExpression True -TemplateFile {ARMTemplateOutput} | Out-File {ParameterTemplateOutput}

You will now have both files you need to manage your Logic App, so just copy them to your VS Azure Resource Group project, with Logic Apps Template and you’re almost ready to go.

You will need to address the path links in the JSON code to make them CI/CD-able and fix the parameters in some connectors, but there’s not a lot of work to be done.

As you can see, the ARM template already provides all connection parameters and connections variables. I do recommend you changed them to a more appropriate naming convention like “arm_O365”, “arm_SQL” or “arm_ServiceBus”. This way you will know what it’s referring to with a very understandable pattern.

At the end of the day, your Logic App should be ready for deployment in your subscriptions and look something like this:

Happy coding!

The post Logic Apps: Moving from Azure Portal to Visual Studio appeared first on SANDRO PEREIRA BIZTALK BLOG.

December 21, 2020 Weekly Update on Microsoft Integration Platform & Azure iPaaS

December 21, 2020 Weekly Update on Microsoft Integration Platform & Azure iPaaS

Do you feel difficult to keep up to date on all the frequent updates and announcements in the Microsoft Integration platform and Azure iPaaS?

Integration weekly updates can be your solution. It’s a weekly update on the topics related to Integration – enterprise integration, robust & scalable messaging capabilities and Citizen Integration capabilities empowered by Microsoft platform to deliver value to the business.

Microsoft Announcements and Updates

Community Blog Posts

Videos

Podcasts

How to get started with iPaaS design & development in Azure?

  • Robust Cloud Integration with Azure
  • Microsoft Azure for Developers: What to Use When
  • Serverless Computing: The Big Picture
  • Azure Logic Apps: Getting Started
  • Azure Logic Apps: Fundamentals
  • Microsoft Azure Developer: Creating Enterprise Logic Apps
  • Microsoft Azure API Management Essentials
  • Azure Functions Fundamentals
  • Cloud Design Patterns for Azure: Availability and Resilience
  • Architecting for High Availability in Microsoft Azure

Feedback

Hope this would be helpful. Please feel free to reach out to me with your feedback and questions.

Recreating local folder structure with PowerShell

Recreating local folder structure with PowerShell

When migrating your BizTalk Server environment or deploy to a new or different environment, there are many different resources or configurations that you need to take into considerations like:

  • local queue creations
  • cloud queue creations
  • folder creations
  • and so on.

One of the common resources that we use on our integration solutions is local folders, whether for archiving or routing messages. I do not mean that it is a good practice or not. That you should do it or not, this is not the goal, only that this is common to happen.

In a first analysis, we could think that the quickest and most effective solution would be to copy and paste the folder structure from one environment to another. Still, it may not be the best solution in many cases since it may contain thousands of documents, which are unnecessary to copy/migrate.

This blog post will address how we can easily recreate a folder structure in a different environment/server using PowerShell.

PowerShell script to recreate a local folder structure

With this PowerShell sample, we will be able to recreate an existing local folder structure on a different BizTalk Server environment.

$folderList = Get-ChildItem -Path $path -Recurse -Directory -Force -ErrorAction SilentlyContinue | Select-Object FullName

foreach ($folder in $folderList)
{
    $powerShellCommand = 'New-Item -ItemType Directory -Path "'+$folder.FullName+'"' 
    Add-Content -Path $scriptPath -Value $powerShellCommand 
}

The output of this PowerShell script will be a creation of a different PS script containing the instructions that you can use to recreate all the folder structures in different environments.

New-Item -ItemType Directory -Path "D:BiztalkFilePortsAPP1"
New-Item -ItemType Directory -Path "D:BiztalkFilePortsAPP2"
New-Item -ItemType Directory -Path "D:BiztalkFilePortsAPP3Inbox"
New-Item -ItemType Directory -Path "D:BiztalkFilePortsAPP3Outbox"
New-Item -ItemType Directory -Path "D:BiztalkFilePortsAPP3OutboxFLD1"
New-Item -ItemType Directory -Path "D:BiztalkFilePortsAPP3OutboxFLD2"
New-Item -ItemType Directory -Path "D:BiztalkFilePortsAPP4Inbox"
New-Item -ItemType Directory -Path "D:BiztalkFilePortsAPP4Outbox"

THIS POWERSHELL IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.

Extract a folder structure and automatically generate a PowerShell script to recreate the folder scturure on a different server with PowerShellExtract a folder structure and automatically generate a PowerShell script to recreate the folder scturure on a different server with PowerShell
GitHub

The post Recreating local folder structure with PowerShell appeared first on SANDRO PEREIRA BIZTALK BLOG.

Deploying local queues (MSMQ) with PowerShell

When migrating your BizTalk Server environment or deploy to a new or different environment, there are many different resources or configurations that you need to take into considerations like:

  • local queue creations
  • cloud queue creations
  • folder creations
  • and so on.

In this blog post, I will address how we can easily “export” a list of existing local private Message Queues (MSMQ) and recreate them, and set proper permissions in a different environment/server.

PowerShell script to extract a list of all private Message Queues (MSMQ) names

With this PowerShell sample, we will be able to extract a list of all private Message Queues (MSMQ) names to a CSV file to be used on a different script to deployed these resources on a different BizTalk Server environment.

set or update the URI (address) or part of the URI on a list of BizTalk Server Receive Locations deployed in your BizTalk Server environment.

Get-MsmqQueue -QueueType Private | 
Select-Object QueueName, Transactional, UseJournalQueue | 
Export-Csv -Path c:tempqueues.csv -Encoding ascii -NoTypeInformation

THIS POWERSHELL SCRIPT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.

You can download this script here: Extract a list of all Private Message Queuing (MSMQ) names to a CSV file with PowerShell

PowerShell script to create private Message Queues (MSMQ)

With this PowerShell sample, we will be able to create local Private Message Queues (MSMQ) and set proper permissions on a different BizTalk Server environment.

New-MsmqQueue -Name $queueName -Label $queueName -QueueType $queueType -Transactional | 
                Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl

THIS POWERSHELL SCRIPT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.

You can download this script here: Create local Private Message Queuing (MSMQ) and set proper permissions with PowerShell

The post Deploying local queues (MSMQ) with PowerShell appeared first on SANDRO PEREIRA BIZTALK BLOG.

What’s new in BizTalk Server 2020: Audit Logs

What’s new in BizTalk Server 2020: Audit Logs

Starting with BizTalk Server 2020 and newer, administrators can configure BizTalk Server to generate an audit trail for management operation on application artifacts, such as to send ports, receive ports, receive locations, orchestrations, and resources. Auditing of suspend/resume/terminate operations on service instances is also possible.

This feature may not be perfect yet, and it has space to grow in the future, but it is a good start, and I hope the BizTalk product team will improve these capabilities in the future.

How to configure the Audit Logs?

The auditing feature isn’t enabled by default. To enable auditing you need to:

  • Open BizTalk Server Administration console, right-click the BizTalk Group, and select Settings
  • On the Group panel, under the Tracking and Reporting section:
    • Enable the Audit management operations option.
    • And set a Maximum number of audit entries property according to your needs. By default, BizTalk stores 10000 most recent entries.
  • Select OK to save your changes.

Now every time you make the following operations:

  • On Ports (Receive or Send): Create, Update and Delete
  • On Service Instances: Suspend, Resume and Terminate
  • On Application resource: Add, Update and Remove
  • On Bindings: Import bindings files

One or more audit entries are logged. All these correlation entries have the same BatchId. The audit log has the following information:

Property Description
ID Id of type Guid, unique per entry. Example: 3bf539a3-4b59-4148-b589-d22c83f32d25
BatchId Same for all audited operations performed in a single SQL transaction. Insightful in correlating user operations with lower level details Example: a4ffa64b-8064-4e54-9d99-2e7d60797100
UserPrincipal User who performed the operation. Example: BTS2020LAB01Administrator
Machine Machine name from which operation was performed. Example: BTS2020LAB01
ArtifactId Unique id of the artifact. Example: 1
ParentArtifactId If an artifact is child of another artifact, then this field will have artifact id of the parent. Example: 1
ArtifactType Type of artifact on which operation was performed. Example: SendPort, ReceiveLocation, etc.
ArtifactName User configured name of the artifact. Example: BatchControlMessageRecvLoc
OperationName Action performed on the artifact. Example: Ports: Create/Update/DeleteService Instances: Suspend/Resume/TerminateApplication resources: Add/Update/RemoveBinding file: Import
Payload Contains information about what is changed in JSON structure. Example: {  “Disabled”: 0 }  
CreatedDate Timestamp when the operation was performed Example: 2020-11-27T09:21:48.55Z

How to view the audit logs?

The easier way to access the BizTalk Server Audit logs is to access the Audit Logs REST service using your browser by using the following URL:

  • GET http://localhost/BizTalkOperationalDataService/AuditLogs

This will provide a JSON response containing all the latest logs. 

For a better user experience, you could use a tool like postman to interact with this service:

You can also define a date range to retrieve the desire logs. For that you should use the following query parameters:

  • fromDate: beginning date, for example, 2020-12-01T01:00:00
  • toDate: end date, for example, 2020-12-03T01:00:00

GET request example:

  • GET http://localhost/BizTalkOperationalDataService/AuditLogs?fromDate=2020-12-01T01:00:00&toDate=2020-12-03T01:00:00

Supported date formats are: yyyy-MM-dd or yyyy-MM-ddThh:mm:ss.

The post What’s new in BizTalk Server 2020: Audit Logs appeared first on SANDRO PEREIRA BIZTALK BLOG.

Logic Apps: Development Experiences video and slides are available at Integration Monday

Logic Apps: Development Experiences video and slides are available at Integration Monday

It was with great pleasure that I presented on December 7, 2020, another session in the Integration Monday series, this time about Logic Apps: Development Experiences. I had the pleasure to be accompanied as a co-presenter for the first time by my team member, Pedro Almeida.

Logic Apps: Development Experiences

How can I start developing Logic Apps? What are the different tools I can use? What are the advantages and drawbacks of each developer approach? What are the deployment options that I have? These are some of the questions that we will answer in this session, along with several tips that will improve your Logic Apps development experience.

I hope you enjoy it and find it an interesting session. Also, I advise you to visit and view the history of sessions that have taken place every Monday in the Integration User Group – Integration Monday series.

My other talks at Integration Monday – Integration User Group

The post Logic Apps: Development Experiences video and slides are available at Integration Monday appeared first on SANDRO PEREIRA BIZTALK BLOG.

December 14, 2020 Weekly Update on Microsoft Integration Platform & Azure iPaaS

December 14, 2020 Weekly Update on Microsoft Integration Platform & Azure iPaaS

Do you feel difficult to keep up to date on all the frequent updates and announcements in the Microsoft Integration platform and Azure iPaaS?

Integration weekly update can be your solution. It’s a weekly update on the topics related to Integration – enterprise integration, robust & scalable messaging capabilities and Citizen Integration capabilities empowered by Microsoft platform to deliver value to the business.

Microsoft Announcements and Updates

Community Blog Posts

Videos

Podcasts

How to get started with iPaaS design & development in Azure?

  • Robust Cloud Integration with Azure
  • Microsoft Azure for Developers: What to Use When
  • Serverless Computing: The Big Picture
  • Azure Logic Apps: Getting Started
  • Azure Logic Apps: Fundamentals
  • Microsoft Azure Developer: Creating Enterprise Logic Apps
  • Microsoft Azure API Management Essentials
  • Azure Functions Fundamentals
  • Cloud Design Patterns for Azure: Availability and Resilience
  • Architecting for High Availability in Microsoft Azure

Feedback

Hope this would be helpful. Please feel free to reach out to me with your feedback and questions.