How Microsoft is delivering smart building experiences with CI/CD for Azure Digital Twins

Apr 22, 2024   |  

Microsoft Digital technical storiesMicrosoft empowers employees and guests with user experience scenarios, like pathfinding and hotdesking, to make life easier. To quickly facilitate impactful smart building features at scale, Microsoft Digital’s engineers rely on a structured approach that combines templates and pipelines for continuous integration and continuous delivery (CI/CD) to accelerate implementation without compromising quality. With CI/CD for Microsoft Azure Digital Twins, Microsoft is able to iteratively build, update, test, and deploy the elements that ultimately create smart building experiences.

“The cool stuff, the end user stuff, you can get it in one space, but it’s a lot harder to evolve and build it out at scale,” says Kyle Getty, a senior developer with Microsoft Digital, the organization that powers, protects, and transforms the company. “You need a smart platform, a way to do more, faster, and easier, to replicate those experiences in 600 buildings.”

What’s the bare-bones minimum way to connect to Azure Digital Twins? We want to simplify and consolidate declaratively in the build, then let the different teams handle the deployment.

—Kyle Getty, senior developer, Microsoft Digital

To get to these smart building scenarios, Microsoft Digital needs to bring several pieces together. That’s where CI/CD comes in. CI/CD utilizes pipelines—automated processes and tools for build and release steps—which enables teams to build services and packages with greater speed and efficiency.

When used with templates, which combine the content of multiple files into a single pipeline, CI/CD can quickly support incremental changes to deliverables without introducing errors.

[Discover how Microsoft is creating the digital workplace. Learn how Microsoft uses Azure Digital Twins and IoT to modernize its buildings.]

A better way to deliver experiences at scale

Microsoft Azure Digital Twins, which serves as a virtual model of a physical space or object, is pivotal to Microsoft’s strategy for engineering real-world experiences. When a new model or change comes in, the faster it’s available, the faster an experience can be built.

“What’s the bare-bones minimum way to connect to Azure Digital Twins?” Getty says. “We want to simplify and consolidate declaratively in the build, then let the different teams handle the deployment.”

By using CI/CD for Microsoft Azure Digital Twins, Microsoft Digital reduces the number of repetitive and manual tasks required to build and deploy features. Not only does this structured approach accelerate iterative deployment, it introduces extensibility, allowing the organization to create new ways of interacting with smart building features.

This saves Microsoft significant time and avoids a few key obstacles.

Split-frame image of Getty and Bir. Getty stands at his desk with his workstation in the background. Bir stands outside at sunset.
Senior developer Kyle Getty (left) and senior software engineer Michael Bir (right) utilize CI/CD for Microsoft Azure Digital Twins as part of a structured approach to delivering smart building experiences at Microsoft. (Photos by Kyle Getty and Michael Bir)

“A lot of teams are trying to go from monolith to microservices,” says Michael Bir, a senior software engineer with Microsoft Digital, speaking of the architectural shift from a large system to several smaller ones to improve scalability and developer productivity. “These modular setups create a lot of repositories that comprise the whole application. That also introduces repetition across the repositories.”

While necessary for extensibility and scalability, using linked microservices can be challenging to manage.

Developers often copy existing configurations to tie into these libraries and repositories, regularly taking the last release and mining it for relevant settings before getting to work on the new release. In addition to being tedious, this process can result in subtle changes that might introduce incompatibilities over time.

Using Microsoft Azure DevOps allows Microsoft Digital to merge pipelines (a series of steps needed for delivery) into templates for rapid development, with all the tedious foundational code and testing requirements already in place.

This is core to CI/CD for Microsoft Azure Digital Twins. Once in the hands of developers, these templates can evolve into new projects. Commonalities can be used to build out core services, packages, and downstream microservices needed for Microsoft Azure Digital Twins experiences.

Iterative by nature

CI/CD does more than enable rapid development.

“Our templates allow you to have a global model or to use ring deployments,” Bir says. “We don’t need separate templates to maintain an iterative development environment.”

With CI/CD for Microsoft Azure Digital Twins, developers can work on features independently, testing and deploying them in stages to introduce gradual improvements.

Microsoft Digital can deploy directly into a testing ring where the package or service is automatically inspected for bugs before being elevated into the next ring, a production environment. This ensures a level of quality and consistency across every deployment, but also removes manual testing from the equation. Now, developers can quickly and easily check that a deployment is fully integrated with models before being released.

It also allows the templates to be used in specific environments, like development and production regions where smart buildings might have different needs or requirements, all while enabling extensibility.

With so many different repositories, testing for incompatibilities can become difficult. Fortunately, the team’s structured approach addressed that. By utilizing a single project, or common pipeline, Microsoft Digital can maintain templates for common CI/CD scenarios used by all repositories.

“The common pipeline uses itself to run tests,” Bir says. “We then use Azure DevOps to tag that for iterative deployment by consuming repositories.”

To maintain a healthy and productive iterative development environment, Microsoft Digital auto-deploys to a testing environment. As the test is defined, it establishes requirements to move and elevate the build into production. This gate prevents incompatibilities from reaching a smart building experience.

We had some templates for static code analysis, but we took it to the next level. Before this, we would have to go back to a previous repository that we thought was good, copy and paste it, change the variables for it to make sense, and then tweak some optional things. Now it’s all handled by the template. It’s very flexible.

—Michael Bir, senior software engineer, Microsoft Digital

The iterative agility of CI/CD means that if Microsoft Digital does need to introduce a change, say to adjust for compliance, the organization can orchestrate everything from Microsoft Azure DevOps and then push it out to all repositories. The next time a project deploys, it grabs the updated template.

In centralizing the way projects are updated and published, Microsoft Digital no longer needs to retest and rebuild features for different repositories.

A smart way to build experiences

Teams across Microsoft can now deploy stable and extensible Microsoft Azure Digital Twins experiences at scale.

“We had some templates for static code analysis, but we took it to the next level,” Bir says. “Before this, we would have to go back to a previous repository that we thought was good, copy and paste it, change the variables for it to make sense, and then tweak some optional things. Now it’s all handled by the template. It’s very flexible.”

The structured approach also makes it easy to add members to the team. Instead of pointing users to old releases, the team only has to share the template. It’s already the latest version, and the new user only has to plug in a few variables.

CI/CD for Microsoft Azure Digital Twins has simplified the way Microsoft Digital can approach a build, eliminating lengthy coding and testing tasks while empowering extensible solutions to flourish at scale. Common pipelines and templates can be used to manage and accelerate the features needed to supercharge Microsoft Azure Digital Twins and the models needed to power smart building experiences.

Microsoft Digital will continue to find ways to add value, giving developers certain resources and permissions to test, similar to how Microsoft Azure uses Azure Resource Management templates. As more common pipelines are built into the template, developers will be able to do more faster, without having to take on additional management responsibilities.

“I want a smart building UI,” Getty says. “I don’t want to worry about building code and running tests or which instance to talk to. I want to run code efficiently for how an Azure Digital Twins model has been set up. Now we have something to tie it all together and pass on that value so others can focus on what they need to.”

Key Takeaways

  • Simplify. You don’t need to engage with every lever available; leave enough options available to stay agile.
  • If you decide to use CI/CD, version correctly. All pipelines referencing a main branch will be affected by changes, but tags allow developers to share changes and bring them in as needed.
  • Microsoft Azure DevOps and YAML enable Microsoft Digital to deploy smart building experiences at scale by simplifying and reusing common pipelines.
  • Always leave something extensible. Open parameters to run testing or change a component. Leaving flexibility via parameters gives you as many options as possible.
  • Going all-in on CI/CD means that some unique things won’t fit. If you’re open, orchestration becomes extensible. When you have an outlier, adopt the pattern first; this new functionality can be given to other repositories by default.

Related links

Tags: , ,