Showing posts with label product. Show all posts
Showing posts with label product. Show all posts

Wednesday, February 4, 2026

Connecting to OneNote in the Cloud with Office 365 APIs

hi my name is Vijay Sharma and I'm a
product manager for Microsoft OneNote
team today in this video I'm going to
talk about OneNote api's for office 365
I will talk about how you can use the
api's and show you a quick demo of an
application that uses one or api's and
see some code behind lastly we will talk
about one or team's roadmap for
developers all right I am very glad to
announce the general availability of
OneNote api's for office 365 starting
today you can now write apps that can
access OneNote notebooks store in
onedrive for business sharepoint site
hosted notebooks and notebooks in office
365 groups now we already have the
consumer version of OneNote api's the
new version of OneNote api's for office
365 brings parity with a consumer api's
this is a great opportunity for
developers the office 365 market is
growing at a very fast pace and these
api's enable developers to build apps
for a vast majority of businesses and
educational institutions that use office
now this is a high-level architecture of
OneNote rest api with one node API you
can use poast
to create notebooks section section
groups and pages you can call get to get
the notebook hierarchy pages and page
content you can also use update and to
update a page and delete a page I will
walk you through each of these api's and
then show you a quick demo of how to use
the api's now before we start looking
looking at the code I just want to give
you a quick reminder that you need to
register your app with office 365 before
using the api's you can find
instructions to register your app and a
connect site a kms
one node and connect 2015 now here is
how you create a page in OneNote this is
a simple HTML that you can post to
create a page in OneNote what you see
here is a body which in this case
contains a header and an image when you
post this HTML to OneNote it will create
a simple page in one node with the title
and the image now one node has an
hierarchical structure you have
notebooks under that here section groves
under the rear sections and then pages
here is how you get the notebook
hierarchy you can use a notebooks
endpoint to get all of the users
notebooks similarly you can use the
section groups endpoint to get all the
section groups of the user and sections
endpoint to get all the sections but if
you want to avoid making a separate
network call to get notebooks and then
sections and section groups you can just
use expand at the very bottom of the
screen to get entire hierarchy in one
network call now here is how you get a
page now when you for getting a page you
can also pass you can also get we can
pass filters to get the most recently
modified pages now to update a page you
first get the page content and passing
the include IDs parameter set to true
what this will do is this will assign an
ID to each element in the content and
then you can use these IDs to update
that element in the page now let's
switch to a demo and see the code in
action alright to demo this api's let's
first look at a business problem I
travel a lot and meet a lot of customers
I exchange business card with the
customers and end up having a lot of
business cards so how can I organize my
business cards I'm going to use my
office lens app to scan a business card
and save it to my notebooks storing
onedrive for business okay I'm going to
use the office lens app to scan the
business card and save it into my
notebook here I scan the business card
and then I save it into my notebook in a
section called business cards I save it
over here now I was already logged into
my office 365 account and this business
card should get saved into my office 365
notebook now let's flip over to my
notebook that I saved this business card
you see there is an image of the
business card and you also see some
useful information like email phone
number etc OneNote actually extracted
this information from my business card
and saved the VCF file in my page this
is very useful information I can then
add my notes to this contact additional
meeting notes and save images right here
in OneNote now let's look at the code in
Visual Studio here's a sample code that
creates a OneNote page using the post
api's first I do and do create an HTTP
client set the default header and set up
the authentication we are going to use
OAuth authentication and set that as a
bearer token here is a simple HTML that
contains the image of the business card
notice that I have a div where I set the
data render method to extract and
provide a source image what this does is
it tells one node to extract useful
information from the image and the API
will analyze the image and see if is a
business card or a recipe or a news
article and extract relevant information
from the image this is very very
powerful now here is the post method of
the HTML now here I post the HTML to a
section in my notebook
by specifying the full URL of the URL
part and a multi-part content with the
HTML and the binary of the image I then
posted a sync and it will create a new
page in OneNote and extract the business
card from the image so this is how you
create content in OneNote
now this stuff was pretty useful but
wait there is more
what else can you do with the content
saved in OneNote what if I want to send
a quick email to one of my contacts
after the meeting so let's switch to
Outlook and see if we can send an email
to my contact now OneNote team build a
sample add-in for Outlook that goes over
all your notebooks sections and pages
and extracts business cards from my
notebooks and shows them as a contacts
right over here so let's fire off this
add-in and it will bring all my contacts
into OneNote so you see all my contacts
are over here and I can start writing
email to my contacts now this
information was very useful
imagine you meet somebody you scan their
business card and put into one node you
can start writing email to them within
five minutes now let's look at the code
behind these api's here is some
JavaScript code to call the OneNote REST
API to get the nose and sections I'm
going to use expand to get all the
notebooks sections and pages in one
network call once I get the pages I want
to get the page content here I call the
page content API and pass in the section
ID and page ID to get the page content
once I get the page content I have
walked through the HTML and see if the
page contains a VCF file as an
attachment if there is an attachment I
extract the email and name from the card
and show it in my user interface this
was pretty simple but very useful now in
our demo we use the OneNote REST API
endpoint to perform operations on
notebooks you can also use a converge
endpoint at graph dot microsoft.com to
access OneNote notebooks Microsoft graph
is a single converged endpoint to access
information about users groups files
messages calendar contacts tasks and
notes all under the same roof now the
graph API for OneNote are currently in
preview and should be available next
year so what's next from one noting we
are currently working on Arab enabling
live one note pages embedded on a
website this allows you to embed OneNote
pages in your website users can then
take notes in OneNote right from within
your website that would be really cool
we are also working on OneNote add-ins
this will allow you to build add-ins for
OneNote and publish them on office store
lastly we are also working on tools to
showcase apps and also some more samples
now if you have some suggestions please
reach out to us on a one north's user
voice page and let us know what you need
now I'm sure by now you must be really
excited about all the opportunities with
OneNote api's for more information it
related to one or api's please go to dev
godwyn or calm and get all the
documentation core samples videos and
blogs please engage with us on Stack
Overflow or Twitter let us know what
cool apps that you're building and thank
you so much

Debugging GUI Applications in a GitHub Codespace

hi I'm Michael price I'm a product
manager on the visual C++ team you may
know that you can debug uh an
application in a codespace from from vs
code uh just fine but uh guey
applications on Linux which all codes SP
all GitHub codes spaces are Linux based
uh if you have a guey application there
it's usually written in um a framework
called X or X11 and in order for those
things to show up on a Linux desktop uh
you have to have what's called an X
server and it has to be connected to
some display that is a video device but
in a GitHub codes space um those are
headless VMS running out in the cloud
and so there is no video device or
display for uh X applications to to
connect to to display all of their guey
so this talk is going to show you how
you can make that work uh on your
Windows system
so this is a very simple diagram that
sort of explains the components and
parts uh that will make this work so you
you can see in this diagram that we have
a Windows system and we have a GitHub
code space and that we have an instance
of vs code either running in a web
browser or on the desktop uh that will
connect to the VSS code uh that is
running inside the code
space um and so whenever you run the
application you want to debug in vs code
um it doesn't know where to send that
that uh gooey information to so the
other pieces that you need to be running
here um is you need to actually set up
an X foring SSH connection between the
windows subsystem for Linux that's
running on your Windows system and the
uh the the SSH Damon that's in the code
space um the other little piece of magic
that just automatically happens here is
that um WSL has a feature called WSL G
and that just uh forwards any of the
gooey elements that show up in your
local WSL instance to your Windows
desktop so whenever you have those
pieces in place uh and you launch your
application to debug it um all of the
X11 commands all the things that do the
rendering on the screen will get
forwarded through the SSH connection and
then through WSL um back to your Windows
desktop uh where you can actually drive
your guy application uh for your
debuging
purposes you can roughly break down the
steps that you're going to need to do
into you know four four parts so first
you're going to create a code space I'll
show you how to do that um then you're
going to need to set up local SSH ke key
authentication uh that you would set up
and it'll work through the GitHub CLI
the GH uh
application um and then you need to
actually adjust your codespace some so
that the X1 forwarding works and then uh
you can uh go off and do your debugging
work and I'll demonstrate that as
well so to show an example of what uh
what we need to do here I'm going to use
this repository go- CPP this is is an
implementation of the go board game that
I use often and I have only ever had a
console UI for this but I'm in the
process of adding a a guey front end for
this thing so I have this Branch
multiple front ends that's already got
some basic code there I'm going to make
a codespace by going to the code
dropdown and select create codes space
on multiple front
ends this is going to create a code
space in the background uh as you can
see here I've have bed this up so we
don't have to wait a long time uh this
is going to make a code space on the
back end and then get a vs code instance
in my browser that is connected to it
and there it goes it's uh it's connected
up uh you know I like to pick a color
theme for each project that I'm working
on uh way I can distinguish between them
and I prefer darker colors so let's pick
uh let's pick this one here excellent
it'll install that extension and I have
my dark color theme uh I'm going to do
some cleanup of some of the windows are
going to pop up and configuration is
going to happen I'm going to speed up
through
that and all right configuration is done
I've closed all the windows that came up
uh needed to make it a little bit bigger
it was a little hard to see so it's
bigger now we can we can uh read it a
little bit more easily I'm going to do a
build now this is going to go and do the
build just like it normally
would it's not a very big project so it
doesn't take very
long okay build's done uh I'm going to
go set some break points uh let's set a
break point in one of the error
conditions and we'll set a break point
uh on the quit the Clos window event uh
the quit event as well let's click debug
uh we'll select the guey and off and the
debugger is
running so we see that the debugger
stopped in our air condition so let's
just go ahead and step through this and
uh figure out what it is that the error
what what error it's telling us so it's
saying no available video device this is
what we expected right like this is a
headless machine it doesn't have a video
device connected to it uh so I did not
expect this to work and that's the error
that I was
expecting so what we need to do first um
in the Second Step uh in the list that I
laid out is set up S SSH uh key
authentication so we're going to run SSH
keyin inside our WSL uh shell now an
important part here is you want to give
this a very this key pair a very
particular name of codes spaces. Auto
there's a reason why that you'll see
later so I'm going to copy the contents
of the public key that was generated um
you can see it generated both the public
and the private key we're going to
select the cont ents of the public keyy
I'm going to have it blured out here uh
and I'm going to I'm going to copy that
and we're going to then use that in the
next part of this
step okay so what we need to do is you
need to go to your github.com uh profile
should just be github.com and then your
username you'll click on the little icon
in the upper right uh it's going to pull
down a drop down list and you're going
to find settings and click settings
okay go to SSH Keys SSH and gpg keys and
add a new SSH key give it a title
whatever you want to name it and then
you'll paste the key that you copied
that public key into that key
field there we go and then click add SSH
key your SSH key is now added so let's
go back to the
console uh and make sure that that
actually
worked okay back in the console uh we're
going to use the GH uh application this
is a command line utility you can use to
interact with GitHub uh there's this
codespace command you can see all the
interesting stuff you can do with code
spaces we're just going to list the code
spaces that are in my account uh you can
see my code space that I made is there
uh you can view more details about a
code space um if you have multiple will
give you an option to choose but for now
what we're going to do is we're going to
use the GH codespace SSH command to
actually establish an SSH connection to
that code
space okay it looks like it connected so
just you know as an attempt to see we're
going to try to run the the the guey
here and see what it tells us okay it
tells us the same thing that was also
expected now we're going to f fix that
in a minute uh but first I wanted to
show you an additional little um uh tip
on how you can make sshing into your
codes spaces a little easier there's a--
config option to SSH that will actually
print out to standard out the stuff that
you would put in your SSH config file uh
so that you can more easily connect to
it when you do this if you if you
redirect it and append it to your SSH
config file this lets you then um use
tab completion and such uh for your code
spaces you don't have to go through the
GitHub uh user interface you can just do
it directly from your standard SSH
client okay now that we've got that set
let's go back to the codes
space so what we need to do now is we
need to actually go set up the X11
forwarding in your code space so in
order to do that uh you're going to want
to make sure that your codespace has the
X off package installed so I'm going to
let co-pilot kind of give me some hints
it did kind of the same thing it was
supposed to did above but that's okay it
got me most of the way and I'm going to
replace that with xof I'm not going to
accept its suggestion for X11 apps uh
cuz I don't need them for this uh but
those are some pretty cool apps if you
just want to test out X forting on your
own you can use those when you do this
uh you now need to rebuild your
container um so if you go up and um find
the re uh code spaces rebuild container
setting uh our option you can rebuild
this container we'll fast forward
through this because it takes a couple
of
minutes okay the container has been
rebuilt excellent
but there's still a few more things we
need to do let's go back to our console
uh our WSL console this time we're going
to pass the -
XY uh switch to SSH this is the thing
that actually establishes the X11 ter uh
forwarding so now we're going to run our
guy and now when we run the GUI on our
local Windows system we're going to see
the GUI app that we tried to run there
the the forwarding is now working
correctly from this uh session that I
established over
SSH but that doesn't quite get us what
we want because it works inside this
session and it works because of the um
display environment variable is set to
that so we'll need to know that piece of
information to make this also work in vs
code so if we try the same thing in vs
code you can see that the display
environment variable is not set we need
to have it set to the same thing that
our forwarding session has it set to so
if you go into your Dev container Json
you can add a remote M field with
display and you set it to the same value
that was in your SSH forwarding session
now when you rebuild the container this
time it will cancel or it will close out
your SSH forwarding connection because
the machine goes away so you will have
to reestablish that connection after you
do this reset and the display shouldn't
be changing between different sessions
um but just to make sure we're going to
go back and establish that forwarding
connection again in our SSH
client and we're just going to double
check and make sure that the value of
the display environment variable didn't
change between these
sessions okay it's the the same in both
places so now we're going to go over to
the vs code instance and we're going to
click
debug and you can see this time the
application came up and it's running I
can see the guey in my windows client
but the application is running on the
codespace and I'm debugging it through
my browser vs code
instance so you can see um we'll to the
terminal you can see as I move my mouse
around and press keystrokes different
events are getting sent to
it and then when I go over and I hit the
close window button I should get that
break point over in vs
code aha it's been told to quit so the
breakpoint fired and now I can just
continue through that and the app should
close and we successfully debugged our
guy application running inside a GitHub
code space while we're on our Windows
system so just to recap you know I
showed you how to create a code space
it's pretty easy um setting up SSH key
authentication is a little bit more
complicated but not too much there were
a couple of tricks with the GH tool that
lets you SSH into your GitHub code
space um then we set up the code space
to do X11 forwarding the the two parts
of that were making sure that the X off
package is installed and also making
sure that you set the display
environment variable
correctly um and then once you have
those things done uh and you've
established at SSH forwarding connection
from your local machine to the GitHub
Cod space uh then you're off to the
races and you can debug all your guey
apps and make the most beautiful
applications uh that run in the Linux
desktop uh that anyone would ever
want uh thanks for watching the talk and
I hope you enjoy the rest of pure
virtual C++ this year and if you want to
get in touch with the Microsoft C++ team
you can reach us at visual CPP
microsoft.com

Deep Diagnostics for Web Apps with Application Insights

hello i am rahul Bogoria a product
manager on the visual studio application
insights team in today's increasingly
complex world of software having access
to the most relevant data that can help
you detect and fix production problems
as well as make future business
decisions is crucial for your
applications to succeed application
insights is a preview service in the
Microsoft Azure portal which can
definitely help you succeed
with deep Diagnostics and analytics
capabilities for any of your web apps
and services in this video I am going to
give you an overview tour of application
insights and discuss how you can detect
triage and diagnose real-world problems
for your web apps and services we will
visit the azure portal and I will take
you through a deep Diagnostics
experience with application insights for
a fully configured production app we
will discuss how quickly you can get
started on any web platform and in the
end we will cover the resources so that
you can learn more about the service and
get started today
application insights is an end-to-end
solution where telemetry data is
collected at every tier sent to the
cloud for processing and storage and
made available in a powerful and
interactive experience in Azure portal
we can talk about this in terms of three
key pillars firstly application insights
gives you a comprehensive view across
your entire application stack with deep
performance and diagnostics telemetry
available out of the box which you can
support with any custom data using our
open source SDKs secondly it provides a
set of powerful exploration tools
enabling you to quickly identify and
diagnose issues SS customer impact and
prioritize accordingly thirdly
application insights makes telemetry an
integral part of your development
process bridging pre and post production
testing and monitoring and providing
integrated experiences with Visual
Studio visual studio team services
and as your Diagnostics application
insights provides you with deep insights
and analytics enabling you to easily
detect and diagnose issues and
prioritize them based on their impact in
a typical detect triage diagnosed
scenario it provides a suite of
capabilities that you can take advantage
of to detect issues you can set up
synthetic availability tests pinging
your site at regular intervals from
points around the globe you can set up
elaborate multi-step web tests to
monitor resources and availability of
your back-end services and you can
monitor real user response times and
failure rates with threshold based
alerts notifying you in real time once
an issue is detected you need to assess
the impact and triage the situation with
information on real user impact and
affected requests it makes it easy to
prioritize fixes if 1% of all HTTP
requests fail that might not sound too
bad until you discover it's click here
to pay button that's failing so once you
are ready to diagnose the problem you
can go deep and analyze your data in
different ways slicing and dicing
acquiring logs and ultimately getting to
the line of code that requires fixing
all this correlated with any contextual
information required around request
performance counters remote dependencies
etc so let's check this out with the
demo here we are in the Microsoft Azure
portal where the application and site
service is hosted I'll click on one
asp.net application that I have been
running for quite some time
this application is hosted on an azure
VM and in one single look I can monitor
how my application is performing both
from client side as well as server side
I can also see how many failures are
occurring that I might want to care
about I can drill down into any of these
charts and metrics to get more details
and more context about these so let's
have a look I'll click on the server
response time chart and get more details
about that particular chart
I can see the server response time data
split across different continents and I
can get a sense of what's the average
response time looking like similarly I
can get details around the dependency
duration what's the typical request
pattern how many dependency calls are
made and so on if I go down the blade I
can get details around the slowest
requests that my site was generating and
some of these I might want to drill down
and explore further to diagnose the
issue similarly I can click on the
browser page load performance and get
more details from the client side on
what was the response time there how
many page views occurred and get a split
on the client performance around client
processing time send request time
receiving response time and so on I can
get a sense of the slowest page loads
which might be interesting for me to
figure out and diagnose further similar
to this I can click on field requests
and get more details about the failures
occurring for my application now these
failures can be occurring anywhere these
may be in your code in the back-end
service these might be in the
dependencies that you are calling for
example you are doing a database called
you are calling a web service some as
your storage requests so the issue can
happen anywhere and with application
insights you can track all of them very
easily now in this particular chart I
can get a sense that out of all the
failed requests that occurred in the
last 24 hours
there is a split of 304 occurring on
Internet Explorer 3 on Chrome and I can
get some insights and patterns from that
I can see that a total of seven
dependency errors have occurred and the
typical exception rate has been around
50 exceptions per hour which is a bit
high for my application and I would want
to figure out what's going wrong so once
I come down I can get a sense of which
are the most popular errors so I can see
that 98% of my errors are happening in
some report requests whereas only around
1.5 percent are occurring in a customer
create scenario while that is low from
my purse
that's a more important scenario that I
would want to resolve earlier so I click
on that to get a more instance level
detail on that particular issue now for
this particular error I can get each
individual instance on when that
exception occurred I can get a sense of
the real user impact as well so I can
see that there were five failures but
only two real users were impacted so in
a real situation this will give you an
idea about how many actual users got
impacted by some production issue with
which you can either take a
prioritization decision or impact your
communication methods so let us click on
one particular instance of this
exception and see what details we can
find to diagnose and solve the problem
so once the blade opens I can see
details around that particular failed
eQuest I can see what was the response
time what was the exact URL what was the
response code when did it occur and all
the different things I can get the
entire exception and I can click on it
to see the details around the exception
message as well as the entire call stack
now with this call stack I can easily go
to the exact page where the exception
was occurring and be able to drill down
the problem coming back I can see all
the remote dependencies that this
particular request was calling now with
application insights all these
dependencies are being monitored out of
the box without you having to write a
single line of code so in this
particular request there were multiple
database calls and one of them failed at
the end and that was the exact issue
with which this request failed now if I
want to diagnose that I just have to
click and get more details around that
failed dependency call I can see the
details that it's a sequel dependency I
can have the sequel statement where the
problem occurred as well as a dependency
call stack to be able to help me figure
out who I need to approach another thing
which is very important when you are
diagnosing a real production issue is to
figure out how the user could have
reached that particular point in the
product where they hid that issue and
that is where all telemetry for this you
session helps you a lot since
application insights is collecting all
the different data points from across
your application stack so we are able to
capture oil dependency calls all these
traces that you are sending all requests
that are generated even user pageviews
exceptions and any custom
instrumentation that you would have sent
from the SDK now with application
insights you can get a timeline based
view of when the from the point that the
user started a particular session what
exactly did they do so they came to the
home page a couple of log messages were
captured a dependency was called so on
and so forth till the point they hit an
exception and exited the scenario now
with this information it empowers you as
a developer to retrace or reproduce that
entire failure sequence and be able to
solve that situation much better now
let's come back to our overview page out
of all these metrics and properties that
we are just seeing here you can set up
alerts on top of any of them now these
alerts you can set up your own flexible
thresholds and say that if something
goes beyond or below a particular
threshold you can immediately get a
real-time email alert as an example I
have an alert setup here which says if
my CPU go the usage goes more than 10% I
want to be immediately alerted with an
email similarly you can set up alerts on
any custom metric any out-of-the-box
metric that application insights is
collecting for you we talked about
availability tests you can set up URL
ping tests and multi step web tests
right from the azure portal and all of
these web tests can be run in a regular
duration typically five minutes or so
and you have an option of around 16
global points of presence with which you
can test your data and once a failure
occurs you can click on a particular
failure you can get a geographically
distributed view and you can see what
has been the average response time for a
from a particular location and get more
and more details that you would wish to
diagnose further similar to this if
I am interested I can trade down further
into performance counters as well things
like IO memory process CPU and so on and
even get some basic usage and session
level details around how many active
users I have what are the most popular
pageviews how many sessions have
occurred and so on
with application insights you get this
entire interactive experience on the
azure portal but you also can export the
data directly to an azure blob storage
on top of which you can write your own
custom processing engine and they also
have articles available with which you
can set up an export to power bi to
excel to sequel and so on essentially
allowing you to further process and
correlate with any other data sources we
just saw how easy it is to detect triage
and diagnose issues in real time with
application insights it is equally easy
to get started for any web app or
service that you want to monitor if you
have access to code and can instrument
and redeploy the application you can get
the full suite of telemetry data
including basic usage and session
telemetry application insights comes as
part of Visual Studio for asp.net
developers integrates with the
Diagnostics hub in Visual Studio and
provides flexibility to search
production monitoring data right from
the ID you can also add our plugin to
eclipse for Java apps or use the
JavaScript snippet to monitor browser
side telemetry in HTML Javascript
websites if you want to monitor an
application already in production and do
not want to redeploy you can still get
the standard performance telemetry by
installing status monitor agent on your
is server or even with Azure extensions
for as your VMs or as your app services
to reiterate all our SDKs are open
sourced on github and available for most
of the popular web platforms with which
you can get started today and that wraps
up a quick overview of application
insights please consult these resources
for more information
and do look for other connect videos
diving deep into ALM and develop
scenarios we are looking forward to your
feedback and we hope it helps you to be
successful and much more productive
thanks for watching