Skip to content

Commit c2851dc

Browse files
Merge pull request #272877 from alexeyo26/alexey/byos-check-sub
[Azure AI Svc] Speech. Adding "howTo" for checking whether Azure sub is BYOS-enabled
2 parents e32486b + 69e3176 commit c2851dc

File tree

1 file changed

+89
-1
lines changed

1 file changed

+89
-1
lines changed

articles/ai-services/speech-service/bring-your-own-storage-speech-resource.md

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,100 @@ Consider the following rules when planning BYOS-enabled Speech resource configur
4848

4949
## Create and configure BYOS-enabled Speech resource
5050

51-
This section describes how to create a BYOS enabled Speech resource.
51+
This section describes how to create a BYOS enabled Speech resource.
52+
5253

5354
### Request access to BYOS for your Azure subscriptions
5455

5556
You need to request access to BYOS functionality for each of the Azure subscriptions you plan to use. To request access, fill and submit [Cognitive Services & Applied AI Customer Managed Keys and Bring Your Own Storage access request form](https://aka.ms/cogsvc-cmk). Wait for the request to be approved.
5657

58+
### (Optional) Check whether Azure subscription has access to BYOS
59+
60+
You can quickly check whether your Azure subscription has access to BYOS. This check uses [preview features](/azure/azure-resource-manager/management/preview-features) functionality of Azure.
61+
62+
# [Azure portal](#tab/portal)
63+
64+
This functionality isn't available through Azure portal.
65+
66+
> [!NOTE]
67+
> You may view the list of preview features for a given Azure subscription as explained in [this article](/azure/azure-resource-manager/management/preview-features), however note that not all preview features, including BYOS are visible this way.
68+
69+
# [PowerShell](#tab/powershell)
70+
71+
To check whether an Azure subscription has access to BYOS with PowerShell, we use [Get-AzProviderFeature](/powershell/module/az.resources/get-azproviderfeature) command.
72+
73+
You can [install PowerShell locally](/powershell/azure/install-azure-powershell) or use [Azure Cloud Shell](../../cloud-shell/overview.md).
74+
75+
If you use local installation of PowerShell, connect to your Azure account using `Connect-AzAccount` command before trying the following script.
76+
77+
```azurepowershell
78+
# Target subscription parameters
79+
# REPLACE WITH YOUR CONFIGURATION VALUES
80+
$azureSubscriptionId = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
81+
82+
# Select the right subscription
83+
Set-AzContext -SubscriptionId $azureSubscriptionId
84+
85+
# Check whether the Azure subscription has access to BYOS
86+
Get-AzProviderFeature -ListAvailable -ProviderNamespace "Microsoft.CognitiveServices" | where-object FeatureName -Match byox
87+
```
88+
89+
If you get the response like this, your subscription has access to BYOS.
90+
```powershell
91+
FeatureName ProviderName RegistrationState
92+
----------- ------------ -----------------
93+
byoxPreview Microsoft.CognitiveServices Registered
94+
```
95+
96+
If you get empty response or `RegistrationState` value is `NotRegistered` then your Azure subscription doesn't have access to BYOS and you need to [request it](#request-access-to-byos-for-your-azure-subscriptions).
97+
98+
# [Azure CLI](#tab/azure-cli)
99+
100+
To check whether an Azure subscription has access to BYOS with Azure CLI, we use [az feature show](/cli/azure/feature) command.
101+
102+
You can [install Azure CLI locally](/cli/azure/install-azure-cli) or use [Azure Cloud Shell](../../cloud-shell/overview.md).
103+
104+
> [!NOTE]
105+
> The following script doesn't use variables because variable usage differs, depending on the platform where Azure CLI runs. See information on Azure CLI variable usage in [this article](/cli/azure/azure-cli-variables).
106+
107+
If you use local installation of Azure CLI, connect to your Azure account using `az login` command before trying the following script.
108+
109+
```azurecli
110+
az account set --subscription "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
111+
112+
az feature show --name byoxPreview --namespace Microsoft.CognitiveServices --output table
113+
```
114+
115+
If you get the response like this, your subscription has access to BYOS.
116+
```dos
117+
Name RegistrationState
118+
--------------------------------------- -------------------
119+
Microsoft.CognitiveServices/byoxPreview Registered
120+
```
121+
If you get empty response or `RegistrationState` value is `NotRegistered` then your Azure subscription doesn't have access to BYOS and you need to [request it](#request-access-to-byos-for-your-azure-subscriptions).
122+
123+
> [!Tip]
124+
> See additional commands related to listing Azure subscription preview features in [this article](/azure/azure-resource-manager/management/preview-features).
125+
126+
# [REST](#tab/rest)
127+
128+
To check through REST API whether an Azure subscription has access to BYOS use [Features - List](/rest/api/resources/features/list) request from Azure Resource Manager REST API.
129+
130+
If your subscription has access to BYOS, the REST response will contain the following element:
131+
```json
132+
{
133+
"properties": {
134+
"state": "Registered"
135+
},
136+
"id": "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/providers/Microsoft.Features/providers/Microsoft.CognitiveServices/features/byoxPreview",
137+
"type": "Microsoft.Features/providers/features",
138+
"name": "Microsoft.CognitiveServices/byoxPreview"
139+
}
140+
```
141+
If the REST response doesn't contain the reference to `byoxPreview` feature or its state is `NotRegistered` then your Azure subscription doesn't have access to BYOS and you need to [request it](#request-access-to-byos-for-your-azure-subscriptions).
142+
***
143+
144+
57145
### Plan and prepare your Storage account
58146

59147
If you use Azure portal to create a BYOS-enabled Speech resource, an associated Storage account can be created automatically. For all other provisioning methods (Azure CLI, PowerShell, REST API Request) you need to use existing Storage account.

0 commit comments

Comments
 (0)