Loading...

Use Cases for Testing Restrictoutboundnetworkaccess for Speech Service

Use Cases for Testing Restrictoutboundnetworkaccess for Speech Service

Transcribing an Audio File from a Storage Account Using the Speech Service

 

UseCase 1 – Azure Speech Service Outbound access not restricted

 

Shikhaghildiyal_0-1722669169760.png

 

  1. Prepare the Audio File: Upload the audio file to your storage account and note its URL. We can take sample file from here: cognitive-services-speech-sdk/sampledata/audiofiles at master · Azure-Samples/cognitive-services-speech-sdk · GitHub
  2. Set Up the Speech Service: Obtain the API key and endpoint URL from your speech service in Azure as below reference

Shikhaghildiyal_1-1722669224753.png

 

 3. Make the GET Request: Follow below steps in Postman to make a POST request to Speech Service

  •    Open Postman and create a new POST request.
  •    Set the URL to https://<SpeechServiceLocation>.api.cognitive.microsoft.com/speechtotext/v3.2/transcriptions.
  •    Add Headers:
    Ocp-Apim-Subscription-Key:    <keyOfSpeechService>
    Content-Type: application/json
  •    Set the Body to raw and select JSON format.
          Then, paste the following JSON:

{

  "contentUrls": [

    "SASLinkToAudioFileOnStorage"

  ],

  "locale": "en-US",

  "displayName": "My Transcription",

  "model": null,

  "properties": {

    "wordLevelTimestampsEnabled": true,

    "languageIdentification": {

      "candidateLocales": [

        "en-US", "de-DE", "es-ES"

      ]

    }

  }

}

 

The Post Request will return a status code of 201 as shown – it indicates that the request was successfully processed, and a new transcription job has been created. This status code confirms that the transcription process has been initiated

 

Shikhaghildiyal_3-1722669378960.png

 

In the response body of the POST request, find the URL provided under the ‘Links’ section and make a GET request to that URL.

 

Shikhaghildiyal_4-1722669401980.png


The response from this GET request will contain a contentUrl, which you need to use to make another request to fetch the transcribed data

Shikhaghildiyal_7-1722669523462.png

 

Since the outbound access was not disabled, we were able to fetch the Transcribed data from speech service.

 

Shikhaghildiyal_8-1722669551448.png

 

UseCase 2 – Azure Speech Service Outbound access is restricted

 

Shikhaghildiyal_9-1722669583072.png

 

Repeat the steps as mentioned in UseCase1 to send POST request to Speech Service.
The request will return a status code of 403.This means that we are not allowed to access Audio File from Storage account because here we have mentioned -  restrictOutboundNetworkAccess": true, and "allowedFqdnList": "microsoft.com" which means we have restricted outbound access and speech service can only access “microsoft.com” only.

 

Shikhaghildiyal_10-1722669602968.png

 

 

Published on:

Learn more
Azure Developer Community Blog articles
Azure Developer Community Blog articles

Azure Developer Community Blog articles

Share post:

Related posts

This Month in Azure Static Web Apps | 09/2024

    We are back with another edition of the Azure Static Web Apps Community! :party_popper:   September was yet another month ...

1 year ago

GitHub Copilot for Azure: 6 Must-Try Features

As developers, we are constantly seeking tools that streamline our workflows and boost productivity. … Enter GitHub Copilot for Azure, now in ...

1 year ago

Responsible AI Mitigation Layers

Generative AI is increasingly being used in various kinds of systems to augment humans and infuse intelligent behavior into existing and new a...

1 year ago

Streamline Your Azure Workflow: Introducing GitHub Copilot for Azure in VS Code

I'm excited to announce the public preview of GitHub Copilot for Azure - a new addition to your toolkit that seamlessly integrates with G...

1 year ago

Build Intelligent Apps Code-First with Prompty and Azure AI

      Building Generative AI applications can feel daunting for traditional app developers. What does the end-to-end applicati...

1 year ago

Certificación AI-900 (Fundamentos de IA) con Chicas en IA

La inteligencia artificial ha llegado para quedarse, ¡y más aún con la revolucionaria IA generativa! Para ayudar a los profesionales a especia...

1 year ago

Get certified with Learn Live GitHub series!

GitHub Universe is coming, and Microsoft and GitHub are partnering to offer a new special Learn Live series in Brazilian Portuguese, English a...

1 year ago

Certifícate con Learn Live GitHub en Español

Microsoft y GitHub se han unido para ofrecer una nueva serie especial de Learn Live en inglés y español: GitHub 2024. Del 10 al 24 de Octubre,...

1 year ago

Evaluating generative AI: Best practices for developers

As a developer working with generative AI, you've likely marveled at the impressive outputs your models can produce. But how do you ensure the...

1 year ago

Introducing Azure Product Retirement Livestreams

The Azure Retirements team, in collaboration with key partner groups, is excited t...

1 year ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.