|

|  How to Integrate Microsoft Azure Cognitive Services with Jenkins

How to Integrate Microsoft Azure Cognitive Services with Jenkins

January 24, 2025

Learn to seamlessly integrate Microsoft Azure Cognitive Services with Jenkins for enhanced automation and AI capabilities in your development projects.

How to Connect Microsoft Azure Cognitive Services to Jenkins: a Simple Guide

 

Setup Azure Cognitive Services

 

  • Go to the Azure Portal and sign in with your Azure account.
  •  

  • Navigate to 'Create a resource'. In the search box, type 'Cognitive Services' and select it from the dropdown.
  •  

  • Click on 'Create'. Fill in the required information such as Subscription, Resource Group, Region, etc.
  •  

  • Under 'Pricing tier', select the appropriate tier for your requirements.
  •  

  • Review and then click 'Create'. It will take a few moments to create the resource.
  •  

  • Once created, go to the resource, and in the 'Keys and Endpoint' section, you will find your API endpoint and keys which you'll need later.

 

Install Jenkins and Required Plugins

 

  • Install Jenkins on your server. You can download it from the official Jenkins website.
  •  

  • Configure Jenkins by unlocking it using the password provided during the installation.
  •  

  • Install recommended plugins or manually select plugins based on your needs.
  •  

  • Ensure that Jenkins has access to the required Azure plugin. Go to 'Manage Jenkins' > 'Manage Plugins'. Search for 'Azure Credentials' and 'Azure SDK Libraries' plugins, and install them.

 

Configure Azure Credentials in Jenkins

 

  • Go to 'Manage Jenkins' > 'Manage Credentials'.
  •  

  • Select your preferred domain or 'Global' if you want these credentials to be available everywhere.
  •  

  • Click on 'Add Credentials'. Choose 'Microsoft Azure Service Principal' as the kind.
  •  

  • Fill in the Service Principal's credentials: Client ID, Client Secret, and Tenant ID. These are typically created in Azure Active Directory.
  •  

  • Test the connection to ensure they are correctly set up.

 

Integrate Azure Cognitive Services API in Jenkins Pipeline

 

  • Create a new pipeline job in Jenkins by selecting 'New Item' and then 'Pipeline'.
  •  

  • In the pipeline script, you can use the following simple script to access Azure Cognitive Services:
  •  

    pipeline {
        agent any
        stages {
            stage('Azure Cognitive Services') {
                steps {
                    script {
                        def azureServiceKey = "${YOUR_AZURE_COGNITIVE_KEY}"
                        
                        sh 'curl -X POST \
                            -H "Content-Type: application/json" \
                            -H "Ocp-Apim-Subscription-Key: ${azureServiceKey}" \
                            --data "{\'documents\':[{\'id\':\'1\', \'language\':\'en\', \'text\':\'Hello World\'}]}" \
                            https://<your-cognitive-service-endpoint>/text/analytics/v3.0/sentiment'
                    }
                }
            }
        }
    }
    

     

  • This script uses a simple curl command to send a POST request to the Azure Cognitive Service's text analytics API. Adjust the API endpoint and payload as per your specific needs.
  •  

 

Testing and Verification

 

  • Run the Jenkins pipeline to ensure everything is set up correctly.
  •  

  • Check the Jenkins build console output for any errors or confirmation that Azure Cognitive Services' API call was successful.
  •  

  • If the integration is successful, you should see a valid response from Azure Cognitive Services in the output.

 

Omi Necklace

The #1 Open Source AI necklace: Experiment with how you capture and manage conversations.

Build and test with your own Omi Dev Kit 2.

How to Use Microsoft Azure Cognitive Services with Jenkins: Usecases

 

Automating Content Moderation for User-Generated Content

 

  • Deploy Microsoft Azure Cognitive Services to handle content moderation by analyzing images, videos, or text streams for inappropriate content in real-time.
  •  

  • Utilize Jenkins to automate the integration and testing process, ensuring that any new or updated moderation algorithms are swiftly and correctly deployed.
  •  

  • Automatically run Jenkins builds that integrate new changes or enhancements to the moderation logic, such as updated language models or enhanced image identification capabilities.
  •  

  • Create a Jenkins pipeline that executes a suite of automated tests ensuring that content moderation service improvements do not degrade existing functionality or introduce errors.
  •  

  • Use Jenkins to schedule regular updates and deployments of the content moderation algorithms, leveraging Jenkins’ capability to seamlessly handle dependencies and deployment pipelines.
  •  

  • Streamline notification processes between Jenkins and Azure, alerting relevant teams about the status of builds and deployments, ensuring that any issues are promptly addressed.

 

