This article is contributed. See the original author and article here.
Inaccessible content is everywhere in the digital world. Today, we’re introducing Accessibility Assistant in Microsoft 365 to help creators produce more accessible content with less effort, all in the flow of work.
This article is contributed. See the original author and article here.
Start monitoring Delivery Optimization usage and performance across your organization today! Following the Windows Update for Business reports announcement back in November 2022, we are excited to announce the general availability of the Delivery Optimization Windows Update for Business report.
We genuinely appreciate those of you who participated in the public preview! You helped us verify the accuracy of the new data tables and revise the layout. Your responses helped us identify and address all critical issues, so it can now be offered to all Delivery Optimization users. In this article, find guidance to:
Get started with Windows Update for Business reports
Customize your Delivery Optimization report
Get started with Windows Update for Business reports
If you’re an existing Update Compliance user, you’re probably aware of the Update Compliance migration to Windows Update for Business reports. The new report experience provides templates for Windows reporting for monitoring organization and device level data with the added flexibility to customize a given report.
The Delivery Optimization Window Update for Business report provides a familiar experience, surfacing important data points that supply a unified way to check the performance across your organization. It contains data for the last 28 days, and we’ve added the long-awaited Microsoft Connected Cache data. In addition, we’ve reorganized the information to be more easily discoverable, leveraging the key cards that provide a quick and easy view of Delivery Optimization usage and performance.
Key cards with main metrics in Windows Update for Business reports
You can quickly find the key pieces of data at the top of the report. We’ve bubbled up the metrics you care most about. You’ll find total bandwidth savings for both Delivery Optimization technologies, including peer-to-peer (P2P) and Connected Cache.
Further down the report, there are now three tabs that distinguish between Device configuration, Configuration details, and Efficiency by group.
Within Device configuration, you’ll see the breakdown of Download Mode configuration for your devices. Each configuration number in parentheses references the Download Mode set on the device.
Device configuration details for peering status are shown as a pie chart while configuration names and device counts are shown as a bar graph in Windows Update for Business reports
In Content distribution, you can explore the breakdown of how bytes are delivered, from CDN/HTTP source, peers, or Connected Cache. You can also visualize the delivery method based on the different content types. By clicking on a particular content type, further drill down to richer content type details.
See an example of a particular environment that does not have an Connected Cache cache server, displaying 0% of bytes.
Content distribution is visualized as a pie chart broken down by source type and a bar graph of volume by content type and source
The last tab presents a new option. Most of your organizations use policies to create peering groups to manage devices. In the Efficiency by group section, you can toggle among four different options. After talking with many of you, we’ve generally seen that device groups for Delivery Optimization are managed in four common ways by:
GroupID
City
Country
ISP
We’ve added each of these as a quick and easy tab, so you can view the top 10 groups by number of devices. So, for example, if you’re looking at the GroupID, you’ll see the 10 top group IDs with the highest number of devices. Similarly, in the City or Country view, you’ll see the top 10 cities or countries with the greatest number of devices. Or perhaps you’re more interested in monitoring the top ISPs delivering content based on the number of devices within the organization – for that, we’ve included the ISP option.
The Efficiency By Group tab shows the top 10 groups based on Group ID, along with pertinent details such as P2P percentage, volume, and device count
As mentioned above, this is just the start of a new offering that enables you to tailor your report to meet the requirements of your organization. We will continue to incorporate richer features and enhanced experience in the Delivery Optimization report based on your feedback.
Customize your Delivery Optimization report
Much of the excitement with this new report format is centered on flexibility. It’s easy to modify the report template to meet your needs or if you want to run queries to further investigate your data. To do this, you can use the Windows Updates for Business reports data schema where you can access the new Delivery Optimization-related schema tables:
See what these tables look like within the LogManagement section.
The Microsoft Azure interface showing Logs options, focused on a list of tables, including UCClient, UCDOAggregateStatus, and U DOStatus
We recommend running a query on each table to learn of the available fields. Let’s take a brief look at each.
UCClient table
The UCClient table is used within the Delivery Optimization report to get OSBuild, OSBuildNumber, OSRevisionNumber, and OSFeatureStatus. The data from UCClient is joined with UCDOStatus to complete the Device configuration breakdown table. You’ll notice that in Edit mode, you can easily modify the query that builds this visualization. If any changes are needed, you can modify this query accordingly.
The Azure Workbooks interface showing the DO Device Configuration breakdown in Edit mode
UCDOStatus table
One of the two tables that hold Delivery Optimization-only data is UCDOStatus. This table provides aggregated data on Delivery Optimization bandwidth utilization. Explore the data for a single device or by content type. For example, the ‘Peering Status’ pie chart is powered by the UCDOStatus table.
The Peering Status pie chart, powered by the UCDOStatus table, is shown when editing the query item for DeviceCountPeering
UCDOAggregatedStatus table
The second Delivery Optimization-only data table is UCDOAggregatedStatus. The role of this table is twofold:
Provide aggregates of all individual UCDOStatus records across the tenant.
Summarize bandwidth savings across all devices enrolled with Delivery Optimization.
One way this table is used is to build the volume by content types. Similarly, this view can be easily changed either through the query or built-in UX controls available via Log Analytics.
A bar graph summary of volume by content types, such as quality updates
Keep in touch
We hope you are as excited as we are about these new changes for Delivery Optimization reporting. There are many more things we plan to add in the future. If you have any feedback or feature requests, we’d love to hear from you! Please submit it using the Feedback link within the Azure portal.
A feedback submission form inside the Microsoft Azure portal
This article is contributed. See the original author and article here.
One of the most common pain points of scheduling online meetings, especially with people outside your organization, is the back-and-forth messages. Microsoft Bookings now makes it simple to avoid that back and forth, with Power Automate you can seamlessly integrate Webex with Bookings.
Together, Bookings and Webex, they provide a comprehensive solution for all your virtual meeting needs.
With Power Automate, the moment a booking is made on Microsoft Bookings, a Webex meeting is automatically scheduled with all the details of the booking, such as date, time, and attendees. No more back and forth emails or missed meetings due to double bookings.
An animated image demonstrating how to create a Webex meeting when a Microsoft Bookings appointment is created via a Power Automate template.
Don’t let scheduling virtual meetings stress you out anymore. With the integration of Microsoft Bookings, Webex, and Power Automate, you’ll be able to focus on what really matters – conducting successful and efficient virtual meetings. Upgrade your virtual meeting game today and experience seamless scheduling.
This article is contributed. See the original author and article here.
Today we have an exciting announcement to share about the evolution of Microsoft Outlook for macOS. Don’t have Outlook on your Mac yet? Get Outlook for Mac in the App Store.
An image demonstrating the user interface of Outlook for Mac.
Outlook for Mac is now free to use
Now consumers can use Outlook for free on macOS, no Microsoft 365 subscription or license necessary.
Whether at home, work or school, Mac users everywhere can easily add Outlook.com, Gmail, iCloud, Yahoo! or IMAP accounts in Outlook and experience the best mail and calendar app on macOS. The Outlook for Mac app complements Outlook for iOS – giving people a consistent, reliable, and powerful experience that brings the best-in-class experience of Outlook into the Apple ecosystem that so many love.
Outlook makes it easy to manage your day, triage your email, read newsletters, accept invitations to coffee, and much more.
Bring your favorite email accounts
One of Outlook’s strengths is helping you manage multiple accounts in a single app. We support most personal email providers and provide powerful features, such as viewing all your inboxes at once and an all-mailbox search to make managing multiple email accounts a breeze.
An image demonstrating examples of personal email providers supported in Outlook.When you log into Outlook with a personal email account, you get enterprise-grade security, with secure sign-on to authenticate and protect your identity—all while keeping your email, calendar, contacts, and files protected.
Outlook is built for Mac
With Outlook, you’ll get a modern and beautiful user interface that has been designed and optimized for macOS. And these enhancements go far beyond surface level. The new Outlook is optimized for Apple Silicon, with snappy performance and faster sync speeds than previous versions.
Outlook for Mac does more to integrate into the Apple platform so that you get the most from your macOS device. To help you stay on top of your email and calendar while using other apps, you can view your agenda using a widget and see reminders in the Notification Center. We are also creating a peek of upcoming calendar events in the Menu Bar (coming soon).
An image demonstrating previews of the Menu Bar (left), a Notification Center reminder (top right), and a Widget (bottom right) in Outlook for Mac.
We know life is multifaceted and Outlook is leveraging the Apple platform to support you by making it easier to switch contexts. With our new Handoff feature, you can pick up tasks where you left off between iOS and Mac devices, so you can get up and go without missing a beat*.
An image demonstrating the Handoff feature in Outlook for Mac on a desktop and mobile device.
We understand it’s more important than ever to protect your time. The new Outlook Profiles (coming soon) allow you to connect your email accounts to Apple’s Focus experience. With Outlook Profiles, you won’t get unwanted notifications at the wrong time so you can stay focused on that important work email, with no distractions from your personal email.
An image demonstrating the Outlook Profiles feature in Outlook for Mac.
Your hub to help you focus
Outlook provides a variety of ways to help you stay focused and accomplish more by helping you decide what you want to see and when. For people with multiple accounts, the all-accounts view lets you manage all your inboxes at once, without having to switch back and forth. It’s a great way to see all new messages that come in so you can choose how to respond.
Outlook also has more options for keeping important emails front and center**. The Focused Inbox automatically sorts important from non-important messages so you can easily find them with a toggle above the message list and add frequently used folders to Favorites to find them easily. Outlook also gives you power to prioritize messages your way. You can pin messages in your inbox to keep them at the top or snooze non-urgent messages until you have time to reply. Categories and flagging are available as well. With so many options for organizing email, you can make Outlook work for you.
An image providing a preview of the Focused Inbox and Swipe Gestures features in Outlook for Mac.
With Outlook, you can stay on top of your daily schedule from anywhere in the Mac app. Open My Day in the task pane to view an integrated, interactive calendar right from your inbox. Not only can you see upcoming events at a glance, but you can view event details, RSVP, join virtual meetings, and create new events from this powerful view of your calendar.
There is more to do and many more features we are excited to bring to the Outlook Mac experience. We are rebuilding Outlook for Mac from the ground up to be faster, more reliable, and to be an Outlook for everyone.
*The Handoff feature requires downloading Outlook for Mac from the App Store and login to your iOS device and macOS using the same AppleID.
**Categories only available with Outlook.com, MSN.com, Live.com, and Hotmail.com accounts. Focused Inbox, Snooze, and Pinning are not available with Direct Sync accounts. Click here for more information on Direct Sync accounts.
This article is contributed. See the original author and article here.
Introducing the world’s first AI copilot in both CRM and ERP
Today we announced Microsoft Dynamics 365 Copilot, providing interactive, AI-powered assistance across business functionsfrom sales, service, and marketing to supply chain. With Dynamics 365 Copilot, we’re introducing the world’s first AI copilot natively built-in to both CRM and ERP applications.
Copilot brings the power of next-generation AI capabilities and natural language processing to Dynamics 365, working alongside business professionals to help them create ideas and content faster, complete time-consuming tasks, and get insights and next best actionsjust by describing what’s needed.
Copilot features are in preview across Dynamics 365 applications and Microsoft Viva Sales. View demos of the capabilities, as well as learn how to access the previews, below.
Copilot in Microsoft Dynamics 365 Sales and Viva Sales
Many sales teams struggle to scale seller experiences. AI can help any sales organization to be more productive and effective, enabling them to automate the sales process and know customers more deeply.
Microsoft Viva Sales, which is included in Dynamics 365 Sales and available for purchase separately for other CRM systems, including Salesforce, revolutionizes the way sellers work by integrating with Microsoft Outlook and Teams to augment a seller’s actions and decisions with AI-powered insights and actions. New Copilot features help sellers save time, boost productivity, lighten workloads, and stay focused on what matters most: connecting with customers and closing deals.
Communicate with customers more effectively with AI-generated emails
Last month, we announced that Viva Sales now generates content suggestions based on customer emails, such as a reply to an inquiry or a request for a proposalcomplete with data specifically relevant to the recipient, such as pricing, promotions, and deadlines. The seller simply selects the option to suit their needs and a reply is generated for the seller to review, edit to their liking, and send. The reply is enriched with the combined data from Microsoft Graphwhich provides access to people-centric data and insights in the Microsoft Cloud and the CRM system (Microsoft Dynamics 365 or Salesforce).
Today we are announcing an updateemail replies will now move into general availability and on March 15, we will add enhancements to create customizable emails. For example, a seller can generate an email that proposes a meeting time with a customer, complete with a proposed meeting date and time based on availability on the seller’s Outlook calendar.
In addition, a new feedback mechanism allows sellers to rate the AI-generated content with a thumbs up or thumbs down, which helps refine and improve future replies. Sellers can also refine generated results by providing a new prompt that creates an updated response that builds on the previously suggested draft and new context.
By auto-suggesting customizable content, sellers can spend less time composing emails and searching for sales data from colleagues and databases.
Follow up with customers promptly with AI-generated meeting summaries
Sellers often spend hours each day on calls with prospects and customersand nearly as much time recapping action items for follow-through. To help with that, conversation intelligence provides automated summaries of key topics, issues, and concerns discussed during the meeting.
Now available for public preview in Viva Sales, the new Copilot feature uses natural language capabilities powered by Azure OpenAI Service to intelligently draft a recap of a call with action items and follow-up dates, based on CRM and meeting data. Summaries can be generated for a range of meeting types in Teams, including multi-participant and internal calls, helping sellers stay organized and on top of critical, content-heavy sales meetings.
This embed requires accepting cookies from the embed’s site to view the embed. Activate the link to accept cookies and view the embedded content.
Copilot in Microsoft Dynamics 365 Customer Service
Customer service agents are critical for maintaining customer loyalty, but they often face pressure to resolve multiple customer cases quickly, leading to burnout and decreased customer satisfaction. To address these challenges, agents need tools that can help them streamline tasks across both simple and complex cases, while still providing personalized service that demonstrates their commitment to resolving each issue thoroughly and efficiently.
Now available for limited preview, we’re announcing Copilot in Microsoft Dynamics 365 Customer Servicea range of next-generation AI capabilities that can expedite resolving customer issues and increase satisfaction scores. Copilot provides the agent with 24/7 AI-powered assistance to help them find resources that will help resolve issues faster, handle cases more efficiently, and automate time-consuming tasks so agents can focus on delivering high-quality service to their customers.
Turn service agents into superagents
With Copilot, agents can quickly craft a draft email or chat response to customers with a single click. Copilot understands the context based on the current live conversation; identifies relevant information from trusted websites and internal documents, including knowledgebase articles and previously resolved cases; and crafts a response that the agent can review and send to the customer.
For agents working on emails, Copilot can help create relevant and personalized email responses to customer queries in seconds. Once Copilot synthesizes information and suggests an email draft, agents can review and modify the content before sending it to the customer. Using conversational chat experience, agents can ask Copilot to help diagnose more complex customer issues, discover resolutions, and summarize draft responses with the right tone to the customeracross all communication channels.
With comprehensive and efficient assistance from Copilot, agents can significantly reduce the amount of time spent searching for content and drafting their response, resulting in improved agent productivity and customer experience.
This embed requires accepting cookies from the embed’s site to view the embed. Activate the link to accept cookies and view the embedded content.
Enrich self-service with AI-powered conversational assistance
Organizations can provide an even more powerful conversational experience by leveraging Power Virtual Agents, now enhanced with generative AI capabilities and available today in preview. Customers can self-serve and get their needs more easily solved with highly intelligent conversational bots that use trusted websites and the company’s internal data to resolve customer issues. Additionally, with the continued investment in the open, flexible, and composable Microsoft Digital Contact Center Platform, Nuance is announcing new AI capabilities in Nuance Mix. Dynamics 365 Customer Service, together with Teams, Microsoft Power Platform, Nuance, and Azure, deliver truly transformative experiences for both agents and customers through the contact center.
Copilot in Microsoft Dynamics 365 Customer Insights and Marketing
To meet customer expectations, marketers need to deliver personalized marketing experiences across physical and digital channels. The next-generation AI empowers marketers to proactively target any audience segment in lockstep with market trends and customer demand.
Get to data insights faster and easier with natural language
Marketers have traditionally relied on data analysts, leveraging their skillset to write queries in SQL, to uncover insights from their customer datawhich can take weeks for results. With Copilot in Dynamics 365 Customer Insights, marketing teams can engage directly with customer data and discover new information that they may not have been aware of, democratizing access to insights.
With simple prompts, marketers can ask questions using natural language to explore, analyze, and understand customer segment sizes and preferencesno need to be a SQL expert or wait for other teams to process their requests. For example, a marketer might want to identify customers that reside in San Francisco, California, with a high customer lifetime value, who have also made a purchase in the last 90 days. With a few clicks, Copilot produces the results, along with information such as the customers’ average age, product preferences, or average purchase price. These insights can then be configured into a segment to support a campaign. With Copilot, marketers can now get a deeper understanding of their customers in near real-time.
This embed requires accepting cookies from the embed’s site to view the embed. Activate the link to accept cookies and view the embedded content.
Market segmentation is an important step to create personalized campaigns based on interests and needs. It also can be a time-consuming process, often requiring knowledge of the complex data structures defined by the marketing database. Query assist, a Copilot capability in Dynamics 365 Marketing, uses Azure OpenAI Service to save time creating or enhancing segments.
Marketers can describe the target audience characteristics by typing a segment description, such as “all contacts under the age of 30 living in New York City.” Rather than manually select data tables, a marketer can simply type a description of the contacts they wish to engage with, and then add the results to the segment builder. By using this simple query approach, marketers can create real-time segments without the need for knowledge of their back-end data, saving hours of time.
Create relevant, compelling, and personalized marketing content faster
Email marketing is a powerful way to engage audiences if the email content is compelling and relevant. Too often, content can begin to feel stale or repetitive over time. Content ideas, a Copilot feature in Dynamics 365 Marketing, inspires marketers by turning topics into suggested copy, helping them move from concept to completion faster.
When editing an email, a marketer can prompt Copilot with up to five key points to get across in the email. The content ideas capability uses Azure OpenAI Service to generate a set of text suggestionsunique content can be used as a starting point when composing marketing emails. It can analyze the organization’s existing emails, in addition to a range of internet sources, to increase the relevance of generated ideas. With Copilot, marketers can save hours of time brainstorming and editing, while keeping content fresh and engaging.
This embed requires accepting cookies from the embed’s site to view the embed. Activate the link to accept cookies and view the embedded content.
Content ideas and query assist are both available in public preview today. If you are not a current customer, start a free trial for Microsoft Dynamics 365 Marketing to experience the new Copilot features.
Copilot in Microsoft Dynamics 365 Business Central
Compelling product descriptions in online stores boost sales by making products stand out from the crowd. However, producing consistently engaging descriptions on-demand can be challenging, especially when writing product descriptions for dozens or even hundreds of similar products.
Copilot in Microsoft Dynamics 365 Business Central help small and medium-sized businesses to bring new products to market faster by producing AI-generated product descriptions. This Copilot feature suggests copy for engaging product descriptions, tailored to your brand using a product’s title and key attributes, such as color, material, and size. Easily customize the text to your preferred writing style by choosing the tone and length, and make any needed edits before saving. Business Central customers can seamlessly publish the new product descriptions to their Shopify store with just a few clicks.
This embed requires accepting cookies from the embed’s site to view the embed. Activate the link to accept cookies and view the embedded content.
Copilot in Microsoft Supply Chain Center and Dynamics 365 Supply Chain Management
In recent years, many businesses discovered that their current supply chain technologies are ill-equipped for an environment characterized by ongoing disruptions, constraints, and shortages. AI-enabled supply chain management can provide unprecedented visibility and insights, helping to solve disruptions before they happen.
Today we are announcing new Copilot capabilities for Microsoft Supply Chain Center, available to Dynamics 365 Supply Chain Management customers, to better predict and act on disruptions that occur across suppliers, weather, and geographies. Use intelligence from the news module to proactively flag external issues such as weather, financial, and geo-political news that may impact key supply chain processes. Predictive insights surface impacted orders across materials, inventory, carrier, distribution network, and more.
Copilot turns these insights into action with contextual email outreach generated by Azure OpenAI Service to help solve problems in real-time and with ease. With a custom and contextual reply, supply chain managers can save time and collaborate with impacted suppliers to quickly identify new ETAs and re-route purchase orders based on an identified disruption, like a weather event. They can also fulfill high-priority customer orders via an alternate distribution center to ensure they can meet customer demand in full and on time.
This embed requires accepting cookies from the embed’s site to view the embed. Activate the link to accept cookies and view the embedded content.
Supercharge the entire customer journey with AIstarting today
With every biannual release wave, Microsoft is enhancing Dynamics 365 applications with new, more powerful AI capabilities to help organizations drive business outcomes, improve operational efficiency, and create exceptional customer experiences.
The capabilities spotlighted today are just the start of AI-powered features to follow across business functions. Stay tuned to this blog, as well as the Dynamics 365 and Power Platform release planner, for further details.
Dynamics 365 Copilot
Interactive, AI-powered assistance across business functions
Microsoft is committed to ensuring that AI systems are developed responsibly and in ways that warrant people’s trust. Learn about our AI principles that empower impactful responsible AI practices at Microsoft, as well as provide a framework for implementing responsible AI practices at our customers’ organizations.
Have you ever thought about going through all your GitHub Repositories, taking note of the languages used, aggregating them, and visualizing it on Excel?
Well, that is what this post is all about except you don’t have to do it manually in a mundane way.
To build out this project in a sandboxed environment with the appropriate permissions I had to sign up on Microsoft 365 Dev Center to Create an Account that I could use to interact with Microsoft 365 products.
The outcome of the project could be seen below
Steps to Build
Generating an Access Token From GitHub
I went to https://github.com/settings/apps and selected the Tokens (classic) option. This is because that is what the Octokit GraphQL library currently supports.
I clicked on the Generate new token dropdown.
I clicked on the Generate new token (classic) option.
I filled in the required Note field and selected the repo scope which would enable the token to have access to both my private and public repositories. After that, I scrolled down and selected the Generate token button.
Next, I copied the generated token to use during my code development.
Creating a Microsoft 365 Developer Account
I navigated to https://developer.microsoft.com/microsoft-365/dev-program to create an account which would grant me a sandboxed environment to play around with different Microsoft 365 applications and I also got a temporary Microsoft domain to use for development.
Registering an Application on Azure
To interact with Microsoft 365 applications via the graph API, I had to register an app on Azure Active Directory.
I clicked on the Azure Active Directory menu on the left menu pane.
I clicked on the App Registration option.
I clicked on the New registration option.
I filled in the application name and clicked on the Register button.
I copied the clientId and the tenantId
I clicked on the API permissions menu on the left pane
To grant the registered application access to manipulate files, I had to grant it read and write access to my files.
I clicked on the Add a permission option.
I clicked on the Microsoft Graph API.
Since I wanted the application to run in the background without signing in as a user, I selected the Application permissions option, typed files in the available field for easier selection, checked the Files.ReadWrite.All permission and clicked on the Add permissions button.
At this point, I had to grant the application ADMIN consent before it would be permitted to read and write to my files.
Next, I had to generate the client’s secret by clicking on the Certificates & secrets menu on the left panel and clicking on the New client secret button.
I filled up the client’s secret description and clicked on the Add button.
Finally, I copied the Value of the generated secret key.
Writing the Code
I created a folder, opened a terminal in the directory and executed the command below to bootstrap my console application. dotnet new console
I installed some packages which you can easily install by adding the item group below in your .csproj file within the Project tag.
Next, execute the command below to install them dotnet restore
To have my necessary configuration in a single place, I created an appsettings.json file at the root of my project and added the JSON data below:
You would need to replace the credential above with yours.
In the above JSON, you can see that I populated the values of the key with the saved secrets and IDs I obtained during the GitHub token registration and from the Azure Directory Application I created.
To be able to bind the values in the JSON above to a C# class, I created a Config.cs file in the root of my project and added the code below:
using Microsoft.Extensions.Configuration;
namespace MicrosoftGraphDotNet
{
internal class Config
{
// Define properties to hold configuration values
public string? AzureClientId { get; set; }
public string? AzureClientSecret { get; set; }
public string? AzureTenantId { get; set; }
public string? GitHubClientSecret { get; set; }
public string? NameOfNewFile { get; set; }
// Constructor to read configuration values from appsettings.json file
public Config()
{
// Create a new configuration builder and add appsettings.json as a configuration source
IConfiguration config = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.Build();
// Bind configuration values to the properties of this class
config.Bind(this);
}
}
}
In the Program.cs file I imported the necessary namespaces that I would be needing by adding the code below:
// Import necessary packages
using System.Text.Json;
using Octokit.GraphQL;
using Octokit.GraphQL.Core;
using Octokit.GraphQL.Model;
using Azure.Identity;
using Microsoft.Graph;
using MicrosoftGraphDotNet;
Next, I instantiated my, Config class:
// retrieve the config
var config = new Config();
I made use of the Octokit GraphQL API to query all my GitHub repositories for repository names and the languages used in individual repositories. Then I created a variable to hold the list of distinct languages available in all my repositories. After that, I deserialized the response into an array of a custom class I created (Repository class).
// Define user agent and connection string for GitHub GraphQL API
var userAgent = new ProductHeaderValue("YOUR_PRODUCT_NAME", "1.0.0");
var connection = new Connection(userAgent, config.GitHubClientSecret!);
// Define GraphQL query to fetch repository names and their associated programming languages
var query = new Query()
.Viewer.Repositories(
isFork: false,
affiliations: new Arg<IEnumerable>(
new RepositoryAffiliation?[] { RepositoryAffiliation.Owner })
).AllPages().Select(repo => new
{
repo.Name,
Languages = repo.Languages(null, null, null, null, null).AllPages().Select(language => language.Name).ToList()
}).Compile();
// Execute the GraphQL query and deserialize the result into a list of repositories
var result = await connection.Run(query);
var languages = result.SelectMany(repo => repo.Languages).Distinct().ToList();
var repoNameAndLanguages = JsonSerializer.Deserialize(JsonSerializer.Serialize(result));
Since I am using top-level statements in my code I decided to ensure the custom class I created would be the last thing in the Program.cs file.
// Define a class to hold repository data
class Repository
{
public string? Name { get; set; }
public List? Languages { get; set; }
}
Now that I’ve written the code to retrieve my repository data, the next step is to write the code to create an Excel File, Create a table, create rows and columns, populate the rows and columns with data and use that to plot a chart that visualizes the statistics of the top GitHub Programming languages used throughout my repositories.
I initialized the Microsoft Graph .NET SDK using the :
// Define credentials and access scopes for Microsoft Graph API
var tokenCred = new ClientSecretCredential(
config.AzureTenantId!,
config.AzureClientId!,
config.AzureClientSecret!);
var graphClient = new GraphServiceClient(tokenCred);
Next, I created an Excel file :
// Define the file name and create a new Excel file in OneDrive
var driveItem = new DriveItem
{
Name = config.NameOfNewFile!,
File = new Microsoft.Graph.File
{
}
};
var newFile = await graphClient.Drive.Root.Children
.Request()
.AddAsync(driveItem);
I created a table that spans the length of the data I have horizontally and vertically:
// Define the address of the Excel table and create a new table in the file
var address = "Sheet1!A1:" + (char)('A' + languages.Count) + repoNameAndLanguages?.Count();
var hasHeaders = true;
var table = await graphClient.Drive.Items[newFile.Id].Workbook.Tables
.Add(hasHeaders, address)
.Request()
.PostAsync();
I created a 2-Dimensional List that would represent my data in the format below
The code that represents the data above can be seen below:
// Define the first row of the Excel table with the column headers
var firstRow = new List { "Repository Name" }.Concat(languages).ToList();
// Convert the repository data into a two-dimensional list
List<List> totalRows = new List<List> { firstRow };
foreach (var value in repoNameAndLanguages!)
{
var row = new List { value.Name! };
foreach (var language in languages)
{
row.Add(value.Languages!.Contains(language) ? "1" : "0");
}
totalRows.Add(row);
}
// Add a new row to the table with the total number of repositories for each language
var languageTotalRow = new List();
// Add "Total" as the first item in the list
languageTotalRow.Add("Total");
// Loop through each programming language in the header row
for (var languageIndex = 1; languageIndex < totalRows[0].Count; languageIndex++)
{
// Set the total count for this language to 0
var languageTotal = 0;
// Loop through each repository in the table
for (var repoIndex = 1; repoIndex < totalRows.Count; repoIndex++)
{
// If the repository uses this language, increment the count
if (totalRows[repoIndex][languageIndex] == "1")
{
languageTotal++;
}
}
// Add the total count for this language to the languageTotalRow list
languageTotalRow.Add(languageTotal.ToString());
}
// Add the languageTotalRow list to the bottom of the table
totalRows.Add(languageTotalRow);
I added the rows of data to the table using the code below:
// Create a new WorkbookTableRow object with the totalRows list serialized as a JSON document
var workbookTableRow = new WorkbookTableRow
{
Values = JsonSerializer.SerializeToDocument(totalRows),
Index = 0,
};
// Add the new row to the workbook table
await graphClient.Drive.Items[newFile.Id].Workbook.
Tables[table.Id].Rows
.Request()
.AddAsync(workbookTableRow);
Finally, I created a ColumnClustered chart using my data and logged the URL of the spreadsheet.
// Add a new chart to the worksheet with the language totals as data
await graphClient.Drive.Items[newFile.Id].Workbook.Worksheets["Sheet1"].Charts
.Add("ColumnClustered", "Auto", JsonSerializer.SerializeToDocument($"Sheet1!B2:{(char)('A' + languages.Count)}2, Sheet1!B{repoNameAndLanguages.Count() + 3}:{(char)('A' + languages.Count)}{repoNameAndLanguages.Count() + 3}"))
.Request()
.PostAsync();
// Print the URL of the new file to the console
Console.WriteLine(newFile.WebUrl);
After executing the command: dotnet run, I got the URL or link to the excel file as an output.
On clicking the link I was able to view the awesome visualization of the languages used across my GitHub repositories.
And that’s the end of this article. I hope you enjoyed it and got to see how I used Microsoft Graph .NET SDK to automate this process.
Is a hackathon for beginners to get started building scenario-based apps using .NET and Microsoft Graph. In this hackathon, you will kick-start learning how to build apps with Microsoft Graph and develop apps based on the given Top Microsoft Graph Scenarios, for a chance to win exciting prizes while meeting Microsoft Graph Product Group Leaders, Cloud Advocates, MVPs and Student Ambassadors. The hackathon starts onMarch 1stand ends onMarch 15th. It is recommended for participants to follow the Hack Together Roadmap for a successful hackathon.
This article is contributed. See the original author and article here.
Happy Friday, MTC’ers! I hope you’ve had a good week and that March is treating you well so far. Let’s dive in and see what’s going on in the community this week!
MTC Moments of the Week
First up, we are shining our MTC Member of the Week spotlight on a community member from Down Under, @Doug_Robbins_Word_MVP! True to his username, Doug has been a valued MVP for over 20 years and an active contributor to the MTC across several forums, including M365, Word, Outlook, and Excel. Thanks for being awesome, Doug!
And last but not least, over on the Blogs, @Hung_Dang has shared a skilling snack for you to devour during your next break, where you can learn how to make the most of your time with the help of Windows Autopilot!
Unanswered Questions – Can you help them out?
Every week, users come to the MTC seeking guidance or technical support for their Microsoft solutions, and we want to help highlight a few of these each week in the hopes of getting these questions answered by our amazing community!
Did you know that the little wave-shaped blob of toothpaste you squeeze onto your toothbrush has a name? It’s called a “nurdle” (the exact origin of this term isn’t clear), but there was even a lawsuit in 2010 that Colgate filed against Glaxo (the maker of Aquafresh) to prohibit them from depicting the nurdle in their toothpaste packaging. Glaxo countersued, and the case was settled after a few months. The more you know!
Recent Comments