Before proceding, please ensure that you have an active Azure Subscription. If you do not, create one by visiting the Azure Portal. Once this is complete, click on the Deploy To Azure button above. The default parameters should suffice. If you wish to change them, you may go ahead and select a different value from the dropdown for the Account Type, Hosting Plan Sku, and the App Insights Location. We recommend leaving the Deploy Package Uri to its default value.
Once your deployment is complete, please return here to read the Next steps.
Congratulations, the Recommendations solution has been deployed to your Azure subscription!! You can use this service to train recommendation models and to get product recommendations.
Please take note of the following pieces of information so you can use them to access the newly created RESTful endpoint that you can use to train models, and get product recommendations from those models.
To get the following values, you must go to the Deployment page for the deployment which you just created in the Azure Portal. This can be found in the resource group that was just created (under the deployments section). This screenshot should help you find the deployments page.
Once here, please click on Outputs to see the deployments outputs which you'll need to get the values in the table below. This screenshot should help you find the deployment outputs.
Output Description | Output parameter in Deployment Outputs |
---|---|
End Point (WEBSITEURL) | WEBSITEURL Output |
Recommendations UI | {WEBSITEURL Output}/ui |
Swagger | {WEBSITEURL Output}/swagger |
Admin Key (Primary) | ADMINPRIMARYKEY Output |
Recommender Key | RECOMMENDPRIMARYKEY Output |
Storage Account Connection String | STORAGECONNECTIONSTRING Output |
The Admin Key can be used for all API operations, including model creation and deletion. The Recommender Key can only be used to get recommendations. This is the key you would use on the client or website requesting recommendations.
These keys can be found and changed in the Azure Portal, under Application Settings of the newly created App Service.
Once all the resources have been deployed, you will be provided two keys (adminKey and recommendKey) that can be used to access a newly create RESTful endpoint that you can use to train models, and get product recommendations from those models. Take note of those keys, as you will need them later on.
The adminKey is the key that can be used for all API operations and gives full error stack on any internal errors, the recommendKey can only be used to get recommendations, so this is the key you would use on the client or website requesting recommendations.
Those keys can also be found in the Azure Portal, as Application Settings for the newly create AppService.
Congratulations! You now have a recommendations service you can use to train models. Take a look at the Getting Started Guide to learn how to create your first model. If you want to learn abut the APIs exposed you can also take a look at the API Reference.
To deploy new version of the code on an already deployed solution, there are several possible ways. Two of the many approaches are described below:
Manual deployments can be performed from visual studio. More details here.
- Visual Studio 15 or greater
- Local clone / copy of the source code solution - https://github.com/Microsoft/Product-Recommendations/tree/master/source
- Azure Subscription Access on which solution was originally provisioned.
- Download the publishing profile from the deployed App Service via Azure portal
- Open the Recommendations solution - Recommendations.Core.sln
- Right click on the Recommendations.WebApp project from the Solution Explorer and click Publish
- Import the publishing profile from step 1. Refer to Creating a Publish Profile.
- Publish the changes. Refer to Previewing Changes and Publishing the Project.
An automated pipeline can be setup to code-build-deploy new changes. More details are here.
- Azure Subscription Access on which solution was originally provisioned.
-
Fork the git hub project
-
Open Deployment options in the deployed App Service on Azure Portal.
-
Choose source as Github and select the project Production Recommendations (forked) and hit OK.
-
Important - Since the github project contains multiple solutions, we need to set the one we want to use explicitly. This can be done by adding a new setting in Application Settings of the App.
Key - PROJECT
Value - source/Recommendations.WebApp/Recommendations.WebApp.csproj
-
Any changes pushed to the forked branch will be automatically built and deployed.
Learn how to create your first model.
Learn about the APIs exposed by the endpoint. You can also take a look at the Swagger interface for your service.
Train your first model and get recommendations using the sample code. For your convenience, you can simply replace the below code snippet in the sample to get it working with this deployment:
string recommendationsEndPointUri = @"{WEBSITEURL Output}";
string apiAdminKey = @"{ADMINPRIMARYKEY Output}";
string connectionString = @"{STORAGECONNECTIONSTRING Output}";