```shell

Clone the repository

git clone https://github.com/yourrepository/content-moderation.git

Change directory to the project folder

cd content-moderation

Run Jenkins build

jenkins build yourJobName

```

 

 

Enhancing Speech Recognition Accuracy with Continuous Integration

 

  • Integrate Microsoft Azure Cognitive Services' Speech Recognition API to transcribe user-generated audio files into text for further processing and analysis.
  •  

  • Leverage Jenkins to automate the continuous integration and deployment process, ensuring that any improvements in the speech recognition models or new features are quickly and accurately rolled out.
  •  

  • Set up Jenkins to automatically pull the latest modifications in the speech recognition logic, such as newly trained models or optimized audio processing techniques, triggering subsequent build processes.
  •  

  • Design a Jenkins pipeline to deploy and test new speech recognition features on a staging environment, validating enhancements in accuracy, latency, and resilience without impacting the production system.
  •  

  • Utilize Jenkins to manage dependencies and coordinate test runs, making sure that any updates to the speech recognition service do not detract from existing performance or accuracy metrics.
  •  

  • Enable automated alerts via Jenkins to notify technical teams of build outcomes and deployment states, facilitating swift responses to any emergent issues across the speech recognition services.

 

```shell

Access the project directory

cd speech-recognition-project

Execute Jenkins pipeline for continuous integration

jenkins build speechRecognitionJob

```

 

Omi App

Fully Open-Source AI wearable app: build and use reminders, meeting summaries, task suggestions and more. All in one simple app.

Github →

Order Friend Dev Kit

Open-source AI wearable
Build using the power of recall

Order Now

Troubleshooting Microsoft Azure Cognitive Services and Jenkins Integration

How to authenticate Azure Cognitive Services in Jenkins?

 

Setup Azure Service Principal

 

  • Open the Azure Portal to create a service principal by navigating to **Azure Active Directory** > **App registrations** > **New registration**.
  •  

  • Once registered, note the **Application (client) ID** and **Directory (tenant) ID**. Generate a new client secret under **Certificates & Secrets**.

 

Configure Jenkins Credentials

 

  • Go to Jenkins and navigate to **Manage Jenkins** > **Manage Credentials**. Add a new credential, selecting **Microsoft Azure Service Principal**.
  •  

  • Fill in the necessary details: Subscription ID, Tenant ID, Client ID, and Client Secret. Save and ensure Jenkins accesses these Azure resources.

 

Update Jenkins Pipeline

 

  • Use these credentials within a Jenkins pipeline script:

 

pipeline {
    agent any
    environment {
        AZURE_CREDENTIALS_ID = 'your-credential-id'
    }
    stages {
        stage('Authenticate with Azure') {
            steps {
                withAzure(credentialsId: "${AZURE_CREDENTIALS_ID}") {
                  // Perform your Azure-related tasks here
                }
            }
        }
    }
}

 

This setup ensures secure authentication to Azure Cognitive Services from Jenkins.

How to set up a Jenkins pipeline for Azure Cognitive Services deployment?

 

Install Jenkins Plugins

 

  • Ensure Jenkins is installed. Add required plugins like the Azure CLI and Pipeline through Jenkins Plugin Manager.

 

Set Up Azure CLI Credentials

 

  • In Jenkins, navigate to Manage Jenkins > Configure System. Add Azure Service Principal credentials for authentication.

 

Create Jenkins Pipeline

 

  • Create a new pipeline job in Jenkins and select Pipeline script.

 

Script for Azure Cognitive Services Deployment

 

