简体   繁体   English

通过脚本在 Azure 云服务经典上启用/禁用反恶意软件扩展

[英]Enable/disable antimalware extension on Azure Cloud Service classic via script

We are using Cloud Service Classic (still - for now) as a deployment model for a number of our websites.我们正在使用 Cloud Service Classic(仍然 - 现在)作为我们许多网站的部署模型。 While migration to something else is on the cards, it's not yet.虽然迁移到其他地方已经有可能,但还没有。 We activated the antimalware extension via the Azure portal - and here's where the issues started.我们通过 Azure 门户激活了反恶意软件扩展 - 这就是问题开始的地方。

Our CI/CD system completes builds nightly and deploys them to QA servers using API.我们的 CI/CD 系统每晚完成构建并使用 API 将它们部署到 QA 服务器。 The deployment bit has worked fine and still is.部署位运行良好,现在仍然如此。 However this deployment creates hundreds of thousands of small files on the actual servers (nothing we can do about - this is part of the 3rd party platform being used).然而,这种部署在实际服务器上创建了数十万个小文件(我们无能为力 - 这是正在使用的 3rd 方平台的一部分)。 As a result, the antimalware extension is scanning every file and the deployment takes hours to complete.因此,反恶意软件扩展程序会扫描每个文件,部署需要数小时才能完成。 Without Antimalware the deployment takes about 1 hour.如果没有反恶意软件,部署大约需要 1 小时。 With it enabled - close to 5 hours.启用后 - 接近 5 小时。

Based on how our deployments work, it's safe to disable the antimalware before the deployment, complete the deployment, then re-enable it again.根据我们部署的工作方式,在部署之前禁用反恶意软件是安全的,完成部署,然后再次重新启用它。 Yet, I can't find any way to do it from our CI scripts.然而,我无法从我们的 CI 脚本中找到任何方法来做到这一点。 The only reference I see are the powershell cmdlets Set-AzureServiceAntimalwareExtension and Remove-AzureServiceAntimalwareExtension - yet these have been removed from the Azure Powershell quite some time ago - and I can't find the version that still has it.我看到的唯一参考是 powershell cmdlet Set-AzureServiceAntimalwareExtensionRemove-AzureServiceAntimalwareExtension - 但这些已经在很久以前从 Azure Powershell 中删除了 - 我找不到仍然拥有它的版本。

What other options are there?还有哪些其他选择? How can I disable/enable Antimalware extension on Cloud Service from a CI script?如何从 CI 脚本禁用/启用云服务上的反恶意软件扩展?

Yes, you're right in that only Set and Remove actions are available with Microsoft Antimalware for Azure.是的,您是对的,只有SetRemove操作可用于 Azure 的 Microsoft 反恶意软件。 Microsoft Antimalware is installed in a disabled state in the Cloud Services platform and requires an action by an Azure application to enable it. Microsoft 反恶意软件安装在云服务平台中处于禁用状态,需要 Azure 应用程序执行操作才能启用它。 AFAIK, these cmdlets are available only in version 4.0.0 of the Azure Module as specified in the docs . AFAIK,这些 cmdlet 仅在文档中指定的 Azure 模块4.0.0版中可用。

I'd suggest to open an issue with the Azure-Powershell repo so our Team can take a look at this and understand your requirment better.我建议打开Azure-Powershell 存储库的问题,以便我们的团队可以查看此问题并更好地了解您的需求。 Thanks for reaching out!感谢您伸出援手!

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

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