Training
Module
Реализация синих зеленых развертываний и переключателей функций - Training
Реализация синих зеленых развертываний и переключателей функций
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When a deployment fails, you can automatically redeploy an earlier, successful deployment from your deployment history. This functionality is useful if you've got a known good state for your infrastructure deployment and want to revert to this state. You can specify either a particular earlier deployment or the last successful deployment.
Important
This feature rollbacks a failed deployment by redeploying an earlier deployment. This result may be different than what you would expect from undoing the failed deployment. Make sure you understand how the earlier deployment is redeployed.
Before using this feature, consider these details about how the redeployment is handled:
To use this option, your deployments must have unique names in the deployment history. It's only with unique names that a specific deployment can be identified. If you don't have unique names, a failed deployment might overwrite a successful deployment in the history.
If you specify an earlier deployment that doesn't exist in the deployment history, the rollback returns an error.
To redeploy the last successful deployment, add the -RollbackToLastDeployment
parameter as a flag.
New-AzResourceGroupDeployment -Name ExampleDeployment02 `
-ResourceGroupName $resourceGroupName `
-TemplateFile c:\MyTemplates\azuredeploy.json `
-RollbackToLastDeployment
To redeploy a specific deployment, use the -RollBackDeploymentName
parameter and provide the name of the deployment. The specified deployment must have succeeded.
New-AzResourceGroupDeployment -Name ExampleDeployment02 `
-ResourceGroupName $resourceGroupName `
-TemplateFile c:\MyTemplates\azuredeploy.json `
-RollBackDeploymentName ExampleDeployment01
To redeploy the last successful deployment, add the --rollback-on-error
parameter as a flag.
az deployment group create \
--name ExampleDeployment \
--resource-group ExampleGroup \
--template-file storage.json \
--parameters storageAccountType=Standard_GRS \
--rollback-on-error
To redeploy a specific deployment, use the --rollback-on-error
parameter and provide the name of the deployment. The specified deployment must have succeeded.
az deployment group create \
--name ExampleDeployment02 \
--resource-group ExampleGroup \
--template-file storage.json \
--parameters storageAccountType=Standard_GRS \
--rollback-on-error ExampleDeployment01
To redeploy the last successful deployment if the current deployment fails, use:
{
"properties": {
"templateLink": {
"uri": "http://mystorageaccount.blob.core.windows.net/templates/template.json",
"contentVersion": "1.0.0.0"
},
"mode": "Incremental",
"parametersLink": {
"uri": "http://mystorageaccount.blob.core.windows.net/templates/parameters.json",
"contentVersion": "1.0.0.0"
},
"onErrorDeployment": {
"type": "LastSuccessful",
}
}
}
To redeploy a specific deployment if the current deployment fails, use:
{
"properties": {
"templateLink": {
"uri": "http://mystorageaccount.blob.core.windows.net/templates/template.json",
"contentVersion": "1.0.0.0"
},
"mode": "Incremental",
"parametersLink": {
"uri": "http://mystorageaccount.blob.core.windows.net/templates/parameters.json",
"contentVersion": "1.0.0.0"
},
"onErrorDeployment": {
"type": "SpecificDeployment",
"deploymentName": "<deploymentname>"
}
}
}
The specified deployment must have succeeded.
Training
Module
Реализация синих зеленых развертываний и переключателей функций - Training
Реализация синих зеленых развертываний и переключателей функций
Documentation
Режимы развертывания - Azure Resource Manager
В этой статье описывается, как с помощью Azure Resource Manager задать полный или пошаговый режим развертывания.
Использование шаблона Resource Manager Azure для развертывания веб-приложения Linux в Azure
Описывается, как настроить непрерывную интеграцию в Azure Pipelines с помощью шаблонов Azure Resource Manager. В этой статье показано, как использовать сценарий PowerShell или скопировать файлы в промежуточное расположение и выполнить развертывание из него.