pipeline {
    agent any
    stages {
        stage('Clone Repository') {
            steps {
                git 'https://github.com/yourrepo.git'
            }
        }
        stage('Azure Login') {
            steps {
                sh 'az login --service-principal -u <client-id> -p <client-secret> --tenant <tenant-id>'
            }
        }
        stage('Deploy Service') {
            steps {
                sh '''
                az cognitiveservices account create \
                  --name <account-name> \
                  --resource-group <resource-group> \
                  --kind <cognitive-service> \
                  --sku <pricing-tier> \
                  --location <location>
                '''
            }
        }
    }
}

 

Test Pipeline

 

  • Click Build Now to trigger the pipeline. Monitor for any errors and resolve them as needed.

 

Automate with Webhooks

 

  • Configure GitHub or your code repository to trigger Jenkins builds automatically after each push.

 

Why is my Azure Cognitive Services plugin failing to connect with Jenkins?

 

Common Causes and Solutions

 

  • Network Configuration Issues: Ensure Jenkins server can access Azure services. Check firewall settings or network restrictions.
  •  

  • Incorrect API Key or Endpoint: Verify that the API key and endpoint URL in your plugin configuration are accurate and active.
  •  

  • Plugin Configuration Errors: Double-check that the plugin settings in Jenkins are correctly pointing to the Azure service resources.
  •  

 

Diagnostics and Troubleshooting

 

  • Inspect Logs: Analyze Jenkins and Azure application logs for errors or warnings during connection attempts.
  •  

  • Use Command Line Tests: Validate the connection directly using Azure CLI or curl with your keys. Example:

 


curl -X POST "https://<your-endpoint>/analyze" -H "Ocp-Apim-Subscription-Key: <your-key>" --data-ascii "{\"url\": \"https://example.com/image.jpg\"}"

 

Don’t let questions slow you down—experience true productivity with the AI Necklace. With Omi, you can have the power of AI wherever you go—summarize ideas, get reminders, and prep for your next project effortlessly.

Order Now

Join the #1 open-source AI wearable community

Build faster and better with 3900+ community members on Omi Discord

Participate in hackathons to expand the Omi platform and win prizes

Participate in hackathons to expand the Omi platform and win prizes

Get cash bounties, free Omi devices and priority access by taking part in community activities

Join our Discord → 

OMI NECKLACE + OMI APP
First & only open-source AI wearable platform

a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded

OMI NECKLACE: DEV KIT
Order your Omi Dev Kit 2 now and create your use cases

Omi 開発キット 2

無限のカスタマイズ

OMI 開発キット 2

$69.99

Omi AIネックレスで会話を音声化、文字起こし、要約。アクションリストやパーソナライズされたフィードバックを提供し、あなたの第二の脳となって考えや感情を語り合います。iOSとAndroidでご利用いただけます。

  • リアルタイムの会話の書き起こしと処理。
  • 行動項目、要約、思い出
  • Omi ペルソナと会話を活用できる何千ものコミュニティ アプリ

もっと詳しく知る

Omi Dev Kit 2: 新しいレベルのビルド

主な仕様

OMI 開発キット

OMI 開発キット 2

マイクロフォン

はい

はい

バッテリー

4日間(250mAH)

2日間(250mAH)

オンボードメモリ(携帯電話なしで動作)

いいえ

はい

スピーカー

いいえ

はい

プログラム可能なボタン

いいえ

はい

配送予定日

-

1週間

人々が言うこと

「記憶を助ける、

コミュニケーション

ビジネス/人生のパートナーと、

アイデアを捉え、解決する

聴覚チャレンジ」

ネイサン・サッズ

「このデバイスがあればいいのに

去年の夏

記録する

「会話」

クリスY.

「ADHDを治して

私を助けてくれた

整頓された。"

デビッド・ナイ

OMIネックレス:開発キット
脳を次のレベルへ

最新ニュース
フォローして最新情報をいち早く入手しましょう

最新ニュース
フォローして最新情報をいち早く入手しましょう

thought to action.

Based Hardware Inc.
81 Lafayette St, San Francisco, CA 94103
team@basedhardware.com / help@omi.me

Company

Careers

Invest

Privacy

Events

Manifesto

Compliance

Products

Omi

Wrist Band

Omi Apps

omi Dev Kit

omiGPT

Personas

Omi Glass

Resources

Apps

Bounties

Affiliate

Docs

GitHub

Help Center

Feedback

Enterprise

Ambassadors

Resellers

© 2025 Based Hardware. All rights reserved.