gpt4 book ai didi

azure - 使用 Powershell 创建 Azure Flask

转载 作者:行者123 更新时间:2023-12-03 03:08:22 24 4
gpt4 key购买 nike

我想使用 PowerShell 创建 Azure Flask,就像我们在 powershell 中创建 Web 应用程序一样(请参阅下文)。有没有命令可以做到这一点。

New-AzureRmWebApp -ResourceGroupName $WebAppResourceGroupName -Name $WebAppName -Location $WebAppLocation -AppServicePlan $WebAppServicePlanName

最佳答案

这是一个用于部署 Flask 应用程序的 ARM 模板:

{
"parameters": {
"name": {
"type": "string"
},
"hostingPlanName": {
"type": "string"
},
"location": {
"type": "string"
},
"hostingEnvironment": {
"type": "string"
},
"serverFarmResourceGroup": {
"type": "string"
},
"subscriptionId": {
"type": "string"
}
},
"resources": [
{
"name": "[parameters('name')]",
"type": "Microsoft.Web/sites",
"properties": {
"siteConfig": {
"appSettings": []
},
"name": "[parameters('name')]",
"serverFarmId": "[concat('/subscriptions/', parameters('subscriptionId'),'/resourcegroups/', parameters('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]",
"hostingEnvironment": "[parameters('hostingEnvironment')]"
},
"resources": [
{
"apiVersion": "2016-03-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('name'))]"
],
"properties": {
"RepoUrl": "https://github.com/azureappserviceoss/FlaskAzure",
"branch": "master",
"IsManualIntegration": true
}
}
],
"apiVersion": "2016-03-01",
"location": "[parameters('location')]",
"tags": {
"[concat('hidden-related:', '/subscriptions/', parameters('subscriptionId'),'/resourcegroups/', parameters('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "empty"
}
}
],
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0"
}

您可以将其存储在文件或 URL 中,并使用 New-AzureRMResourceGroupDeployment 调用它

关于azure - 使用 Powershell 创建 Azure Flask,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42223955/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com