DEV Community

Cover image for Harnessing the Power of DeepSeek on Azure with Power Automate
Seena Khan
Seena Khan

Posted on

1 1 1 1 1

Harnessing the Power of DeepSeek on Azure with Power Automate

Introduction

In today's rapidly evolving technological landscape, integrating advanced AI models into business workflows is more crucial than ever. One such powerful model is DeepSeek-R1, known for its exceptional reasoning capabilities. By deploying DeepSeek on Azure and integrating it with Power Automate, businesses can automate complex tasks, enhance decision-making, and streamline operations. This blog will guide you through the process of deploying DeepSeek on Azure and using it in Power Automate, enabling you to leverage cutting-edge AI technology effortlessly.

Why Choose DeepSeek?

DeepSeek-R1 stands out due to its robust reasoning abilities, making it ideal for tasks that require logical decision-making and problem-solving. With its open-source framework, DeepSeek offers flexibility and cost-effectiveness, allowing businesses to customize the model for their specific needs. Additionally, deploying DeepSeek on Azure ensures scalability, security, and compliance, backed by Microsoft's reliable infrastructure

Lets do it!!!

Step-by-Step Guide to Deploy DeepSeek on Azure

  • Login into Azure portal. Then select Azure Machine Learning service. Select +Create and then select New Workspace.

Image description

  • Enter the following details:

    • Azure Subscription : All resources in an Azure subscription are billed together.
    • Azure Resource Group: A resource group is a collection of resources that share the same life cycle, permissions, and policies.
    • Workspace Name: Unique name that matches the constraints for naming on Azure.
    • Region: Choose the region closest to you and your customers. As this workspace we are going to deploy Deepseek R1 so please select East US2.
    • Storage Account: A storage account is used as the default datastore for the workspace. You may create a new Azure Storage resource or select an existing one in your subscription. Learn more: here)
    • Key vault: A key vault is used to store secrets and other sensitive information that is needed by the workspace. You may create a new Azure Key Vault resource or select an existing one in your subscription.
    • Application Insights: The workspace uses Azure Application Insights to store monitoring information about your deployed models. You may create a new Azure Application Insights resource or select an existing one in your subscription.
    • Container Registry: A container registry is used to register docker images used in training and deployments. To minimize costs, a new Azure Container Registry resource is created only after you build your first image. Alternatively, you may choose to create the resource now or select an existing one in your subscription. Here I have selected None.

Image description

  • After entering all the details please select Review+Create.
  • Once the validation done successfully please select Create.
  • After successfully deployed please select Go to Resource.

Image description

  • Select Launch Studio to open the Azure AI Machine Learning Studio.

Image description

  • Select Model Catalog, then search for Deepseek R1 model and select Deepseek R1 from the list.

Image description

  • Select Deploy.

Image description

  • Enter the Deployment name and then select Deploy.

Image description

  • After successfully deployed the model, please copy the following details and keep it in a notepad.
    • deepseek-r1: Chat Completion
    • Key

Image description

Integrating DeepSeek with Power Automate

  • Login into Power Automate.
  • Select My Flows, then select Instant Cloud Flow from +New Flow dropdown.

Image description

  • Enter the name of the flow, then select Manually trigger the flow and Create.

Image description

  • Select Manually trigger the flow and from the left pane under parameters Select +Add Input, then select Text.

  • Enter the name as Prompt.

Image description

  • Add an Action, search HTTP and then select HTTP.

Image description

  • Enter the following details:

    • URI : Enter the copied deepseek-r1: Chat Completion URI from Deepseek R1 deployment.
    • METHOD : POST
    • Headers: content-type : application/json authorization : KEY copied from Deepseek R1 deployment model.
    • Body:
{
  "model": "deepseek-reasoner",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": @{triggerBody()?['text']}
    }
  ],
  "stream": false
}
Enter fullscreen mode Exit fullscreen mode

For content you can give the prompt from the manually trigger the flow action.

Image description

Image description

  • Add a compose action and select add dynamic expression, then enter the below formula:
body('HTTP')?['choices'][0]['message/content']
Enter fullscreen mode Exit fullscreen mode
  • Add a Send an Email action, then enter the following details as per the below picture reference:

Image description

Save your flow.

Now your flow is ready.

You can test it out.

Image description

Flow ran successfully.

Image description

I have received an email which gives the answer i have asked in the prompt at the testing time.

Image description

Successfully completed a small example of deploying Deepseek R1 model in Azure and effectively use it in Power Automate.

Hope you enjoy the session.

Thank you for reading

Please leave a comment below if you have any further questions.

Happy Sharing !!!
Keep Learning | Spread Knowledge | Stay blessed |

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay