Best practices for queries used in log alerts rules

Queries can start with either a table name like “search” or “union *” operators. These commands are useful during data exploration and for searching terms over the entire data model. However, these operators are not efficient for productization in alerts. Log alerts rules queries in Log Analytics and Application Insights should always start with table(s), this is to define a clear scope for the query execution to specific table(s). It also improves both query performance and relevance of the results. You can learn more by visiting our documentation, “Query best practices.”

Note that using cross-resource queries in log alerts rules is not considered inefficient although “union” operator is used. The “union” in cross-resource queries is scoped to specific resources and tables as shown in this example, while the query scope for “union *” is the entire data model.

Union

app('Contoso-app1').requests,

app('Contoso-app2').requests,

workspace('Contoso-workspace1').Perf

After data exploration and query authoring, you may want to create a log alert using that query. These examples show how you can modify queries and avoid “search” and “union *” commands.

Example 1

You want to create log alert on the following query.

search ObjectName == 'Memory' and (CounterName == '% Committed Bytes In Use' or CounterName == '% Used Memory') and TimeGenerated > ago(5m)

| summarize Avg_Memory_Usage =avg(CounterValue) by Computer

| where Avg_Memory_Usage between(90 .. 95)

| count

To author a valid alert query without the use of “search” operator, follow these steps:

1. Identify the table that the properties are hosted in.

search ObjectName == 'Memory' and (CounterName == '% Committed Bytes In Use' or CounterName == '% Used Memory')

| summarize by $table

The result indicates that these properties belong to Perf table.

 

 

 

2. Since the properties used in the query are from Perf table, the query should start with it and scope the query execution to that table.

Perf

| where ObjectName == 'Memory' and (CounterName == '% Committed Bytes In Use' or CounterName == '% Used Memory') and TimeGenerated > ago(5m)

| summarize Avg_Memory_Usage=avg(CounterValue) by Computer

| where Avg_Memory_Usage between(90 .. 95)

| count

Example 2

You want to create log alert on the following query.

search (ObjectName == 'Processor' and CounterName == '% Idle Time' and InstanceName == '_Total')

| where Computer !in ((union * | where CounterName == '% Processor Utility' | summarize by Computer)) | summarize Avg_Idle_Time = avg(CounterValue) by Computer, CounterPath | where Avg_Idle_Time < 5 | count

To modify the query, follow these steps:

1. Since the query makes a use of both “search” and “union *” operators, you need to identify the tables hosting the properties in two stages.

search (ObjectName == 'Processor' and CounterName == '% Idle Time' and InstanceName == '_Total')

| summarize by $table

The properties of the first part of the query belong to Perf table.

 

 

 

Note, the “withsource = table” command adds a column that designates the table name that hosts the property.

union withsource = table * | where CounterName == '% Processor Utility'

| summarize by table

The properties of the second part of the query also belong to Perf table.

 

2. Since the properties used in the query are from Perf table, both outer and inner queries start with Perf table and scope the query execution to that table.

Perf

| where ObjectName == 'Processor' and CounterName == '% Idle Time' and InstanceName == '_Total'

| where Computer !in ((Perf | where CounterName == '% Processor Utility' | summarize by Computer))

| summarize Avg_Idle_Time = avg(CounterValue) by Computer, CounterPath

| where Avg_Idle_Time < 5

| count
Quelle: Azure

How to migrate from AzureRM to Az in Azure PowerShell

On December 18, 2018, the Azure PowerShell team released the first stable version of “Az,” a new cross-platform PowerShell module that will replace AzureRM. You can install this module by running “Install-Module Az” in an elevated PowerShell prompt.

Since January 2018, PowerShell has been a cross-platform product with the introduction of PowerShell Core. Therefore, it has also become a priority for Azure PowerShell to have cross-platform support. Because of the changes required to support running Azure PowerShell cross-platform, we decided to create a new module rather than make modifications to the existing AzureRM module. Moving forward, all new functionality will be added to the Az module, while AzureRM will only be updated with bug fixes.

Configure Az in your environment

Because both Az and AzureRM use the same dependencies with different versions, it is not possible to run Az and AzureRM side by side in the same PowerShell session. Thus, Az and AzureRM cmdlets cannot be used together in scripts and in interactive sessions. To ensure that a script does not try to import both Az and AzureRM modules in the same session, if you do not have many existing scripts that use AzureRM, we recommend that you remove all AzureRM modules from your machine after installing Az. For your convenience, we have created the “Uninstall-AzureRm” cmdlet, located in in the new Az module. To use this cmdlet, please ensure that all PowerShell sessions in which AzureRM modules are imported have been closed, then run “Uninstall-AzureRm” in an elevated PowerShell session.

What about your existing Azure PowerShell scripts?

If you would like to continue using AzureRM for your existing scripts while also writing new scripts using Az then you have two possible options.

