Use GraphQL with Hasura and Azure Database for PostgreSQL

Azure Database for PostgreSQL provides a fully managed, enterprise-ready community PostgreSQL database as a service. The PostgreSQL community edition helps you easily migrate existing apps to the cloud or develop cloud-native applications, using languages and frameworks of your choice. The service offers industry leading innovations such as built-in high availability, backed with 99.99 percent SLA, without the need to set up replicas and enabling customers to save over two times the cost. The capability also allows customers to scale compute up or down in seconds, helping you easily adjust to changes in workload demands.

Additionally, built-in intelligent features such as Query Performance Insight and performance recommendations help customers further lower their total cost of ownership (TCO) by providing customized recommendations and insights to optimize the performance of their Postgres databases. These benefits coupled with unparalleled security and compliance, Microsoft Azure’s industry leading global reach, and Azure IP Advantage, empower customers to focus on their business and applications rather than the database.

As part of the broader Postgres community, our aim is to contribute to and partner with others in the community to bring new features to Azure Database for PostgreSQL users. You can now take advantage of the Hasura GraphQL Engine, a lightweight, high performance open-source product that can instantly provide a real time GraphQL API on a Postgres database. This post provides an overview of how to use GraphQL with Azure Database for PostgreSQL.

What is GraphQL?

GraphQL is a query language for APIs and a server-side runtime for executing database queries. The GraphQL spec is centered around a typed schema that is available to users of the API, which are mostly front-end developers, to make any CRUD queries on the exposed fields. It’s agnostic to the underlying database or source of data. One of GraphQL’s main benefits is that clients can specify exactly what they need from the server and receive that data in a predictable way. GraphQL provides a solution to common hurdles faced when using REST APIs, and it is currently being adopted widely to speed up product development cycles.

Hasura GraphQL Engine

The Hasura GraphQL Engine is a lightweight, high performance open-source product that gives you a real time GraphQL API on a Postgres database instantly. The engine comes with an admin UI to help you explore your GraphQL APIs and manage your database schema and data.

Hasura’s GraphQL Engine also allows you to write custom resolvers with schema-stitching and to integrate serverless functions or microservice APIs that get triggered on database events. With Hasura’s GraphQL, you can easily build 3factor apps. Learn more by reading about Hasura.

Using GraphQL with Azure Database for PostgreSQL

Please note, If you already have a database running on Azure and want to use GraphQL on that database, go directly to the "Working with GraphQL with an existing Azure Database for PostgreSQL" section below.

With the Hasura’s GraphQL one-click deploy, you can now get a real time GraphQL API on Azure with Azure Database for PostgreSQL server in under five minutes!

Get started by selecting Deploy to Azure below, which will open the Azure portal in preparation for using GraphQL with Azure Database for PostgreSQL. If you are prompted to log in to the Azure portal, enter your credentials to continue.

This deployment uses Azure Container Instances for deploying Hasura’s GraphQL and Azure Database for PostgreSQL for provisioning a managed Postgres instance.

Working with GraphQL with an existing Azure Database for PostgreSQL

If you already have a PostgreSQL database on Azure, you can connect Hasura’s GraphSQL to that database and have GraphQL APIs without affecting any other part of your application.

Get started by selecting the Deploy to Azure graphic below, which will open the Azure portal in preparation for working with GraphQL and an existing Azure Database for PostgreSQL database. If you are prompted to log in to the Azure portal, enter your credentials to continue.

This deployment uses Azure Container Instances for deploying Hasura and connects to an existing Azure Database for PostgreSQL instance.

What else can you do with Hasura’s GraphQL engine?

Explore the ready to use real-time API

Types and/or operators such as SQL for sorting, filtering, pagination, and aggregations are supported out-of-the-box. Read more about Hasura’s powerful syntax for queries and mutations.

Hasura also has built-in live-queries called subscriptions in GraphQL, for getting real-time updates to results of a query. No need to write any code for handling websocket connections!

Add authorization

Hasura’s granular, role-based permissions system lets you configure columns and row level access control rules for data that integrates with any third party. You can also integrate with your own custom authentication services using a JWT or webhook. You can learn more about adding authorization by visiting Hasura’s documentation, “Authentication / Access control.”

Add custom business logic

GraphQL Engine can be used as a gateway for custom business logic like with Remote GraphQL schemas. You can write your own GraphQL servers in your favorite language and expose them at a single endpoint. Hasura will take care of the schema stitching.

Trigger Azure Functions on database events

Hasura can trigger serverless Azure Functions or webhooks on database events like insert, update, or delete. They can be used to execute asynchronous business logic such as sending a “welcome email” to newly registered users. Read more about triggering serverless Azure Functions and webhooks on the Hasura website, or visit Hasura’s documentation, “Event triggers.”

