Skip to content

Display notice text when create a Cognitive Services account #3964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ public class NewAzureCognitiveServicesAccountCommand : CognitiveServicesAccountB
[Parameter(
Mandatory = false,
HelpMessage = "Cognitive Services Account Tags.")]
[Alias (TagsAlias)]
[Alias(TagsAlias)]
[ValidateNotNull]
[AllowEmptyCollection]
public Hashtable[] Tag { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Don't ask for confirmation.")]
public SwitchParameter Force { get; set; }

public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();
Expand All @@ -97,10 +97,20 @@ public override void ExecuteCmdlet()
};

if (ShouldProcess(
this.Name, string.Format(CultureInfo.CurrentCulture, Resources.NewAccount_ProcessMessage, this.Name, this.Type, this.SkuName, this.Location))
||
Force.IsPresent)
this.Name, string.Format(CultureInfo.CurrentCulture, Resources.NewAccount_ProcessMessage, this.Name, this.Type, this.SkuName, this.Location)))
{
if (Force.IsPresent)
{
WriteWarning(Resources.NewAccount_Notice);
}
else
{
bool yesToAll = false, noToAll = false;
if (!ShouldContinue(Resources.NewAccount_Notice, "Notice", true, ref yesToAll, ref noToAll))
{
return;
}
}

var createAccountResponse = this.CognitiveServicesClient.CognitiveServicesAccounts.Create(
this.ResourceGroupName,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<data name="NewAccountKey_ProcessMessage" xml:space="preserve">
<value>Regenerating Key {0} for account {1}.</value>
</data>
<data name="NewAccount_Notice" xml:space="preserve">
<value>Microsoft will use data you send to the Cognitive Services to improve Microsoft products and services. Where you send personal data to the 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 the 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>
</data>
<data name="NewAccount_ProcessMessage" xml:space="preserve">
<value>Creating new Cognitive Services account {0} of type {1}, Sku {2} at location {3}.</value>
</data>
Expand Down