Option 1 – Install PowerShell Core 6

One option is to install Az on PowerShell Core 6 while continuing to use AzureRM on Windows PowerShell 5.1. This will allow you to run your existing AzureRM scripts on Windows PowerShell 5.1 without the possibility of running into issues where AzureRM and Az are imported in the same session.

Option 2 – Explicit module loading

Alternatively, if you cannot install PowerShell 6 on your machine, please ensure that you explicitly require either the Az or the AzureRM modules you intend to use at the beginning of each script, making certain that the modules required are not from both AzureRM and Az. To turn off warnings about the side by side installation of AzureRM and Az, please add “$env:SkipAzInstallationChecks=true” to your PowerShell profile.

Using the AzureRM aliases with Az

To simplify and normalize our cmdlet names, we have changed the prefix from AzureRM and Azure to Az for every cmdlet in the new Az modules. To enable preexisting scripts that were written for AzureRM to successfully execute in Az, we have written a cmdlet, “Enable-AzureRmAlias,” to create aliases to the old cmdlet names. This cmdlet includes a Scope parameter, which allows you to select whether the aliases should be created for only the current session or for all future sessions. Additionally, you can import aliases for specific modules using the “Module” parameter. Once your scripts have been converted to use “Az” prefixes, aliases can be turned off using the “Disable-AzureRmAlias” cmdlet. All new cmdlets added to the Az modules will not have these AzureRM aliases, so all new scripts should use the “Az” prefix syntax.

Az on CloudShell

If you are looking for a quick way to test out the new Az modules interactively, CloudShell will now be shipping with the new Az modules. CloudShell is a great option as it runs everywhere and doesn’t require an install so you can keep your environment untouched while trying out all the new Az features. Simply navigate to the PowerShell tab within a CloudShell session, and all Az modules will be automatically installed into your session.

Try it out

We want the new Az module to enable you to be more productive and efficient in managing Azure from any platform or operating system. Therefore, we would like to invite you to try out the new cross-platform module and we look forward to getting your feedback, suggestions or issues via the built-in “Send-Feedback” cmdlet, which is available in both AzureRM and the new Az module. Alternatively, you can always open an issue in our GitHub repository.
Quelle: Azure

Top 3 free resources developers need for learning Azure

In this post, I’ll cover three free resources every developer needs for learning Azure. Dan Fernandez leads the team responsible for bringing our technical documentation and learning resources into a more modern experience that supports new capabilities that were impossible to deliver via MSDN. Recently, I invited Dan to record a few episodes of Azure Friday with Donovan Brown and spend some time showing off the work his team is doing to provide the best doc and learning experience.

1. Microsoft Docs

Last December, I wrote 4 tips for learning Azure in the new year, in which I included links to several resources, including the Azure documentation. In that post, I admit that I did a disservice by glossing over the revolution that Microsoft Docs truly represents – both internally and externally. Not only did it radically change how we create documentation, it improved how you can learn and use Azure.

Learning Azure: Part 1—Azure Docs tips and tricks

Did you know that the Azure docs are not only open source, but it’s currently the fastest growing project on GitHub? In this episode, Dan shows off some cool features, a few tips & tricks, how you can contribute, and a few buried treasures.

Azure documentation
Microsoft Docs contributor guide overview

Learning Azure: Part 2—Architecture and interactive APIs for .NET and REST APIs

Whether you’re trying to wrap your head around architectural concepts, or you need to get down into the nitty-gritty of understanding a particular API, Dan shows how Azure Docs has you covered.

Azure Architecture Center
Interactive code snippets in String.Format Method (System)
Cognitive Toolkit Python API Package Reference
Microsoft Cognitive Toolkit (CNTK) on GitHub
List Resource Groups interactive REST API

Unified Microsoft API references:

.NET API Browser
REST API Browser
Java API Browser
JavaScript API Browser
Python API Browser
PowerShell Module Browser

2. Microsoft Learn

Learning Azure: Part 3—A quick tour of Microsoft Learn

At Microsoft Ignite 2018, the team working on Microsoft Docs delivered a new approach to learning with Microsoft Learn, which added a new dimension to what's available for those seeking to learn Azure.

Dan gives a quick tour of Microsoft Learn. With Microsoft Learn, you learn-by-doing with interactive, step-by-step tutorials creating real resources in Azure. Even better – it’s free, and no credit card is required.

Microsoft Learn
A Tour of Microsoft Learn
Microsoft Learn Azure Content
Azure Fundamentals Learning Path

Microsoft Docs and Microsoft Learn are the bedrock for Azure technical content. Several of our documentation sets are open source, hosted on GitHub. More teams at Microsoft are adopting this model all the time. Even document sets that are not entirely open source have public-facing repos where we invite you to make pull requests. And Microsoft Learn will continue to grow, expanding into new areas and going deeper past the fundamentals to more advanced topics.

3. The Developer’s Guide to Azure

The most recent update to The Developer’s Guide to Azure includes cover-to-cover improvements that you shouldn't miss. Written by developers (Michael Crump at Microsoft and Azure MVP Barry Luijbregts) for developers, this guide will show you how to get started with Azure and which services you can use to run your applications, store your data, incorporate intelligence, build IoT apps, and deploy your solutions more efficiently and securely.

Quelle: Azure

Virtual Network Service Endpoints for serverless messaging and big data

This blog was co-authored by Sumeet Mittal, Senior Program Manager, Azure Networking.

Earlier this year in July, we announced the public preview for Virtual Network Service Endpoints and Firewall rules for both Azure Event Hubs and Azure Service Bus. Today, we’re excited to announce that we are making these capabilities generally available to our customers.

This feature adds to the security and control Azure customers have over their cloud environments. Now, traffic from your virtual network to your Azure Service Bus Premium namespaces and Standard and Dedicated Azure Event Hubs namespaces can be kept secure from public Internet access and completely private on the Azure backbone network.

Virtual Network Service Endpoints do this by extending your virtual network private address space and the identity of your virtual network to your virtual networks. Customers dealing with PII (Financial Services, Insurance, etc.) or looking to further secure access to their cloud visible resources will benefit the most from this feature. For more details on the finer workings of Virtual Network service endpoints, refer to the documentation.

Firewall rules further allow a specific IP address or a specified range of IP addresses to access the resources.

Virtual Network Service Endpoints and Firewall rules are supported for the tiers listed below for all public regions at no extra cost.

Service
Tier

Azure Service Bus
Premium tier

Azure Event Hubs
Standard and Dedicated tier

Azure Event Hubs, a highly reliable and easily scalable data streaming service, and Azure Service Bus, which provides enterprise messaging, are the new set of serverless offerings joining the growing list of Azure services that have enabled Virtual Network Service Endpoints.

To get more details on these features, please visit the documentation links below:

Azure Service Bus Virtual Network Service Endpoints and Firewall rules
Azure Event Hubs Virtual Network Service Endpoints and Firewall rules

For step by step guidance on how to integrate Virtual Networks service endpoints and set up Firewalls (IP Filtering), check out the tutorial, “Enable Virtual Networks Integration and Firewalls on Event Hubs namespace.”
Quelle: Azure

Azure Backup can automatically protect SQL databases in Azure VM through auto-protect

We are excited to share the auto-protection capability for SQL Server in Azure Virtual Machines (VM). This is a key addition to the public preview of Azure Backup for SQL Server on Azure VM, announced earlier this year. Azure Backup for SQL Server is an enterprise credible, zero-infrastructure pay as you go (PAYG) service that leverages native SQL backup and restore APIs to provide a comprehensive solution to backup SQL servers running in Azure VMs.

What happens when you add a new database to your protected SQL Server? You need to rediscover the database and then manually trigger configure protection to backup that database. Now imagine if we take away the work from you and automatically detect and protect each new database you add to the instance. Our new auto-protection feature does just that.

Auto-protection is a capability that lets you automatically protect all the databases in a standalone SQL Server instance or a SQL Server Always On availability group. Not only does it enable backups for the existing databases, but it also protects all the databases that you may add in future.

Getting started

You can enable auto-protection for the desired SQL Server instance or Always On availability group under Configure Backup for SQL Server in Azure VM. When enabled, all the databases for that SQL Server will automatically be selected. You can then define the backup policy for the selected databases. After you associate the policy, you can see the newly protected databases under the Backup items.

Thus, if there is a significant addition or deletion of databases in your environment, auto-protection capability will save you time and effort by automatically discovering and protecting the new databases.

Related links and additional content

Learn more about auto-protection by referring to our documentation on Backup SQL Server databases to Azure.
Learn more about Azure Backup.
Want more details? Check out the Azure Backup documentation.
Need help? Reach out to the Azure Backup forum for support.
Tell us how we can improve Azure Backup by contributing new ideas and voting up existing ones.
Follow us on Twitter @AzureBackup for latest news and updates.

Quelle: Azure

Azure PowerShell ‘Az’ Module version 1.0

There is a new Azure PowerShell module that is built to harness the power of PowerShell Core and Cloud Shell and maintain compatibility with Windows PowerShell 5.1. Its name is “Az.” Az ensures that Windows PowerShell and PowerShell Core users can get the latest Azure tooling in every PowerShell on every platform. Az also simplifies and normalizes Azure PowerShell cmdlet and module names. Az ships in Azure Cloud Shell and is available from the PowerShell Gallery. 

The Az module version 1.0 was released on December 18, 2018, and will be updated on a two-week cadence in 2019, starting with a January 15, 2019 release.

As with all Azure PowerShell modules, Az uses semantic versioning and implements a strict breaking change policy – all breaking changes require advance customer notice and can only occur during breaking change releases. 

For complete details on the release, timeline, and compatibility features, check out the Az announcement page.

New features

Az runs on Windows PowerShell 5.1 and PowerShell Core (cross-platform)
Az is always up to date with the latest tooling for Azure services
Az ships in Cloud Shell
Az shortens and normalizes cmdlet names – all cmdlets use ‘Az’ as their noun prefix
Az simplifies and normalizes module names – data plane and management plane cmdlets for each service use the same Az module
Az ships with new cmdlets to enable script compatibility with AzureRM (Enable/Disable-AzureRmAlias)
Az enables device code authentication support, allowing login when remoting via a terminal to another computer, VM, or container

You can find complete details on the Az roadmap and features on the Az announcement page.

Migrating from AzureRM

Users are not required to migrate from AzureRM, as AzureRM will continue to be supported. However, it is important to note that all new Azure PowerShell features will appear only in ‘Az’. Az has new features to ease migration, and these are discussed in depth in the Az 1.0 Migration Guide. If you have scripts written for AzureRM, there are three paths for migration

Convert existing scripts to Az – For users that mainly use Azure PowerShell interactively and have few scripts, the simplest option is to remove AzureRM when installing Az. You can use the ‘Uninstall-AzureRm’ cmdlet that is included with the Az module to do this. 
Keep Az and AzureRM scripts separate and run in separate sessions – Az and AzureRM cannot be executed in the same PowerShell session. However, if you are careful that your scripts use either Az or AzureRM, you can have both modules installed and run scripts using each module in separate sessions. 
Install Az in PowerShell Core – since PowerShell Core is installed side-by-side with Windows PowerShell 5.1, you can install Az in PowerShell Core without impacting any existing AzureRM scripts running in Windows PowerShell 5.1. See the Installation Guide for PowerShell Core on Windows for details.

Authentication changes

The Az module is cross-platform, and so some authentication mechanisms supported by Connect-AzureRmAccount have been changed or removed in the Az 1.0 version of the Connect-AzAccount cmdlet, as they are not supported on all platforms. Some of these authentication mechanisms will be enabled in future versions:

Support for user login with PSCredential: This capability is currently disabled in Az 1.0, but will be enabled in the January 15, 2019 release for Windows PowerShell 5.1 only. This scenario is discouraged as a mechanism for authenticating scripts, except in limited circumstances. Instead, scripts should use Service Principal authentication as described in “Sign In with Azure PowerShell.”
Support for interactive login using the automatic sign-in dialog: In AzureRM, interactive user sign-in automatically displays a web page where the user enters credentials. In Az 1.0, this is replaced with device code authentication, in which the user opens a browser to the device login page and enters a code before providing credentials, as shown in the graphic below.

Interactive login with automatic web page login display will be enabled for Windows PowerShell 5.1 only in the January 15, 2019 release and will be supported across all platforms in early 2019.

Azure Automation support

The Az module can run in Windows PowerShell 5.1, but requires .NET Framework version 4.7.2 or later. Azure Automation cloud workers currently support .NET Framework version 4.6.1. Azure Automation is updating their cloud workers to support .NET version 4.7.2, and until these new workers are deployed, Az cannot be used in Azure Automation cloud runbooks. 

The Azure Automation team plans to deploy cloud workers supporting .NET 4.7.2 to all Azure environments and regions by March 15, 2019. You should expect to see more announcements as this rollout progresses in the new year. You can find more information on the Az announcement page.

Try it out

Az, which is open source, shipped version 1.0 on December 18, 2018. You can install Az from the PowerShell Gallery and if you want to go through the code then you can check the Azure PowerShell GitHub repository.

We would like to invite you to install and try the new, cross-platform Az module and we look forward to hearing your questions, comments, or issues with Az either by using the built-in Send-Feedback cmdlet, or via GitHub by submitting an issue.
Quelle: Azure

Transparent Data Encryption (TDE) with customer managed keys for Managed Instance

We are excited to announce the public preview of Transparent Data Encryption (TDE) with Bring Your Own Key (BYOK) support for Microsoft Azure SQL Database Managed Instance. Azure SQL Database Managed Instance is a new deployment option in SQL Database that combines the best of on-premises SQL Server with the operational and financial benefits of an intelligent, fully-managed relational database service. 

TDE with BYOK support has been generally available for single databases and elastic pools since April 2018. It is one of the most frequently requested capabilities by enterprise customers who are looking to protect data at rest, or meet regulatory and compliance obligations that require implementation of specific key management controls. TDE with BYOK support is offered in addition to TDE with service managed keys which is enabled on all new Azure SQL Databases, single databases, pools, and managed instances by default.

TDE with BYOK support uses Azure Key Vault, which provides highly available and scalable secure storage for RSA cryptographic keys backed by FIPS 140-2 Level 2 validated hardware security modules (HSMs). Azure Key Vault streamlines the key management process and enables customers to maintain full control of encryption keys, including managing and auditing key access.

Customers can generate and import their RSA key to Azure Key Vault and use it with Azure SQL Database TDE with BYOK support for their managed instances. Azure SQL Database handles the encryption and decryption of data stored in databases, log files, and backups in a fully transparent fashion by using a symmetric Database Encryption Key (DEK) which is in turn protected using the customer managed key called TDE Protector stored in Azure Key Vault.

Customers can rotate the TDE Protector in Azure Key Vault to meet their specific security requirements or any industry specific compliance obligations. When the TDE Protector is rotated, Azure SQL Database detects the new key version within minutes and re-encrypts the DEK used to encrypt data stored in databases. This does not result in re-encryption of the actual data and there is no other action required from the user.

Customers can also revoke access to encrypted managed instances by revoking access to the managed instance’s TDE Protector stored in Azure Key Vault. There are several ways to revoke access to keys stored in Azure Key Vault. Please refer to the Azure Key Vault PowerShell and Azure Key Vault CLI documentation for more details. Revoking access in Azure Key Vault will effectively block access to all databases when the TDE Protector is inaccessible by the Azure SQL Database managed instance.

Azure SQL Database requires soft delete to be enabled in Azure Key Vault to protect the TDE Protector against accidental deletion.

You can get started today by visiting the Azure portal, reviewing REST API for Managed Instance, and the how-to guide for using PowerShell documentation. To learn more about the feature including best practices and to review our configuration checklist see our documentation “Azure SQL Transparent Data Encryption: Bring Your Own Key support.”
Quelle: Azure

Participate in the 16th Developer Economics Survey

The Developer Economics Q4 2018 survey is here in its 16th edition to shed light on the future of the software industry. Every year more than 40,000 developers around the world participate in this survey, so this is a chance to be part of something big, voice your thoughts, and make your contribution to the developer community. This edition introduces questions about ethics, privacy, security, and project management methodologies in software development.

Is this survey for me?

The Developer Economics Q4 2018 survey is for all developers (professionals, hobbyists, and students) engaging in the following software development areas: web, mobile, desktop, backend services, IoT, AR/VR, machine learning and data science, and gaming.

What questions am I likely to be asked?

The survey asks questions related to developer skills, and experiences with dev tools, platforms, frameworks, resources, and more.

Your background and skills for demographics
What’s going up and what’s going down in the software industry?
Are you working on the projects you would like to work on?
Where do you think development time should be invested?
Which are your favorite tools and platforms?

Also, keep an eye out for some technology trivia interspersed in the survey. You may learn something new.

What’s in it for me?

Here’s what you get for sharing your mind:

