- Pre-requisites
- Setup
- Visual Studio
- An Azure Active Directory (Azure AD) tenant. For more information on how to get an Azure AD tenant, see How to get an Azure AD tenant
- A user account in your Azure AD tenant.
From your shell or command line:
git clone https://github.com/JolokiaCorporation/nextech-calendar-service-poc.git
or download and extract the repository .zip file.
Follow the steps below to manually walk through the steps to register and configure the applications in the Azure portal.
As a first step you'll need to:
- Sign in to the Azure portal.
- If your account is present in more than one Azure AD tenant, select your profile at the top right corner in the menu on top of the page, and then switch directory to change your portal session to the desired Azure AD tenant..
- Navigate to the Microsoft identity platform for developers App registrations page.
- Select New registration.
- In the Register an application page that appears, enter your application's registration information:
- In the Name section, enter a meaningful application name that will be displayed to users of the app, for example
NextechAREvents
or another name as you wish. - Under Supported account types, select **Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox) **.
- In the Redirect URI (optional) section, select Web in the combo-box and enter the following redirect URI:
https://localhost:44351/api/Home
or the URL where you will run the WebAPI.
- In the Name section, enter a meaningful application name that will be displayed to users of the app, for example
- Select Register to create the application.
- In the app's registration screen, find and note the Application (client) ID. You use this value in your app's configuration file(s) later in your code.
- Select Save to save your changes.
- In the app's registration screen, click on the Certificates & secrets blade in the left to open the page where we can generate secrets and upload certificates.
- In the Client secrets section, click on New client secret:
- Type a key description (for instance
app secret
), - Select one of the available key durations (In 1 year, In 2 years, or Never Expires) as per your security posture.
- The generated key value will be displayed when you click the Add button. Copy the generated value for use in the steps later.
- You'll need this key later in your code's configuration files. This key value will not be displayed again, and is not retrievable by any other means, so make sure to note it from the Azure portal before navigating to any other screen or blade.
- Type a key description (for instance
- In the app's registration screen, click on the API permissions blade in the left to open the page where we add access to the APIs that your application needs.
- Click the Add a permission button and then,
- Ensure that the Microsoft APIs tab is selected.
- In the Commonly used Microsoft APIs section, click on Microsoft Graph
- In the Application permissions section, select the User.Read.All, Mail.Send and Calendars.ReadWrite in the list. Use the search box if necessary.
- Click on the Add permissions button at the bottom.
- Click on Grant admin consent for Nextech AR solutions
Open the project in your IDE (like Visual Studio or Visual Studio Code) to configure the code.
In the steps below, "ClientID" is the same as "Application ID" or "AppId".
- Open the
NextechAREvents\appsettings.json
file - Find the app key
TenantId
and replace the existing value with the TenantId from your AzureAD tenant. - Find the app key
ClientId
and replace the existing value with the application ID (clientId) of theNextechAREvents
application copied from the Azure portal. - Find the app key
ClientSecret
and replace the existing value with the key you saved during the creation of theNextechAREvents
app, in the Azure portal. - Replace the
DefaultOrganizerUserId
with a valid user id in you AzureAD, this will be the organizer for all event send through the WebAPI. - Check for the InfernoAPIUrl, this must be the URL for the Inferno WebAPI to obtain the Inferno Events.
- Find the InfernoAPIKey and replace for the user InfernoAPIKey that you wish to use to gain access to the InfernoAPI to obtain the Events.
- Find the
DefaultConnection
and replace with a valid connection string to a SQLServer database instance.
You can run the sample by using either Visual Studio or command line interface as shown below:
Clean the solution, rebuild the solution, then go to View menu, then Other Windows, then click on Package Manager Console, and run the update-database
command and wait for successful database creation, at last run the WebAPI from VisualStudio.
When you start the Web API from Visual Studio, depending on the browser you use, you'll get the swagger index.
- You must have remote access enabled in SQLServer.
- You must have a username and password configured for the login.
- In the 'appsettings' you should have a Connection String similar to this "Server=[IP example-> 10.10.10.5];Database=InfernoAREvents;User Id=[user];Password=[pass];"
- This may vary based on the version of the SQLServer and where the DB service is located.
- Go to the repository directory(/)
- docker build . -t nextech
- docker run -d --name nextech -p 80:80 -p 443:443 nextech