This is a case study.
Overview -
You are a developer for Amy, Ltd.
The company has a social networking website that is developed as a Single Page Application (SPA).
The social networking website loads user uploaded content from an Azure blob storage.
You are developing a solution to monitor the user uploaded data for inappropriate content.
The following process occurs when users upload content by using the social networking website:
Messages are sent to ContentUploadService.
Content is processed by ContentAnalysisService.
After processing is complete, the content is either posted to the social network or a rejection message is posted in its place.
The ContentAnalysisService is deployed with Azure Container Instances from a private Azure Container Registry named AmyImages.
The solution will use eight CPU cores.
Azure Active Directory -
Azure Active Directory (Azure AD) is used for both internal and guest accounts.
Requirements -
ContentAnalysisService -
The Company’s data science group built ContentAnalysisService which accepts user generated content as a string and returns a probable value for inappropriate content.
Any values over a specific threshold must be reviewed by an employee of Amy, Ltd.
You must create an Azure Function named CheckUserContent to perform the content checks.
Costs -
The solution must minimize costs for all Azure services.
Manual review -
To review content, the user must authenticate to the website portion of the ContentAnalysisService using their Azure AD credentials.
The website is built using React and all pages and API endpoints require authentication.
In order to review content a user must be part of a ContentReviewer role.
All completed reviews must include the reviewer's email address for auditing purposes.
High availability -
The region failures must not impact overall application availability.
Monitoring -
An alert must be raised if the ContentUploadService uses more than 80 percent of available CPU-cores.
Security Requirements-
Any web service accessible over the Internet must be protected from cross site scripting attacks.
All websites and services must use SSL from a valid root certificate authority.
Azure Storage access keys must only be stored in memory and must be available only to the service.
All Internal services must only be accessible from Internal Virtual Networks (VNets)
All parts of the system must support inbound and outbound traffic restrictions.
All service calls must be authenticated by using Azure AD.
User agreements -
Users must agree to a user agreement before submitting content.
The agreement allows employees of Amy.Ltd to review content, store cookies on user devices and track user's IP addresses.
Information regarding agreements is used by multiple divisions within Amy, Ltd.
User responses must not be lost and must be available to all parties regardless of individual service uptime.
The volume of agreements is expected to be in the millions per hour.
Validation testing -
When a new version of the ContentAnalysisService is available the previous seven days of content must be processed with the new version to verify that the new version does not significantly deviate from the old version.
Issues -
Users of the ContentUploadService report that they occasionally see HTTP 502 responses on specific pages.
ContentUploadService code is as below.
ApplicationManifest code is as below
Question
You need to ensure that validation testing is triggered per the requirements.
How should you complete the code segment?
var event = getEvent();
if (event.eventType === '<CodeBlock1>'
&& event.data.target.<CodeBlock2> === 'contentanalysisservice'
&& event.<CodeBlock3>.contains('amyimages'))
{
startValidationTesting();
}
Explanation
Scenario: When a new version of the ContentAnalysisService is available the previous seven days of content must be processed with the new version to verify that the new version does not significantly deviate from the old version.
Here is the sample event grid schema shows the schema of an image pushed event
[{
"id": "831e1650-001e-001b-66ab-eeb76e069631",
"topic": "/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.ContainerRegistry/registries/<name>",
"subject": "aci-helloworld:v1",
"eventType": "ImagePushed",
"eventTime": "2018-04-25T21:39:47.6549614Z",
"data": {
"id": "31c51664-e5bd-416a-a5df-e5206bc47ed0",
"timestamp": "2018-04-25T21:39:47.276585742Z",
"action": "push",
"target": {
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 3023,
"digest": "sha256:213bbc182920ab41e18edc2001e06abcca6735d87782d9cef68abd83941cf0e5",
"length": 3023,
"repository": "aci-helloworld",
"tag": "v1"
},
"request": {
"id": "7c66f28b-de19-40a4-821c-6f5f6c0003a4",
"host": "demo.azurecr.io",
"method": "PUT",
"useragent": "docker/18.03.0-ce go/go1.9.4 git-commit/0520e24 os/windows arch/amd64 UpstreamClient(Docker-Client/18.03.0-ce \\\\(windows\\\\))"
}
},
"dataVersion": "1.0",
"metadataVersion": "1"
}]
https://docs.microsoft.com/en-us/azure/event-grid/event-schema-container-registry?tabs=event-grid-event-schema
No comments:
Post a Comment