Trying to disableLocalAuth to true on

Athapan Arayasantiparb 5 Reputation points Microsoft Employee
2024-05-03T22:12:53.8366667+00:00

I am trying to turn off properties.disableLocalAuth = true on Azure Cognitive Services.

From this document: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.AI.DisableLocalAuth/

From the portal: under Automation -> Export Template -> Deploy in the portal (there is no automated deployment for this) as there is no apparent way to turn the flag off otherwise.

 

Without even adding the flag to the template when he just tries to Review and Create

{
  "code": "InvalidTemplateDeployment",
  "details": [
    {
      "code": "Resource has invalid name",
      "message": "Resource has invalid name Microsoft.Default. Characters /, \\, ?, #, [, ],  , ., @, %, &, *, (, ), +, =, ;, :, ,, <, > are not allowed."
    }
  ],
  "message": "The template deployment 'Microsoft.Template-20240503145319' is not valid according to the validation procedure. The tracking id is '4db3aca7-c576-4139-b79d-b1f9637653fb'. See inner errors for details."
}

Any idea how to fix?

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,577 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Gowtham CP 3,730 Reputation points
    2024-05-04T04:57:23.9866667+00:00

    Hello @Athapan Arayasantiparb

    Thanks for posting in the Microsoft Q and A.

    The error "Resource has invalid name" indicates an issue with the resource name in your template. Characters like "/", "", "?" etc. are not allowed in Azure resource names. To resolve this, modify the resource name to use only alphanumeric characters, underscores, hyphens, and periods. When deploying the template manually, define a valid resource name for your Cognitive Services account. Additionally, check the exported template from the Azure portal for the "Microsoft.Default." prefix, which might cause issues. If present, edit the template file and replace it with a valid resource name. Disabling local authentication with properties.disableLocalAuth = true is a valid approach, as documented https://video2.skills-academy.com/en-us/azure/ai-services/disable-local-auth. Remember, automated deployment isn't necessary for this configuration.

    Hope it helps! If you found the solution useful kindly consider accepting the solution!


  2. Paul Koch 0 Reputation points Microsoft Employee
    2024-07-01T23:41:11.7233333+00:00

    Using Set-AzCognitiveServicesAccount appears to set disableLocalAuth to true. I think it there is still an issue with exporting/importing templates though. Importing an exported template without modification should always work in my opinion, but does not currently.

    0 comments No comments