В настоящее время я пишу приложение Django (python), работающее в облаке Microsoft Azure. Azure предлагает несколько различных способов развертывания вашего приложения:
в документация, упоминается, что процессы сборки запускаются или могут быть настроены для автоматического запуска во время развертывания (в данном случае запускается pip install -r requirements.txt). Однако относительно третьего варианта об этом не упоминается.
Может кто-нибудь пролить некоторый свет на это?
TL: DR запустите это перед развертыванием az webapp config appsettings set -g MyResourceGroup -n MyUniqueAppName --settings SCM_DO_BUILD_DURING_DEPLOYMENT=true
PS C:\> az webapp config appsettings set --h
Command
az webapp config appsettings set : Set a web app's settings.
Arguments
--settings : Space-separated appsettings in a format of <name>=<value>.
--slot -s : The name of the slot. Default to the productions slot if not specified.
--slot-settings : Space-separated slot appsettings in a format of <name>=<value>.
Resource Id Arguments
--ids : One or more resource IDs (space-delimited). If provided, no other
'Resource Id' arguments should be specified.
--name -n : Name of the webapp. You can configure the default using 'az configure
--defaults web=<name>'.
--resource-group -g : Name of resource group. You can configure the default group using `az
configure --defaults group=<name>`. Default: AvidX-Dv-BIOps-RG.
--subscription : Name or ID of subscription. You can configure the default subscription
using `az account set -s NAME_OR_ID`.
Global Arguments
--debug : Increase logging verbosity to show all debug logs.
--help -h : Show this help message and exit.
--output -o : Output format. Allowed values: json, jsonc, none, table, tsv, yaml.
Default: json.
--query : JMESPath query string. See http://jmespath.org/ for more information and
examples.
--verbose : Increase logging verbosity. Use --debug for full debug logs.
Поскольку эта команда указана как «экспериментальная команда», лучшим выбором для документации является страница руководства.
$>az webapp up --help
Command
az webapp up : (Preview) Create and deploy existing local code to the web app, by running the
command from the folder where the code is present. Supports running the command in preview mode
using --dryrun parameter. Current supports includes Node, Python,.NET Core, ASP.NET, staticHtml.
Node, Python apps are created as Linux apps. .Net Core, ASP.NET and static HTML apps are created
as Windows apps. If command is run from an empty folder, an empty windows web app is created.
Arguments
--dryrun : Show summary of the create and deploy operation instead of executing it.
--location -l : Location. Values from: `az account list-locations`. You can configure the
default location using `az configure --defaults location=<location>`.
--sku : The pricing tiers, e.g., F1(Free), D1(Shared), B1(Basic Small), B2(Basic
Medium), B3(Basic Large), S1(Standard Small), P1(Premium Small), P1V2(Premium
V2 Small), PC2 (Premium Container Small), PC3 (Premium Container Medium), PC4
(Premium Container Large). Allowed values: B1, B2, B3, D1, F1, FREE, P1, P1V2,
P2, P2V2, P3, P3V2, PC2, PC3, PC4, S1, S2, S3, SHARED.
Resource Id Arguments
--ids : One or more resource IDs (space-delimited). If provided, no other 'Resource Id'
arguments should be specified.
--name -n : Name of the web app. You can configure the default using 'az configure
--defaults web=<name>'.
--subscription : Name or ID of subscription. You can configure the default subscription using
`az account set -s NAME_OR_ID`.
Global Arguments
--debug : Increase logging verbosity to show all debug logs.
--help -h : Show this help message and exit.
--output -o : Output format. Allowed values: json, jsonc, none, table, tsv, yaml. Default:
json.
--query : JMESPath query string. See http://jmespath.org/ for more information and
examples.
--verbose : Increase logging verbosity. Use --debug for full debug logs.
Examples
View the details of the app that will be created, without actually running the operation
az webapp up -n MyUniqueAppName --dryrun
Create a web app with the default configuration, by running the command from the folder where
the code to deployed exists.
az webapp up -n MyUniqueAppName
Create a web app in a sepcific region, by running the command from the folder where the code to
deployed exists.
az webapp up -n MyUniqueAppName -l locationName
Deploy new code to an app that was originally created using the same command
az webapp up -n MyUniqueAppName -l locationName