Skip to content

Commit 9335d18

Browse files
authored
Show "NotPolice" legal terms for Face. (#12618)
* Show "NotPolice" legal terms for Face. * Update changelog
1 parent 42440fe commit 9335d18

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed

src/CognitiveServices/CognitiveServices/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Show additional legal terms for certain APIs.
2122

2223
## Version 1.5.1
2324
* Used `Deny` specifically as NetworkRules default action.

src/CognitiveServices/CognitiveServices/CognitiveServices.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,10 @@
1414
<PackageReference Include="Microsoft.Azure.Management.CognitiveServices" Version="7.3.0-preview" />
1515
</ItemGroup>
1616

17+
<ItemGroup>
18+
<Compile Update="Properties\Resources.Designer.cs">
19+
<DesignTime>True</DesignTime>
20+
</Compile>
21+
</ItemGroup>
22+
1723
</Project>

src/CognitiveServices/CognitiveServices/CognitiveServicesAccount/NewAzureCognitiveServicesAccount.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,24 @@ public override void ExecuteCmdlet()
245245
}
246246
}
247247
}
248+
249+
if (Type.Equals("Face", StringComparison.InvariantCultureIgnoreCase))
250+
{
251+
if (Force.IsPresent)
252+
{
253+
WriteWarning(Resources.NewAccount_LegalTerm_NotPolice);
254+
}
255+
else
256+
{
257+
bool yesToAll = false, noToAll = false;
258+
if (!ShouldContinue(Resources.NewAccount_LegalTerm_NotPolice, "Notice", true, ref yesToAll, ref noToAll))
259+
{
260+
return;
261+
}
262+
}
263+
}
264+
265+
248266
try
249267
{
250268
CognitiveServicesAccount createAccountResponse = CognitiveServicesClient.Accounts.Create(

src/CognitiveServices/CognitiveServices/Properties/Resources.Designer.cs

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CognitiveServices/CognitiveServices/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@
120120
<data name="NewAccountKey_ProcessMessage" xml:space="preserve">
121121
<value>Regenerating Key {0} for account {1}.</value>
122122
</data>
123+
<data name="NewAccount_LegalTerm_NotPolice" xml:space="preserve">
124+
<value>I certify that use of this service is not by or for a police department in the United States.</value>
125+
</data>
123126
<data name="NewAccount_Notice" xml:space="preserve">
124127
<value>Microsoft will use data you send to Bing Search Services to improve Microsoft products and services. Where you send personal data to these Cognitive Services, you are responsible for obtaining sufficient consent from the data subjects. The General Privacy and Security Terms in the Online Services Terms do not apply to these Cognitive Services. Please refer to the Microsoft Cognitive Services section in the Online Services Terms (https://www.microsoft.com/en-us/Licensing/product-licensing/products.aspx) for details. Microsoft offers policy controls that may be used to disable new Cognitive Services deployments (https://docs.microsoft.com/en-us/azure/cognitive-services/cognitive-services-apis-create-account).</value>
125128
</data>

0 commit comments

Comments
 (0)