Skip to content

Commit 107979b

Browse files
authored
Implement Azure One-Click Deployment (#10)
1 parent 3c7213d commit 107979b

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed

README.en-US.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ An Azure OpenAI API proxy tool that can convert OpenAI API requests into Azure O
88

99
You must have an Azure OpenAI account to use the Azure OpenAI Proxy.
1010

11+
## Deploy to Azure
12+
13+
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fscalaone%2Fazure-openai-proxy%2Fdeploy%2Fazure-deploy.json)
1114
## Docker Deployment
1215
`docker run -d -p 3000:3000 scalaone/azure-openai-proxy`
1316

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
必须拥有Azure OpenAI帐户才能使用 Azure OpenAI Proxy。
1010

11-
## Docker部署
11+
## Azure部署
12+
13+
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fscalaone%2Fazure-openai-proxy%2Fdeploy%2Fazure-deploy.json)
14+
## Docker Deployment
1215
`docker run -d -p 3000:3000 scalaone/azure-openai-proxy`
1316

1417
## 本地运行和测试,命令行方式

deploy/azure-deploy.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"resourcePrefix": {
6+
"minLength": 3,
7+
"maxLength": 15,
8+
"type": "string",
9+
"metadata": {
10+
"description": "Resource prefix for all the resource provisioned. This should be an alphanumeric string. Note: please keep the `resourcePrefix` short, since some of the Azure resources need the full name to be less than 24 characters. It's recommended that to keep `resource_prefix` less than 15 characters."
11+
}
12+
}
13+
},
14+
"variables": {
15+
"location": "[resourceGroup().location]",
16+
"tenantId": "[subscription().tenantId]",
17+
"webAppName": "[concat(parameters('resourcePrefix'),'webapp' )]",
18+
"webAppPlanName": "[concat(parameters('resourcePrefix'),'appplan' )]",
19+
"webAppPlanSku": "B1",
20+
"webAppAPIVersion": "2021-03-01",
21+
"preBuiltdockerImage": "scalaone/azure-openai-proxy:latest"
22+
},
23+
"functions": [],
24+
"resources": [
25+
{
26+
"type": "Microsoft.Web/serverfarms",
27+
"apiVersion": "[variables('webAppAPIVersion')]",
28+
"name": "[variables('webAppPlanName')]",
29+
"location": "[variables('location')]",
30+
"sku": {
31+
"name": "[variables('webAppPlanSku')]"
32+
},
33+
"kind": "linux",
34+
"properties": {
35+
"reserved": true
36+
}
37+
},
38+
{
39+
"type": "Microsoft.Web/sites",
40+
"apiVersion": "[variables('webAppAPIVersion')]",
41+
"name": "[variables('webAppName')]",
42+
"location": "[variables('location')]",
43+
"dependsOn": [
44+
"[resourceId('Microsoft.Web/serverfarms', variables('webAppPlanName'))]"
45+
],
46+
"kind": "app,linux,container",
47+
"identity": {
48+
"type": "SystemAssigned"
49+
},
50+
"properties": {
51+
"name": "[variables('webAppName')]",
52+
"httpsOnly": "true",
53+
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('webAppPlanName'))]",
54+
"siteConfig": {
55+
"linuxFxVersion": "[concat('DOCKER|', variables('preBuiltdockerImage'))]",
56+
"alwaysOn": true,
57+
"ftpsState": "Disabled",
58+
"appSettings": [
59+
{
60+
"name": "WEBSITES_PORT",
61+
"value": "3000"
62+
},
63+
{
64+
"name": "DOCKER_REGISTRY_SERVER_URL",
65+
"value": "https://index.docker.io/v1"
66+
},
67+
{
68+
"name": "DOCKER_ENABLE_CI",
69+
"value": "true"
70+
}
71+
]
72+
}
73+
}
74+
}
75+
],
76+
"outputs": {}
77+
}

0 commit comments

Comments
 (0)