Use azure cli to get key and endpoint info
In Azure, if you want to view the key and endpoint information of an Azure resource (such as the Azure Speech service) through the Azure CLI, you can use the following steps:
First, make sure you have the Azure CLI installed and are logged into your Azure account. You can use the following command to log in:
Prerequisites
Group and resource name
Once logged in, you’ll need to find the name of your Azure Speech service resource and the name of the resource group it’s in
Get Key info
Use the following command to view all key and endpoint information for the Azure Speech service:
az cognitiveservices account keys list --name YourResourceName --resource-group YourResourceGroupName
Replace YourResourceName and YourResourceGroupName with the name of your Azure Speech service resource and the resource group it belongs to.
This command will return a JSON object containing two keys (key1 and key2) that you can use for authentication.
Get endpoint info
To get endpoint information for the Azure Speech service, you can use the following command:
az cognitiveservices account show --name YourResourceName --resource-group YourResourceGroupName --query "properties.endpoint"
This will return the endpoint URL of your Azure Speech service.
Note that the output format of the command may be JSON, so you may need to extract specific values from the output.
Make sure you have enough permissions to execute the above commands, as they may require specific roles and permissions. If you are experiencing permission issues, please contact your Azure administrator or check your role assignment
评论区