Welcome to this series of hands on
tutorials from the SAP HANA Academy I'm Philip Mugglestone
in this series. We're covering SAP Graph
in this video tutorial, we're going to create a service instance for SAP Graph
Now,
previously we've created a sub account and we've set up the destinations either
using the sandboxes as we can see here or using real systems.
So we've got our destinations.
Now we're ready to go ahead and create our SAP Graph service instance.
So to do that first thing we'll do is double check
that we've got the entitlements to do that.
So if we look at our list of entitlements
we can search on graph and we can see that
the free plan has been assigned to this sub account.
So we're good to go.
We did that in a previous video tutorial but if it's not there,
this is the place where you would actually
then go ahead and configure the entitlements,
then we can go to services
and instances and subscriptions
and now we'll create our service instance
so he create and for the service where we're gonna choose
SAP Graph and then we select from the list of available plans in this case we're
going to use the free plan for the runtime environment you can set it to other
but then we'll need to give a name for the service instance. We're gonna create.
Now I'm going to give the name, that's the same as the sub account name.
It's our project name. So shagraph
hit next.
Now you need to specify in JSON format,
a little bit of configuration that you don't
have to but I would strongly recommend that
you do now you probably want an example of what you're gonna actually put in there.
Well the online help has some examples or also you can
go to GitHub for the SAP HANA Academy go to the repositories
and find the repository called SAP Graph
And in there you'll find that there is
a file which is called instance parameters dot JSON
if you select that,
you'll see
it's got an example of some JSON you can use, I'm going to
copy that,
I'm going to paste it in.
So what does it mean?
We're basically set up a couple of things,
we're going to set up a name used within SAP BTP for this service instance
now this should be unique.
I would probably recommend that rather than leaving it
empty which case you would get a default of a
GUID I set it to probably something like the same name as your unique sub account
that would be much easier to understand what's going on later.
Also when you're working with client
applications and they're using user authentication.
So principal propagation,
then you'll need to also make sure that you have the URL of your
client applications available in this allow list the redirect URI s by default,
you'll get localhost,
which means you can use the graphctl command line tool but you
can also create client applications locally run them locally off your desktop
but for real systems of course you would need to add those URIs
here but you don't have to do it right now up front,
you can do that at a later date when you've
actually got those client applications because the developer will know what
those host names and effectively URIs for those client applications
will be able to come in and do that later.
So what I recommend you do here is you copy
this and then you go to any kind of text editor.
So here I've got visual studio code
and I'm gonna paste
that definition in so that we can come back and access this later
because we made a change to it.
So let's go ahead and just save that
so let's call it instance parameters dot JSON locally.
Okay,
now we can go ahead and hit next
and finally we can hit create
And after a short moment you should find that you have an instance created.
One thing I can point out while we're waiting for that instance to be created
is that you can create any number of service instances within this sub account
but effectively they're going to access
the same graph environment because the graph
environment that you've got is fixed basically 1-1 with your sub account.
So if you want completely separate graph environments then
I would recommend you do those from different sub accounts
and of course they will then get a different set of destinations
are gonna be different for that specific project now what we'll also need to
do is to create some credentials so
that you can access the SAP Graph service instance
so to do that we can click on three dots and choose create service binding
and then give it a name, I'll call it shagraph-creds
and I'll hit create
and once that's done we click on the three dots here we can view it or
what I'm gonna do is download this information
you're gonna need to have this information to hand
as the administrator. This is also information you're gonna need to pass on
to the key user and also the developer.
Now what I'm gonna do is just rename that make it
a little bit easier for us to to view for example,
go to our downloads.
I'm gonna rename that to a JSON file.
I'm gonna put it into my documents folder
so that if I now have a look at that
now I can see those credentials and it's formatted nicely.
So we see we've got some specific information in there.
We've got actually the URI that's the main URI for accessing SAP Graph if your eagle
eyed you'll notice that the
host includes eu30 because actually the graph
system you're going to be using isn't actually in eu10 it's actually in a different
system but that's all managed by SAP Graph so you don't need to worry about it.
Just make I'm sure that you use the URI that you've been given
and for the authentication we can see we've got
a credentials with the URL to get no auth token
and also we've got client id and client secret
that's information that will be making use of later
and that's key information for the graph key user
and also for the developer of an application.
Now as one final thing we need to do as the administrator
to actually get finished here is to enable a key user for SAP Graph typically
that's a different kind of person are so it may be the actual administrator,
it may be a different person.
So what we're gonna do is any case is to authorize a user for that.
So for our sub account, what we need to do is to go down to the security section
and choose role collections
we're gonna need to create a role collection for this,
you can call it whatever you want,
I'll call it
like this,
hit create
and once that role collection is created we can select it
and choose
edit
and then we're gonna need to add a very specific
new role which is SAP_Graph_Key_User
that role basically got created when we created our service instance
add
also
at this point I can authorize a user, I can assign a user to this role collection.
So I'm going to assign myself
so that's my user,
I need to press the plus sign to make sure that happens and it's saved.
Now of course you can come along and authorize other
users at any point in time by coming in and
adding the users here and assigning them the role collection.
You can click here and you can see you've got the option
to look at role collections and to assign a role collection to a user.
But we can see here that one has been assigned.
In my case for the video tutorials,
I'm going to be using this account but in your case of course that can
be whichever business users you want to be enabled as a graph key user.
So what we've seen in this video tutorial is how we can create an instance of the graph
service. So here's our service instance.
We've created a service binding to get the credentials and we've also created
a role collection and assign that role collection to our key users for SAP Graph
you can find more video tutorials on our Youtube channel
if you'd like to be informed.
As soon as new video tutorials are published then please subscribe.
Thanks for watching