Create first service
A quick practical guide to creating your first service using pre-configured templates and proven platform practices.
Create Your First Service (TL;DR)
Can't wait to dive in? No need to read all the documentation first – let's create a new service right away!
0. Azure DevOps project access
Get developer access to project eit-white-label
1. new repository
Choose a new name for your service and respect naming conventions defined.
Example:
Whl
= project / customer name abbrevation for WhiteLabel
ProductCatalog
= module / service name
Create a new empty repository in eit-white-label project, eg svc-product-catalog
in Azure DevOps and clone / checkout locally.
git clone https://hci-iap@dev.azure.com/hci-iap/eit-white-label/_git/svc-product-catalog
2. service template
Use dotnet templating to create service repo structure and initial implementation.
install template first (needed just once)
dotnet new install Eit.Templates.ServiceCa --nuget-source "https://pkgs.dev.azure.com/hci-iap/eit-white-label/_packaging/project-packages/nuget/v3/index.json" --force
template repository content
dotnet new eit-service-ca -n Whl.ProductCatalog --moduleName ProductCatalog
in case of issues accessing nuget feed - check following doc related to credentials manager
3. content generated, .NET service
Check the generated content. All needed componets should be ready and in place (.NET service source code + example endpoints, tests, pipeline definition, contract configuration, playground with test requests).
For local development, you can run the service directly from within your IDE on your machine or inside a Docker container (docker compose up
).
To build & run the service, please refer to
/src/README.md
Test API andpoints using simple http requests defined here:
/playground/rest-client/example.http
4. commit and push
Create a commit (brach develop) and push changes to the server remote repo.
git checkout -b develop
git add .
git commit -m "chore: init service from template"
git push --set-upstream origin develop
5. CI / CD pipeline
Create (register) a pipeline in Azure DevOps.
Menu: Azure DevOps project -> Pipelines -> New pipeline -> Azure Repos Git
Select svc-product-catalog
repo, confirm pre-selected azure-pipelines.yml
pipeline definition file and Run
.
more details about the .NET Service
6. Pipeline results
Check CI / CD pipeline run and results
- build & test
- docker image
- deployment configuration
- repo deployment-templates
- repo deployment-config (templated k8s manifests)
- contract (OAS)
- repo deployment-templates = gateway
- repo api-contracts-be = BE contracts processing
- repo api-contracts = (FE) client (http) packages generation
No need to dive deep into all the repositories and details now – we'll cover this in other sections of the documentation.
7. Test running service
Base address for this newly created service is: https://api-gw.whitelabel.mobile.embedit.dev/product-catalog
public anonymous endpoint
###
GET https://api-gw.whitelabel.mobile.embedit.dev/product-catalog/api/v1/todos/todo-lists/no-database
public endpoint which requires a valid jwt token
### get lists
GET https://api-gw.whitelabel.mobile.embedit.dev/product-catalog/api/v1/todos/todo-lists
Content-Type: application/json
Authorization: Bearer {{jwt}}
public endpoint which requires a valid jwt PBA token
- to get a token login to PBA, use web browser developer console to get the token (from an API request)
- PBA link
### PBA get system info
GET https://api-gw.whitelabel.mobile.embedit.dev/product-catalog/api/v1/pba/system/info
Content-Type: application/json
Authorization: Bearer {{jwt}}
8. Business logic implementation
Adjust service implementation to fulfill business needs. Remove / modify example code.
Follow principles and practises described in further sections.
Introduction
Start by exploring the documentation, setting up your first service, and leveraging built-in tools to accelerate your workflow.
Platform structure and introduction
This section provides guidance on leveraging Azure DevOps for managing core platform components and launching new projects efficiently. It highlights the available repositories, tools, and templates that simplify project creation, integration, and deployment.