8/17/2023 0 Comments Ocp apim subscription key postman![]() Now that you have a custom subdomain associated with your resource, you're going to need to assign a role to a service principal. If successful, the Endpoint should show the subdomain name unique to your resource. $account = New-AzCognitiveServicesAccount -ResourceGroupName -name -Type -SkuName -Location -CustomSubdomainName The subdomain name needs to be globally unique and cannot include special characters, such as: ".", "!", ",". Next, create a Cognitive Services resource with a custom subdomain. Then select a subscription: Set-AzContext -SubscriptionName If you want to use an existing Cognitive Services resource which does not have custom subdomain name, follow the instructions in Cognitive Services Custom Subdomains to enable custom subdomain for your resource. The first step is to create a custom subdomain. Create a resource with a custom subdomain If you get stuck, links are provided in each section with all available options for each command in Azure Cloud Shell/Azure CLI. In the following sections, you'll use either the Azure Cloud Shell environment or the Azure CLI to create a subdomain, assign roles, and obtain a bearer token to call the Azure Cognitive Services. Let's take a look at what's required to authenticate using Azure Active Directory (Azure AD). While these keys provide a quick and easy path to start development, they fall short in more complex scenarios that require Azure role-based access control (Azure RBAC). In the previous sections, we showed you how to authenticate against Azure Cognitive Services using a single-service or multi-service subscription key. Regional endpoints do not support Azure AD authentication. data-raw '' | json_ppĪzure AD authentication always needs to be used together with custom subdomain name of your Azure resource. H 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' \ This is a sample call to the Translator service: curl -X POST '' \ H 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' | json_pp This is a sample call to the Bing Web Search API: curl -X GET '' \ Keep in mind, when using this sample you'll need to include a valid subscription key. These sample requests demonstrates how to use the Ocp-Apim-Subscription-Key header. To use a subscription key to authenticate a request, it must be passed along as the Ocp-Apim-Subscription-Key header. The keys are available in the Azure portal for each resource that you've created. The first option is to authenticate a request with a subscription key for a specific service, like Translator. Īuthenticate with a single-service subscription key The value provided follows this format: Bearer. ![]() The steps to perform a token exchange are detailed in the following sections. Use this header if you are using an access token. Use this header to specify the subscription region. This header is only required when using a multi-service subscription key with the Translator service. Use this header to authenticate with a subscription key for a specific service or a multi-service subscription key. Let's quickly review the authentication headers available for use with Azure Cognitive Services. You can get your subscription key from the Azure portal after creating your account. ![]() If you don't have an account, we have a guide to get you set up in minutes: Create a Cognitive Services account for Azure. If you already have an account, go ahead and skip to the next section. Authenticate with Azure Active Directory (AAD)īefore you make a request, you need an Azure account and an Azure Cognitive Services subscription.Authenticate with a single-service or multi-service subscription key.In this article, you'll learn about three ways to authenticate a request and the requirements for each. ![]() This header passes along a subscription key or authentication token, which is used to validate your subscription for a service or group of services. Each request to an Azure Cognitive Service must include an authentication header. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |