Yes, it is possible to send notifications from your software/desktop application to MS teams. You can either use Microsoft Graph API for MS teams or the MS Teams Incoming hooks feature.
I found it much easier to use incoming hooks.
You can follow 4 steps to send message notifications to your channels:
- In your teams, right-click on your channel. And search for
Incoming Webhook
.

- Installing/Adding
Incoming Webhook
if not added yet.

- Configure
Incoming Webhook
, by providing a webhook name. Click on Create

- It will generate a link with unique GUIDs, copy the link

- Last step, use this command line in the PowerShell
curl.exe -H "Content-Type:application/json" -d "{'text':'Servers x is started.'}" https://example.webhook.office.com/webhookb2/4dee1c26-036c-4bd2-af75-eb1abd901d18@3c69a296-d747-4ef3-9cc5-e94ee78db030/IncomingWebhook/87557542b42d8d3b04453c4a606f2b92/b852b3d0-84b6-4d98-a547-ae5f53452235
Note: the URL in the command line contains some faked GUID unique id reference,
but you need to replace it with the one you get from webhooks.
You can either call this line in the command line, PowerShell, or any other programming language that can make a post request and incorporated it in your code. In this case for answering the question, I implemented the post requirest in c#:
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("POST"), "https://example.webhook.office.com/webhookb2/4dee1c26-036c-4bd2-af75-eb1abd901d18@3c69a296-d747-4ef3-9cc5-e94ee78db030/IncomingWebhook/87557542b42d8d3b04453c4a606f2b92/b852b3d0-84b6-4d98-a547-ae5f53452235"))
{
request.Content = new StringContent("{'text':'Servers x is started.'}");
request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");
var response = await httpClient.SendAsync(request);
}
}
Now when I run the command or C# code I get a message in that channel:

In case you need to remove the hook that you have added, click on Configured then Configure. And Manage the webhook:
And remove

Disclaimer: I wrote an article on my personal blog that covers
this topic.