Azure应用服务 - 带有嵌套资源的老虎机应用程序设置

发布于 2025-01-24 05:37:09 字数 1331 浏览 2 评论 0原文

我有一个手臂模板,可以执行资源组部署。它主要由Web应用程序和密钥保险箱组成。我想使用蓝色/绿色部署,有时需要在Web应用程序中添加蓝色插槽设置。

当我们部署Web App网站时,全部都作为一个资源( https://learn.microsoft.com/en-us/azure/templates/microsoft.web/sites?tabs=json ),因为AppSettings被定义为键值,我们可以很容易添加第三键为“ slotetting”:true

但是,在我的情况下,我想以完整的模式部署全部,同时添加动态关键的保险库访问策略。因此,基于此文档 - https://learn.microsoft.com/en-us/azure/app-service/app-service/app-service-key-key-vault-vault-references#azure-resource-resource-manager-deployment - 我需要将AppSettings配置为单独的资源,这是一个对象,因此无法添加此附加属性。

有了这个问题,我有2个问题:

  1. 在部署应用程序作为单独资源时,有没有办法添加此插槽?

这些有点脱离话题,但也是如此:

  1. 但是,在部署资源 +关键保险库和动态访问策略时,我正在尝试找到一种最佳实践。就像在完整模式下一样,我们不仅可以有条件地部署密钥保险库(因为它将尝试删除它),另一方面,当我们定义它时,我们需要添加accesspolicies的空数组(空因为我们需要在单独的资源中添加访问权限,以便我们可以在所有Web应用程序上循环并获得身份),因此,总体而言,这些应用程序暂时关闭了一段时间。当您想达到 0停机时间部署时,这不是最佳实践。
  2. 在什么确切方案中,我们要使用完整的模式部署?我的团队领导正在为此推动,但我认为附加的价值不大。如果我们的ARM模板定义良好,则所有手动更改都将更改或移动到默认情况下,并完成。仅删除其他资源。您有任何有趣的用例要共享吗?

I have an ARM template, that performs resource group deployment. It mainly consist of web apps and key vault. I want to go with blue/green deployment and sometimes need to add only blue slot settings to web app.

When we are deploying web app site all as one resource (https://learn.microsoft.com/en-us/azure/templates/microsoft.web/sites?tabs=json), it's quite easy as appSettings are being defined as key-values and we can add 3rd key as "slotSetting": true.

However, in my scenario, I want to deploy all in Complete mode, in the same time add dynamically key vault access policies. So based on this doc - https://learn.microsoft.com/en-us/azure/app-service/app-service-key-vault-references#azure-resource-manager-deployment - I need to configure appSettings as separate resource, which is an object, so there's no way to add this additional property.

With this, I have 2 questions:

  1. Is there a way to add this slotSetting when deploying appSettings as separate resource?

Those are little bit off topic but about that case as well:

  1. but I'm trying to find a best practise, when it comes to deploying resources + key vault and dynamic access policies. As on complete mode we can't just conditionally not deploy key vault (because it will try to remove it) and on the other hand when we define it, we need to add empty array of AccessPolicies (empty because we need to add accessPolicies in separate resources so we could loop over all web apps and get identity), so by and large, the apps are down for some time. Not the best practise when you want to reach 0 downtime deployment.
  2. In what exact scenarios we want to use Complete mode deployment? My team leads are pushing for it but I don't see much added value. If we have ARM template well defined, all manual changes will be changed or moved to defaults in Incremental as well as Complete. Just additional resources are deleted. Do you have any interesting use case to share?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

春庭雪 2025-01-31 05:37:09

不确定我完全理解您的问题,但是在部署插槽时,您可以将不同的应用程序设置部署到ARM模板中的单个插槽中,只需在创建时在插槽设置中指定它们即可。

您可以首先为保险库创建RBAC策略,然后在创建时间将其应用于保险库,但会变得有些复杂,为什么不使用增量模式,唯一的区别是未指定的内容不会删除。

除了可以指定单个资源并清理所有其他内容的DEV实例之外,我从未找到过完整模式的好用例

Not really sure I fully understand your question but when deploying slots you can deploy different app settings to the individual slot in the ARM template simply by specifying them in the slot setting itself when you create it.

You can create the RBAC policies first for the Vault and then apply them to the Vault at creation time but it gets a little complicated, and why dont you just use incremental mode, the only difference is that things not specified wont be deleted.

I have never found a good use case for Complete mode other than dev instances where I can specify a single resource and have it clean up all other things, but in a produciton environment running Complete mode seems to be totally weird

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文