auth-required
@azure-tools/typespec-azure-core/auth-requiredEnsure Azure services define their authentication requirements. See https://azure.github.io/typespec-azure/docs/reference/azure-style-guide#security-definitions
โ Incorrect
Section titled โโ Incorrectโ@servicenamespace Azure.Service;โ Correct
Section titled โโ Correctโ- OAuth2
@useAuth(AADToken)namespace Contoso.WidgetManager;
/** The Azure Active Directory OAuth2 Flow */model AADToken is OAuth2Auth<[ { type: OAuth2FlowType.authorizationCode; authorizationUrl: "https://api.example.com/oauth2/authorize"; tokenUrl: "https://api.example.com/oauth2/token"; scopes: ["https://management.azure.com/read", "https://management.azure.com/write"]; } ]>;- Api Key
@useAuth(AzureKey)namespace Contoso.WidgetManager;
/** The secret key for your Azure Cognitive Services subscription. */model AzureKey is ApiKeyAuth<ApiKeyLocation.header, "Ocp-Apim-Subscription-Key">;