Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel7

System Profile

Business Owner

System Full Name

Aeronautical Products API

System Full Name (FR)

Produits Aeronautique - Prestation de services API

Business Administrator

Director

Subject Matter Expert

Michelle Coelho

Division

NTARS Code

 

Source Code Location

https://dev.azure.com/transport-canada/DSD-CIVAV Support/_git/NAPA-SNAPA_API

Client ID

https:/APSD-PAPS_API/portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/Overview/appId/22897920-2e0b-4e97-80ca-fbc41c5805cb/isMSAApp/

KeyVault Secret

https://portal.azure.com/#@034gc.onmicrosoft.com/asset/Microsoft_Azure_KeyVault/Secret/https://civav-dev-keyvault.vault.azure.net/secrets/APSD-PAPS-PowerApps

Technology Assessment

Platform Type

 API 

Database Platform and Version

Oracle 11g 

Development Language and Framework

C#, .NET Core 6

Operating System and Version

 

Additional Dependencies

 

Authentication

 Azure AD

Environment Access Information

Note: the dev server dev external need to be updated to .netcore6. At this moment, the old version (.netcore3.1) is running.

API Architecture

...

doesn’t have a certificate to work with https

Azure Resources

Resource

Development

Production

Resource Group

TC-DevTest-CivAv-RGP

App Registration

CivAv-Dev-NAPA-SNAPA

CivAv-Prod-NAPA-SNAPA

Key Vault

civav-dev-kv-napa-snapa

(kv-napa-snapa-api-clientsecret)

civav-prod-kv-apsd-paps

API Architecture

...

API Infrastructure

...

➕ points

➖ points

Integration with Azure (Azure AD and possibility with KeyVault)

VPN dependency

Using the last version for software development platform

Oracle connection dependency

Not scalable because is inside IIS

30% of the app's power is being used

Availability not guaranteed 24/7

The goal

This same API, one time in the cloud, all negative points will be removed automatically.

...

Azure configuration

...

App registration

...

 Civil Aviation - Aviation civile

...

Database Platform and Version

...

Oracle 11g 

...

...

C#, .NET Core 6

  1. The redirect URL from the API needs to be registered on app registration

    Image Modified
  2. The option Access tokens need to be activated

    Image Modified
  3. In Exposed API, add a scope

    Image Modified
  4. Give access to your client ID

    Image Modified
  5. In API permissions, grant access to your scope

    Image Modified
  6. This configuration will be used in your API

    Image Modified
  7. To configure your endpoint, you can see from here

    Image Modified

API Access

  1. Open the API in development (see the address up)

  2. Click on Authorize

    Image Added
  3. Select the scope and click on Authorize again. The Microsoft login page will open and you need to enter your credentials as MSTeams.

    Image Added
  4. After that, you can try to execute an API

How to Publish NAPA-SNAPA API

  1. Clone the repository: https://dev.azure.com/transport-canada/DSD-CIVAV Support/_git/NAPA-SNAPA_API

  2. Open Visual Studio Code

  3. Configure the appsettings.json file according to your azure configuration

    Image Added
  4. Open a terminal and type:

    Code Block
    dotnet publish -c Release

    For development, dotnet publish is enough.

    Image Added
  5. At the end of the process, you have a path to find your files

    Image Added
  6. Open the path and copy and paste the files in the server

    Image Added

How to refresh NAPA-SNAPA API token

  1. Go the portal- Add off-line access permission.

    Image AddedImage Added

    2- Update the API security

  2. Image Added

    Update Refresh token url with the token url

  3. Ref: https://learn.microsoft.com/en-us/azure/energy-data-services/how-to-generate-refresh-token#register-your-app-with-azure-ad