简体   繁体   English

是否可以结合使用许可和批准来限制Azure部署?

[英]Is it possible to combine a gate and an approval to limit an Azure deployment?

In Azure, you can limit deployments with gates and approvals. 在Azure中,您可以通过关卡和批准来限制部署。 Gates are usually some sort of status or health check. 大门通常是某种状态或健康检查。 Approvals require a certain user or group to manually approve the deployment. 批准要求特定的用户或组手动批准部署。

Is it possible to combine the two? 是否可以将两者结合?

For example, I'd like for a deployment to require an approval but only if it's before 8 am or after 5 pm. 例如,我希望部署需要获得批准,但前提是部署必须在上午8点之前或下午5点之后。

Another example would be to require an approval if the application is not live (liveness would be determined by a REST call). 另一个示例是,如果应用程序不处于活动状态,则需要批准(活动性由REST调用确定)。

No there is no way to create "conditional approvals" this way. 没有办法以这种方式创建“有条件的批准”。 You can schedule Gates and/or approvals but can't make one dependent on the other. 您可以安排盖茨和/或批准,但不能使一个依赖另一个。 The only thing you can configure is to ignore the gate and still ask for approvals or ask for approvals and then run the gates. 您可以配置的唯一一件事就是忽略登机口,仍然请求批准或请求批准,然后运行登机口。

But what you can, using a custom release gate (Azure Function for example), is to do the required check and then use the Azure DevOps REST API to edit the release instance. 但是,使用自定义发布门(例如,Azure Function),您可以做的是进行必需的检查,然后使用Azure DevOps REST API编辑发布实例。 An azure function with the right permissions could either enable or disable the approvers on the environment or override an approval . 具有正确权限的azure功能可以在环境上启用或禁用批准者,可以 覆盖批准

An example of how to do this can be found here: 可以在此处找到如何执行此操作的示例:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM