Today I spent some time to explore the Microsoft Recommendations API. This API is part of the Microsoft Cognitive Services and it allows to show related articles – something like “people who are interested in A are also interested in X,Y and Z”. This can be useful for web shops or blogs but also to see related items/interests.
In this blog post, I’ll:
- Create the cognitive service and the recommendations API
- Create and upload some test data
- Build a model
- Use that model
Create the recommendations service
The recommendations service is part of the cognitive services and can therefore be found as cognitive service in the Azure portal. Just create it with your preferred pricing tier.
This post is a short note on how to use SSH with Windows Powershell. I will quickly describe three ways: OpenSSH, Posh-SSH and Putty. I found a few blog posts about how to use SSH with Powershell and most of them are referring Posh-SSH. Posh-SSH is nice, but I think OpenSSH is much easier to use because it works the same way as the ssh command in linux.
Open SSH for Powershell
If chocolatey is not yet installed, you must at first install it. Run the Powershell as administrator and execute:
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
If chocolatey is already installed, run the Powershell as administrator and execute the following command to install OpenSSH, to reload the environment variables and to connect to a client:
choco install openssh # installs open ssh
refreshenv # reloads the environment variables
ssh remoteClient -i "MyKeyPair.pem" # connects to remoteClient via ssh
I this post, I’ll describe how to create a point-to-site VPN connection to Azure. I’ll create the virtual network, the virtual network gateway and configure the point-to-site connection using the Azure portal. I’ll also create a self-signed certificate for the VPN gateway and the Windows 10 client.
Connecting your client via VPN to Azure is by sure useful, if you want to access your Azure resources that are not public available (e.g. virtual machines). Another use case that I had several times was to test the connection of an AppService or Azure function to my on-premise resources. When I was able to access my local client, it also meant that the connection from the app service to the virtual network works and that the basic network configuration of the VPN gateway was okay (without the need to create a virtual machine).
The required steps to connect your client via VPN to Azure are:
- Create Virtual network
- Create VPN gateway
- Configure Point-to-Site VPN
- Create certificate for VPN gateway
- Create certificate for Client
- Connect & Test
The last days I spent some time to port my NuGet packages (AzureBillingApi and FeedReader) to .net standard. As it was not so straight forward, I want to share what I did. The migration is certainly more complicated the larger the project is, but this post will hopefully give you some basic insights on how to migrate. The most time-consuming part will be to change the existing code so that it works with .net standard. In this blog post, I’ll focus on how to change the project to use .net standard and .net framework. In this case, I’ll port the AzureBillingApi to .net standard 1.4, but it will still support .net framework 4.5.2.
Before migrating the project, you should at first check if the NuGet packages that you use in your project are already compatible to .net standard. There are different ways how to check it. You can create a new .net standard project and manually add all NuGet packages to it – then try to build it. This will immediately show you if these packages support .net standard or not.
Another way is to go to nuget.org or use the NuGet Package Explorer and check the dependencies (Dependencies section) for all your packages.
In this blog post I’ll build a simple C# Azure function that returns an object as JSON. That’s useful if you want to build a simple “API” or if you just want to return some information in a structured format. Such a function could read data from an on-premise environment and provide this data to a logic app, because it’s much easier to connect an Azure function to on-premise than a logic app.
Create a C# Azure Function
First step is to create a new C# function. I’ll use the HttpTriggerWithParameters-CSharp template and I’ll use the authorization level ‘Anonymous’ (that’s okay for this demo):
Since end of April 2017, there is the new Azure Invoice API available. This API allows to download the Azure invoices for a subscription as PDF file. This does currently not work for Enterprise Agreements, but according to the blog post (https://azure.microsoft.com/en-us/blog/azure-billing-reader-role-and-preview-of-invoice-api/) it is planned.
The downloaded PDF is the invoice itself. The API does currently only support to create and download invoice pdfs. It does not support to access specific costs (e.g. per resources), because this is part of the billing API. I already blogged about the billing API here: Use the Azure Billing API and calculate the costs
If you want to programmatically translate text from one language to another, then the Translation service (translation api) is the right one for you. The Microsoft Translation Service just requires an authentication and then you can easily translate text from one language to another. It sounds simple…and it is simple! In this blog post, I’ll quickly describe how to create the translation service and how to use it with C#, Powershell and Node.js.
Create the translation service in Azure
The translation service is part of the cognitive services and can therefore be found as cognitive service in the Azure portal:
The Face API which is part of the Microsoft Cognitive Services helps to identify and detect faces. It can also be used to find similar faces, to verify if two images contain the same person and you can also train the service to improve the identification of people. In this blog post, I’ll just use the detect service which detects faces and shows the age, gender, emotions and other data of the detected face.
Prerequisites: Create the Face API Service in Azure
As all Microsoft cognitive services, you can also create the face API service in Azure via the portal. It is part of the “Cognitive Services APIs”, so just search for it and create it. Select the Face API as the type of the cognitive service and check the pricing options:
The Computer Vision API which is part of the Microsoft Cognitive Services and helps to analyze images, retrieve information from images or even to modify them a bit. It currently supports the following cases:
- Analyze an Image: Returns categories and tags (e.g. “mountain”, “outdoor”), detects celebrities on the picture, checks if it contains adult or racy content, gives a description of the image, detects faces (e.g. male, 20 years), analyzes colors and the image type.
- Get a thumbnail: returns a thumbnail of the image.
- OCR (optical character recognition): detects text on an image.
- Analyze videos: does the same as analyze images, but for videos.
In this blog post, I’ll use C# to analyze images, to do an OCR and I’ll create a thumbnail.
Prerequisites: Create the Computer Vision service in Azure
The first step for using the computer vision API is to create the service. It is part of the “Cognitive Services APIs” and can be created in the Azure portal:
The following blog post is about sending emails in/via Azure with C#. There are currently two services available that you can easily create in Azure – MailJet and SendGrid. You can also use them without Azure or you can use another service or your own Mail server, but in this post, I’ll focus on the services in Azure and how to use them. If you want to send mails from an Azure function, web job, web app or any other “application” in Azure, then the two services are good and easy to use. Both services, SendGrid and MailJet offer a free plan that allows to send up to 25k e-mails per month. Both of them work fine and are easy to configure, that’s why I’ll describe how to use the services.
Create and configure SendGrid service
The SendGrid service is available in the Azure marketplace, so you can simply add it via the portal. Just search for “SendGrid” and you’ll find the service “SendGrid Email Delivery”. If you create it, then you can also see the pricing:
When the service is provisioned, we have to create an API key that we use to send the mails. Open the SendGrid service in the Azure portal and go to manage: