{"id":1448,"date":"2023-08-21T22:14:13","date_gmt":"2023-08-21T22:14:13","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/startups\/blog\/?p=1448"},"modified":"2024-11-01T15:39:56","modified_gmt":"2024-11-01T23:39:56","slug":"how-to-migrate-to-azure-openai-service","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/startups\/blog\/how-to-migrate-to-azure-openai-service\/","title":{"rendered":"How to migrate production ready AI apps to Azure OpenAI Service"},"content":{"rendered":"\n
As a startup in Founders Hub, you can get started with $2,500 of OpenAI credits<\/a> to begin experimenting with powerful AI models on day one. As you prepare to roll out your solution into production, your available Azure credits (up to $150K) can then be applied towards Azure OpenAI Service.<\/p>\n\n\n\n We’re often asked how to weigh the differences between these two options. This post aims to clarify the key benefits of transitioning to Azure OpenAI Service.<\/p>\n\n\n\n With Azure OpenAI Service<\/a>, you still get access to the same remarkable OpenAI models like GPT-3, DALL-E 2, and Codex through simple API calls. But now these capabilities are enhanced by Microsoft Azure’s enterprise-grade security, compliance, support, availability, and responsible AI practices.<\/p>\n\n\n\n Whereas OpenAI provides raw access to models, Azure OpenAI Service empowers you to build on top of them in smarter ways:<\/p>\n\n\n\n By making the leap from OpenAI to Azure OpenAI Service, startups can accelerate innovation, reduce risk, and get the most value from their AI investments.<\/p>\n\n\n\n How to transition to Azure OpenAI Service? Get your API key: After you create your Azure OpenAI resource, you can get your API key here.<\/a> You will need this key to authenticate your requests to the GPT-3 endpoint, instructions here<\/a>.<\/p>\n\n\n\n OpenAI uses the model keyword argument to specify what model to use. Azure OpenAI has the concept of deployments and uses the deployment_id keyword argument to describe which model deployment to use.<\/p>\n\n\n\n Here is an example code snippet:<\/p>\n\n\n\n Azure Openai Azure OpenAI. You can use Azure Active Directory authentication for Azure OpenAI. You can learn more here.<\/a> Finally, you need to test your code and make sure everything works as expected. You can use the same methods and parameters as before, and you should get the same results from the Azure OpenAI service as from the OpenAI service. However, you might notice some improvements in performance, reliability, security, and scalability, as well as access to additional features and services from Azure.<\/p>\n\n\n\n That’s it! You have successfully migrated from OpenAI to Azure OpenAI, and you can now enjoy the best of both worlds.<\/p>\n\n\n\n In summary, migrating from OpenAI to Azure OpenAI offers an array of compelling benefits, empowering your AI applications with greater performance, scalability, security, reliability, and support. By leveraging the powerful GPT-4 model and the extensive suite of AI tools and services provided by Azure, you can unlock a new realm of possibilities for your startup.<\/p>\n\n\n\n <\/p>\n\n\n\n Microsoft for Startups Founders Hub members receive Azure cloud credits that can be used toward Azure OpenAI Service or OpenAI to help build their product. <\/em>Sign up now.<\/em><\/a><\/p>\n","protected":false},"excerpt":{"rendered":" As a startup in Founders Hub, you can get started with $2,500 of OpenAI credits to begin experimenting with powerful AI models on day one. As you prepare to roll out your solution into production, your available Azure credits (up to $150K) can then be applied towards Azure OpenAI Service. We’re often asked how to…<\/p>\n","protected":false},"author":22,"featured_media":1452,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ms_queue_id":[],"footnotes":""},"categories":[6],"tags":[48,347,19,115,225],"coauthors":[469],"class_list":["post-1448","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development","tag-ai","tag-ai-infrastructure","tag-azure","tag-azure-ai","tag-azure-openai"],"yoast_head":"\n\n
—<\/p>\n\n\n\nSection 1: Get Access to Azure OpenAI<\/h2>\n\n\n\n
\n
Create an Azure account: If you don’t have an Azure account yet, you can create one for free [here](https:\/\/azure.microsoft.com\/en-us\/free\/). You can join the Microsoft for Startups program (Founder\u2019s Hub) and get free credit to use for any Azure service.<\/li>\n\n\n\nSection 2: Deploy GPT Model on Azure OpenAI Studio<\/h2>\n\n\n\n
\n
\n
Section 3: Migrated and Refined Existing OpenAI Endpoint to Azure OpenAI<\/h2>\n\n\n\n
\nimport openai
\nopenai.api_key = “sk-…”
\nopenai.organization = “…”<\/p>\n\n\n\n
\nimport openai
\nopenai.api_type = “azure”
\nopenai.api_key = “…”
\nopenai.api_base = “https:\/\/example-endpoint.openai.azure.com”
\nopenai.api_version = “2023-05-15” # subject to change<\/p>\n\n\n\n
\nimport openai
\nfrom azure.identity import DefaultAzureCredential
\ncredential = DefaultAzureCredential()
\ntoken = credential.get_token(“https:\/\/cognitiveservices.azure.com\/.default”)
\nopenai.api_type = “azuread”
\nopenai.api_key = token.token
\nopenai.api_base = “https:\/\/example-endpoint.openai.azure.com”
\nopenai.api_version = “2023-05-15” # subject to change<\/p>\n\n\n\n