Everyone who completes the survey is eligible to win one of the following: Samsung S9 Plus, $25 Udemy vouchers, Filco (Ninja Majestouch-2 Tenkeyless NKR Tactile Action Keyboard), Axure RP8 Pro one year license, Samsung 970 EVO 500GB V-NAND M.2 PCI Express Solid State Drive, $200 towards the software subscription of your choice, Oculus Rift and Touch Virtual Reality System, mug with your AI Character on it, T-shirt with your AI Character on it, $100 USD Prepaid Virtual Visa card
A copy of the State of the Developer Nation 16th edition report with the key findings of the survey (when it's published), so you know how your responses match with other developers
Access to Developer Benchmarks, showing you Q4 2018 developer trends in your region

For each completed response to the survey, they’ll also donate money to the Raspberry Pi Foundation. Complete the survey and help us support a good cause!

What’s in it for Microsoft?

The Developer Economics Q4 2018 survey is an independent survey from SlashData, an analyst firm in the developer economy that tracks global software developer trends. We’re interested in seeing the report that comes from this survey, and we want to ensure the broadest developer audience participates.

Of course, any data collected by this survey is between you and SlashData. You should review their Terms and Conditions page to learn more about the awarding of prizes, their data privacy policy, and how SlashData will handle your data.

Ready to go?

The survey is open until Monday, January 14, 2019.

Take the survey today.

The survey is available in English, Chinese (Simplified and Traditional), Spanish, Portuguese, Vietnamese, Russian, Japanese, and Korean.
Quelle: Azure

Microsoft open sources Trill to deliver insights on a trillion events a day

In today’s high-speed environment, being able to process massive amounts of data each millisecond is becoming a common business requirement. We are excited to be announcing that an internal Microsoft project known as Trill for processing “a trillion events per day” is now being open sourced to address this growing trend.

Here are just a few of the reasons why developers love Trill:

As a single-node engine library, any .NET application, service, or platform can easily use Trill and start processing queries.
A temporal query language allows users to express complex queries over real-time and/or offline data sets.
Trill’s high performance across its intended usage scenarios means users get results with incredible speed and low latency. For example, filters operate at memory bandwidth speeds up to several billions of events per second, while grouped aggregates operate at 10 to 100 million events per second.

A rich history

Trill started as a research project at Microsoft Research in 2012, and since then, has been extensively described in research papers such as VLDB and the IEEE Data Engineering Bulletin. The roots of Trill’s language lie in Microsoft’s former service StreamInsight, a powerful platform allowing developers to develop and deploy complex event processing applications. Both systems are based off an extended query and data model that extends the relational model with a time component.

While systems prior to Trill only achieved subsets of these benefits, Trill provides all these advantages in one package. Trill was the first streaming engine to incorporate techniques and algorithms that process events in small batches of data based on the latency tolerated by the user. It was also the first engine to organize those batches in columnar format, enabling queries to execute much more efficiently than before. To users, working with Trill is the same as working with any .NET library, so there is no need to leave the .NET environment. Users can embed Trill within a variety of distributed processing infrastructures such as Orleans and a streaming version of Microsoft’s SCOPE data processing infrastructure.

Trill works equally well over real-time and offline datasets, achieving best of breed performance across the spectrum. This makes it the engine of choice for users who just want one tool for all their analyses. The highly expressive power of Trill’s language allows users to perform advanced time-oriented analytics over a rich range of window specifications, as well as look for complex patterns over streaming datasets.

After its launch and initial deployment across Microsoft, the Trill project moved from Microsoft Research to the Azure Data product team and became a key component of some of the largest mission-critical streaming pipelines within Microsoft.

Powering mission-critical streaming pipelines

Trill powers internal applications and external services, reaching thousands of developers. A number of powerful, streaming services are already being powered by Trill, including:

Financial Fabric

“Trill enables Financial Fabric to provide real-time portfolio & risk analytics on streaming investment data, fundamentally changing the way financial analytics on high volume and velocity datasets are delivered to fund managers.” – Paul A. Stirpe, Ph.D., Chief Technology Officer, Financial Fabric

Bing Ads

“Trill has enabled us to process large scale data in petabytes, within a few minutes and near real-time compared to traditional processing that would give us results in 24 plus hours. The key capabilities that differentiate Trill in our view are the ability to do complex event processing, clean APIs for tracking and debugging, and the ability to run the stream processing pipeline continuously using temporal semantics. Without Trill, we would have been struggling to get streaming at scale, especially with the additional complex requirements we have for our specific big data processing needs.” – Rajesh Nagpal, Principal Program Manager, Bing

“Trill is the centerpiece of our stream processing system for ads in Bing. We are able to construct and execute complex business scenarios with ease because of its powerful, consistent data model and expressive query language. What’s more is its design for performance, Trill lives up to its namesake of “trillions of events per day” because it can easily process extremely large volumes of data and operate against terabytes of state, even in queries that contain hundreds of operators.” – Daniel Musgrave, Principal Software Engineer, Bing

Azure Stream Analytics

“Azure Stream Analytics went from the first line of code to public preview within 10 months by using Trill as the on-node processing engine. The library form factor conveniently integrates with our distributed processing framework and input/output adaptors. Our SQL compiler simply compiles SQL queries to Trill expressions, which takes care of the intricacies of the temporal semantics. It is a beautiful programming model and high-performance engine to use. In the near future, we are considering exposing Trill’s programming model through our user defined operator model so that all of our customers can take advantage of the expressive power.” – Zhong Chen, Principal Group Engineering Manager, Azure Data.

Halo

“Trill has been intrinsic to our data processing pipeline since the day we introduced it into our services back in 2013. Its impact has been felt by any player who has picked up the sticks to play a game of Halo. Their data dense game telemetry flows through our pipelines and into the Trill engine within our services. From finding anomalous and interesting experiences to providing frontline defense against bad behavior, Trill continues to be a stalwart in our data processing pipeline.” – Mike Malyuk, Senior Software Engineer, Halo

There are many other examples of Trill enabling streaming at scale, including Exchange, Azure Networking, and telemetry analysis in Windows.

Open-sourcing Trill

We believe there is no equivalent to Trill available in the developer community today. In particular, by open-sourcing Trill we want to offer the power of the IStreamable abstraction to all customers the same way that IEnumerable and IObservable are available. We hope that Trill and IStreamable will provide a strong foundation for streaming or temporal processing for current and future open-source offerings.

We also have many opportunities for community involvement in the future development of Trill. First, one of Trill’s extensibility points is that it allows users to write custom aggregates. Trill’s internal aggregates are implemented in the same framework as user-defined ones. Every aggregate uses the same underlying high-performance architecture with no special cases. While Trill has a wide variety of aggregates already, there are countless others that could be added, especially in verticals such as finance.

There are also several research projects built on top of Trill where the code exists but is not yet in product-ready form. Three projects at the top of our working list include:

Digital signal processing with the capability and performance normally seen in R or better.
An improved ability to handle out of order data for allowing users to specify multiple levels of latency.
Allowing operator state to be managed using the recently open-sourced FASTER framework.

Welcome to Trill!

We are incredibly excited to be sharing Trill with all of you! You can look forward to more blog posts about Trill’s API, how Trill is used within Microsoft, and in-depth technical details. In the meantime, please take a look at the query writing guide in our GitHub repository, take Trill for a spin, and tell us what you think! Reach out to us at asktrill@microsoft.com, we’d love to hear from you.
Quelle: Azure

A fintech startup pivots to Azure Cosmos DB

The right technology choices can accelerate success for a cloud born business. This is true for the fintech start-up clearTREND Research. Their solution architecture team knew one of the most important decisions would be the database decision between SQL or NoSQL. After research, experimentation, and many design iterations the team was thrilled with their decision to deploy on Microsoft Azure Cosmos DB. This blog is about how their decision was made.

Data and AI are driving a surge of cloud business opportunities, and one technology decision that deserves careful evaluation is the choice of a cloud database. Relational databases continue to be popular and drive a significant demand with cloud-based solutions, but NoSQL databases are well suited for distributed global scale solutions.

For our partner clearTREND, the plan was to commercialize a financial trend engine and provide a subscription investment service to individuals and professionals. The team responsible for clearTREND’s SaaS solution are a veteran team of software developers and architects who have been implementing cloud-based solutions for years. They understood the business opportunity and wanted to better understand the database technology options. Through their due diligence, the architecture morphed as business priorities and data sets were refined. After a lot of research and hands-on experimentation, the architectural team decided on Azure Cosmos DB as the best fit for the solution.

Business models are under attack, especially in the financial industry. Cosmos DB is a technology that can adapt, evolve, and allow a business to innovate faster in order to turn opportunities into strategic advantages.

Six reasons to choose Cosmos DB

Below are reasons the team at clearTREND selected Cosmos DB:

Schema design is much easier and flexible. With an agile development methodology, schemas change frequently and the ability to quickly and safely implement changes is a big advantage. Cosmos DB is schema-agnostic so there is massive flexibility around how the data can be consumed.
Database reads and writes are really fast. Cosmos DB can provide less than 10 millisecond reads and writes, backed with a service level agreement (SLA).
Queries run lightning fast and autoindexing is a game-changer. Reads and writes based on a primary or partition key are fast, but for many NoSQL implementations, queries executed against non-keyed document attributes may perform poorly. Secondary indexing can be a management and maintenance burden. By default, Cosmos DB automatically indexes all the attributes in a document so query performance is optimized as soon as data is loaded. Another benefit of auto-indexing is that the schema and indexes are fully synchronized so schema changes can be implemented quickly without downtime or management needed for secondary indexes. 
With thoughtful design Cosmos DB can be very cost-effective. The Cosmos DB cost model depends on how the database is designed via number of collections, partitioning key, index strategy, document size, and number of documents. Pricing for Cosmos DB is based on resources that have been reserved, these resources are called request units or RUs and are described in the “Request Units in Azure Cosmos DB” documentation. The clearTREND schema design is implemented as a single document collection and the entire cost of the solution on Azure, including Cosmos DB is at an affordable monthly price. Keep in mind this is a managed database service so monthly cost includes support, 99.999 percent high-availability, an SLA for read and write performance, automatic partitioning, data encrypted by default, and automatic backups.
Programmatically re-size capacity for workload bursts. The clearTREND workload has a predictable daily burst pattern and RUs can be programmatically adjusted. When additional compute resources are needed for complex processing or to meet higher throughput requirements, RUs can be increased. Once the processing completes, RUs are adjusted back down. This elasticity means Cosmos DB can be re-sized in order to cost-effectively adapt to workload demands.
Push-button globally distributed data. Designing for future scalability of a solution can be tricky, technology and design choices can become inefficient as a solution grows beyond the initial vision. The advantage with Cosmos DB is that it can become a globally configured, massively scaled out solution with just a few clicks. There are none of the operational complications of setting up and managing a cloud-scale, NoSQL distributed database.

Design and implementation tips for Cosmos DB

If you are new to Cosmos DB, here are some tips from the clearTREND team to consider when designing and implementing a solution:   

Design the schema around query and API optimization. Schema design for a NoSQL database is just as important as it is for a relational database management system (RDBMS) database, but it’s different. While a NoSQL database doesn’t require pre-defined table structures, you do have to be intentional about organizing and defining the document schema while also being aware of where and how relationships will be represented and embedded. To guide the schema design, the clearTREND team tends to group data based on the data elements that are written and retrieved by the solution’s APIs.
Design a flexible partition key. Cosmos DB requires a partition key to be specified when creating a document collection over 10GB. Deciding on a partition key can be tricky because initially it may not be clear what the optimal choice is for a partition key. Should it be a data category, geographical region, ID field, or a time scale like day, week, or month? A poorly designed partition key can create a performance bottleneck called a hot spot which concentrates read and write activity on a single partition rather than distributing activity evenly across partitions. If a partition key has to be changed, it can impact application availability as the underlying data is copied to the new collection and re-indexed. The clearTREND team uses an approach that affords flexibility in setting a partition key. The partition key is a string called PartitionID and initially it was set to be a value that represents a geography. Later when it was realized a more efficient key would be a calculated field, they programmatically replaced the geography values with the calculated values, avoiding a data copy and re-indexing operation.
Consider a schema design based on a single collection. A common design strategy is to use one document type per collection, but there are benefits to storing multiple document types in a single collection. Collections are the basis for partitioning and indexing so it may not seem intuitive to store multiple document types in a single collection. But it can maximize functionality with no cross-collection operations needed and minimize overall cost, this is because a single collection is less expensive than multiple collections. The clearTREND solution has seven different document types, all stored in a single collection. The approach is implemented with an enumerated field called doc type from which all documents are derived. Every document has a doc type property to correspond to one of the seven document types.     
Tune schema design by understanding the RU costs of complex queries and stored procedure operations. It can be difficult to anticipate the costs for complex queries and stored procedures, especially if you don’t know in advance how many reads or writes Cosmos DB will need to execute the operation. Capture the metrics and costs (RUs) for complex operations and use the information to streamline schema design. One way to capture these metrics is to execute the query or stored procedure from the Cosmos DB dashboard on the Azure portal.

Consider embedding a simple or calculated expression as a document property. If there are requirements to calculate a simple aggregation like a count, sum, minimum, and maximum, or there is a need to evaluate a simple Boolean logic expression, it may make sense to define the expression as a property of the base document class. For instance, in a logging application there is likely logic to evaluating conditions and determine if an operation has been successful or not. If the logic is a simple Boolean expression like the one below, consider including it in the class definition:

public class LogStatus
{
// C# example of a Boolean expression embedded in a class definition
public bool Failed => !((WasReadSuccessful && WasOptimizationSuccssful && StatusMsg == “Success”) ||
(WasReadSuccessful && !IsDataCurrent));
public string StatusMsg {get; set;}
public bool WasReadSuccessful {get; set;}
public bool WasOptimizationSuccessful {get;set}
public bool IsDataCurrent {get;set}
}

The command field showing Failed is defined as a read-only calculated property. If database usage is primarily read intensive, then this approach has the potential to reduce overall RU cost as the expression is evaluated and stored or when the document is written. This is an alternative to reducing cost each time the document is queried.  

Remember, referential integrity is implemented in the application layer. Referential integrity ensures that relationships between data elements are preserved, and with an RDBMS referential integrity is enforced through keys. For example, an RDBMS uses primary and foreign keys to ensure a product exists before an order for it can be created. If referential integrity is a requirement and data dependencies need to be monitored and enforced, it needs to be done at the application layer. Be rigorous about testing for referential and data integrity. 
Use Application Insights to monitor Cosmos DB activity. Application Insights is a telemetry service and for this solution was used to collect and report detailed performance, availability, and usage information about Cosmos DB activities. Azure Functions provided the integration between Cosmos DB and Application Insights through the use of Metrics Explorer and the capability to capture custom events using TelemetryClient.GetMetric() .

Recommended next steps

NoSQL is a paradigm rapidly shifting the way database solutions are implemented in the cloud. Whether you are a developer or database professional, Cosmos DB is an increasingly important player in the cloud database landscape and can be a game changer for your solution. If you haven’t already, get introduced to the advantages and capabilities of Cosmos DB. Take a look at the documentation, dissect the sample GitHub application, and learn more about design patterns:

Fintech Startup Commercializes Internal tool as a SaaS Product.
Discover clearTREND, the world’s first cloud-based financial trend engine.
Try Cosmos DB for free. You get a limited time, full service experience. Try it out, run through a tutorial or demo, and step through a quick start without a required Azure account or credit card.
If you are a developer, try out the Cosmos DB emulator. Develop and test an application locally without creating an Azure subscription or incurring costs. Once the application works, switch to using Azure Cosmos DB.

Thank you to our partners clearTREND and Skyline Technologies!

One of the great things about working for Microsoft are the opportunities to work with customers and partners, and to learn through them about their creative approaches for implementing technology. The team that designed and implemented the clearTREND solution are architects and developers with Skyline Technologies. Passionate about their business clients and solving complex technical challenges, they were very early cloud adopters. We especially appreciate the team members who gave their time to this effort including Tim Miller, Greg Levenhagen, and Michael Lauer. It’s been a pleasure working with you.
Quelle: Azure