Skip to content

Commit

Permalink
Finishing function code
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecruz91 committed Mar 1, 2018
1 parent 3b92698 commit 1609a63
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
4 changes: 2 additions & 2 deletions TollBooth/FindLicensePlateText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ private async Task<string> MakeOCRRequest(byte[] imageBytes)
const string requestParameters = "language=unk&detectOrientation=true";
// Get the API URL and the API key from settings.
// TODO 2: Populate the below two variables with the correct AppSettings properties.
var uriBase = ConfigurationManager.AppSettings[""];
var apiKey = ConfigurationManager.AppSettings[""];
var uriBase = ConfigurationManager.AppSettings["computerVisionApiUrl"];
var apiKey = ConfigurationManager.AppSettings["computerVisionApiKey"];

var resiliencyStrategy = DefineAndRetrieveResiliencyStrategy();

Expand Down
2 changes: 1 addition & 1 deletion TollBooth/ProcessImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static async Task Run([BlobTrigger("images/{name}", Connection = "blobSto
licensePlateImage = br.ReadBytes((int)incomingPlate.Length);
}
// TODO 1: Set the licensePlateText value by awaiting a new FindLicensePlateText.GetLicensePlate method.
// COMPLETE: licensePlateText = await new.....
licensePlateText = await new FindLicensePlateText(log, _client).GetLicensePlate(licensePlateImage);

// Send the details to Event Grid.
await new SendToEventGrid(log, _client).SendLicensePlateData(new LicensePlateData()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project.You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<PublishProvider>AzureWebSite</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>http://fcz-tollboothfunctionapp.azurewebsites.net</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>False</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<MSDeployServiceURL>fcz-tollboothfunctionapp.scm.azurewebsites.net:443</MSDeployServiceURL>
<DeployIisAppPath>fcz-tollboothfunctionApp</DeployIisAppPath>
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>$fcz-tollboothfunctionApp</UserName>
<_SavePWD>True</_SavePWD>
<EnableMsDeployAppOffline>False</EnableMsDeployAppOffline>
</PropertyGroup>
</Project>
8 changes: 4 additions & 4 deletions TollBooth/SendToEventGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ public async Task SendLicensePlateData(LicensePlateData data)
// process (save to database, move to manual checkup queue, etc.)
if (data.LicensePlateFound)
{
// TODO 3: Modify send method to include the proper eventType name value for saving plate data.
// COMPLETE: await Send(...);
// TODO 3: Modify send method to include the proper eventType name value for saving plate data.
await Send("savePlateData", "TollBooth/CustomerService", data);
}
else
{
// TODO 4: Modify send method to include the proper eventType name value for queuing plate for manual review.
// COMPLETE: await Send(...);
// TODO 4: Modify send method to include the proper eventType name value for queuing plate for manual review.
await Send("queuePlateForManualCheckup", "TollBooth/CustomerService", data);
}
}

Expand Down
2 changes: 1 addition & 1 deletion UploadImages/App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="blobStorageConnection" value="DefaultEndpointsProtocol=https;AccountName=tollbooth;AccountKey=Dg/tOeArAVdW9KcZCIYccN+GguBwyk6+kNcbORUaXOF0O6rd7O0/VoYU5KwRJ54Dk2EVP5HoyQriwEk7XC9DBA==;EndpointSuffix=core.windows.net" />
<add key="blobStorageConnection" value="DefaultEndpointsProtocol=https;AccountName=stservereless;AccountKey=TH25Z6r2Syx94jGobAVbzoLl/RwvqzP90cSDoErK3jv4Dble68qBGPSQT7RRYe/fKCA6s224kOvWKbUPR9Y2SA==;EndpointSuffix=core.windows.net" />
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
Expand Down

0 comments on commit 1609a63

Please sign in to comment.