Next steps

Get started and create your PostgreSQL servers today! Learn more about Azure Database for PostgreSQL in the overview documentation, “What is Azure Database for PostgreSQL.”

Please continue to provide UserVoice feedback on the features and functionality that you want to see next. If you need any help or have questions please check out the, “Azure Database for PostgreSQL documentation.”

For support and feedback related to Hasura, please use Discord. You can also follow Hasura’s product updates at @HasuraHQ.

Acknowledgements

Special thanks to the Hasura team for their contributions to this posting.
Quelle: Azure

Update to Azure DevOps Projects support for Azure Kubernetes Service

Kubernetes is going from strength to strength as adoption across the industry continues to grow. But there are still plenty of customers coming to container orchestration for the first time while also building up their familiarity with Docker and containers in general. We see the need to help teams go from a container image, or just a git repo, and help get them to an app running in Kubernetes in as few steps as possible. It’s also important that we do this in a way that will allow them to customize afterward and build on their knowledge as they go.

At Microsoft, we are trying to make it easy for our customers to adopt Kubernetes by offering two solutions.

First is Azure Kubernetes Service (AKS), a fully managed Kubernetes container orchestration service. AKS simplifies the deployment and operations of Kubernetes and enables you to dynamically scale your application infrastructure with confidence and agility.

The other is Azure DevOps Projects, a simplified experience which helps you launch an app on an Azure Service of your choice in a few quick steps. For example, in just a matter of minutes, it can help you provision AKS, Azure Container Registry, and start building and deploying a container app to AKS by using Azure Pipelines. Creating a DevOps Projects provisions Azure resources and comes with a git code repository, Application Insights integration, and a continuous delivery pipeline setup to deploy to Azure. The DevOps Projects dashboard lets you monitor code commits, builds, and deployments from a single view in the Azure portal.

Key benefits of Azure DevOps Projects are:

Get up and running with a new app and a CI/CD pipeline in just a few minutes
Support for a wide range of popular frameworks such as .NET, Java, PHP, Node.js, and Python
Start fresh or bring your own application from GitHub
Built-in Application Insights and Azure Monitor for containers integration for instant analytics and actionable insights
Cloud-powered CI/CD using Azure DevOps

Several customers are using Azure DevOps Projects to deploy their apps to AKS, but a clear piece of feedback we received from early adopters was to add support for reusing an existing Azure Kubernetes Service (AKS) cluster in Azure DevOps Projects rather than have to create a new one each time.

Today we are happy to share that now you can use Azure DevOps Projects to deploy multiple apps to a single AKS cluster. This feature is generally available in the Azure portal. To get started create an Azure DevOps Projects now. For more information, please read our Azure DevOps Projects documentation.

Quelle: Azure

Class schedules on Azure Lab Services

Classroom labs in Azure Lab Services make it easy to set up labs by handling the creation and management of virtual machines and enabling the infrastructure to scale. Through our continuous enhancements to Azure Lab Services, we are proud share that the latest deployment now includes added support for class schedules.

Schedules management is one of the key features requested by our customers. This feature helps teachers easily create, edit, and delete schedules for their classes. A teacher can set up a recurring or a one-time schedule and provide a start, end date, and time for the class in the time zone of choice. Schedules can be viewed and managed through a simple, easy to use calendar view.

Students virtual machines are turned on and ready to use when a class schedule starts and will be turned off at the end of the schedule. This feature helps limit the usage of virtual machines to class times only, thereby helping IT admins and teachers manage costs efficiently.

Schedule hours are not counted against quota allotted to a student. Quota is the time limit outside of schedule hours when a student can use the virtual machine.

With schedules, we are also introducing no quota hours. When no quota hours are set for a lab, students can only use their virtual machines during scheduled hours or if the teacher turns on virtual machines for the students to use.

Students will be able to clearly see when a lab schedule session is in progress on their virtual machines view.

You can learn more about how to use schedules in our documentation, “Create and manage schedules for classroom labs in Azure Lab Services.” Please give this feature a try and provide feedback at Azure Lab Services UserVoice forum. If you have a questions, please post it on Stack Overflow.
Quelle: Azure

Cloud Services Platform—bringing hybrid cloud to you

If you’ve ever thought about adopting a hybrid cloud, you know it usually means committing to a cloud vendor and purchasing new hardware—with no easy way of integrating your existing on-premises investments. At Google Cloud, we are taking a different approach, with a software-based, hybrid offering that brings Google Cloud services into your on-prem infrastructure using the power of Kubernetes and Istio to meet you where you are.At Google Cloud Next last year, we introduced our vision for Cloud Services Platform (CSP), and we are excited to announce it’s available in beta today. CSP is a modern platform that simplifies building, running, and managing services both on-prem and in the cloud. Built on open APIs, CSP is a less disruptive and more compliant approach than competing hybrid offerings. CSP gives you the freedom to modernize your applications at your own pace, innovate faster, and improve operational security and governance. Now that our customers have started to modernize their applications in their own data centers with CSP, we believe it will be the enterprise application deployment platform of choice for many years to come.Modernize in-place with GKE On-PremFor many of you, modernization means navigating existing on-prem investments as well as cloud infrastructure, while simultaneously adopting cloud-native tools and development practices.CSP is built on top of Google Kubernetes Engine (GKE), the industry’s leading managed Kubernetes service with advanced security and automation. CSP includes GKE On-Prem, a managed Kubernetes service providing remote lifecycle management of your on-prem clusters, keeping them updated and secure. GKE On-Prem brings Google’s expertise in Kubernetes and the thriving Kubernetes ecosystem to your data center and runs on your existing hardware, saving you time and money. You can write once and deploy to the cloud or on-prem, using a consistent platform that spans all your environments. Furthermore, CSP’s design allows you to integrate existing networking, storage, and identity capabilities that you already use, so you can move to the cloud when you are ready.Automate policy and security at scale with CSP Config ManagementEnsuring security and compliance to centralized policies is difficult in a hybrid environment. You need to be able to apply security policies and compliance rules at scale, deploying the right controls across your applications without hindering development speed.With today’s introduction of CSP Config Management you can create multi-cluster policies out of the box, that set and enforce role-based access controls, resource quotas, and create namespaces; all from a single source of truth. You can also rapidly deploy your configurations out across all your clusters—both on-prem and in the cloud. CSP Config Management automatically monitors your CSP environment for changes from your desired state, blocking unapproved changes, alerting you to unexpected variations and making policy deployment, security, management, and monitoring easy and universal.Beyond this, CSP works great with Istio. By adding a proxy in front of your services, it provides a scalable foundation for policy enforcement, helps services establish trust, and encrypts traffic without needing any code changes.Build once, manage and deploy anywhereAs we bring the benefits of the cloud to your on-prem deployments, having a consistent experience across all your environments can make your operations team much more efficient, freeing them up to focus on innovation.In addition to letting you run anywhere, CSP provides the visibility you need to see what is happening across those environments. Stackdriver Monitoring and Istio policy management capabilities give you a single management console spanning on-prem and the cloud, while GCP Marketplace gives you access to a variety of enterprise-ready, open-source, and commercial Kubernetes applications featuring prebuilt deployment templates, simple licensing, and consolidated billing. This consistent management console lets you embrace DevOps like never before, while SRE-focused monitoring tools bring you better visibility into service-level communications.CSP: your path to a more productive organizationCSP can make your organization more productive with add-on tools that improve the efficiency of your entire IT team: IT operators benefit from a single unified platform to manage applications and services that span multiple environments. Developers gain a secure foundation on which to build scalable, efficient applications based on containers and microservices. Additionally, security teams get consistent tooling to secure their software supply chain and improve run-time security. With CSP we are partnering with our customers to realize their modernization and hybrid goals.KeyBank, one of the largest banks in the U.S., chose CSP to bring the benefits of Kubernetes and Istio to its own data centers.“Google created Kubernetes and Istio so they were the obvious cloud to partner with as we look to bring containerized applications into our data centers. Put simply, the Cloud Services Platform provides us the security we need, the portability we want, and the productivity that our developers crave.”- Keith Silvestri, Chief Technology Officer for KeyBank.Partners like Arctiq, meanwhile, are using CSP to help customers modernize and  innovate rapidly.“We’re working with some of our largest customers to modernize their applications with CSP. For our customers in regulated industries and government agencies, the ability to run in their current data centers reduces risk and enables them to get many of the benefits of the cloud while still meeting their internal compliance and regulatory requirements. CSP gives us the flexibility to use GKE On-Prem for sensitive workloads and keep them on-prem while using GKE in the cloud for other strategic applications.” – Kyle Bassett, Partner at Arctiq.CSP represents a foundational element of our hybrid strategy, which integrates with our build, deployment, and monitoring tools to provide a modern DevOps environment that accelerates development velocity. We look forward to building on it in the coming months. To learn more about our vision for CSP, please see Application Modernization and the Decoupling of Infrastructure, Services and Teams, a white paper by distinguished Googlers Eric Brewer and Jennifer Lin.
Quelle: Google Cloud Platform