You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ARM模板+DSC部署4台SharePoint虚拟机:PowerShell模块复制失败

Troubleshooting DSC Extension Failure for SharePoint VM Configuration in Azure ARM Templates

From your logs and error details, the core issue here is a misconfigured ZIP package structure for your SharePoint DSC configuration, which makes the Azure DSC extension misinterpret your script as a module instead of loading it correctly. Let’s break this down and fix it:

Why the AD Join DSC Works but SharePoint Doesn't

Looking at your successful AD join logs, that ZIP package contains valid PowerShell DSC resource modules: folders like xActiveDirectory and xComputerManagement, each with their own module manifest (.psd1) files. The DSC extension recognizes these as proper modules, copies them to C:\Program Files\WindowsPowerShell\Modules, then executes the configuration script correctly.

For your SharePoint configuration, however, your ZIP package has the SharePointConfiguration.ps1 script directly at the root. The DSC extension tries to treat this single script as a module:

  • It creates a folder named SharePointConfiguration.ps1 in the Modules directory
  • Copies the script into that folder
  • When it tries to execute the script, it’s looking for a module/function with that full path name, which doesn’t exist—hence the "not recognized" error.

Step-by-Step Fixes

1. Restructure Your SharePoint DSC ZIP Package

You need to package your script in a valid PowerShell module structure:

  • Create a new folder named SharePointConfiguration (match the script name, without the .ps1 extension)
  • Move your SharePointConfiguration.ps1 script into this folder
  • Generate a module manifest file (.psd1) inside the folder to tell PowerShell this is a valid module:
    New-ModuleManifest -Path .\SharePointConfiguration\SharePointConfiguration.psd1 `
      -RootModule "SharePointConfiguration.ps1" `
      -Author "Your Name" `
      -Description "DSC Configuration for SharePoint Farm Setup"
    
  • Zip the entire SharePointConfiguration folder (not just the files inside)—the root of the ZIP should be this folder, not the individual script.

2. Update Your DSC Extension Parameters

Ensure your spConfigurationFunction parameter points to the correct configuration function in your script, using the format:
SharePointConfiguration\YourConfigurationFunctionName
For example, if your script defines a configuration called ConfigureSharePointFarm, the value would be SharePointConfiguration\ConfigureSharePointFarm.

3. Re-Upload and Redeploy

  • Replace the old SharePointConfiguration.ps1.zip in your Azure Blob container with your newly structured ZIP file
  • Clean up any failed deployments in Azure, then re-run your ARM template deployment.

Additional Checks

  • Verify your Blob container has the correct permissions (if it’s private, ensure your ARM template uses a valid SAS token to access the ZIP)
  • Consider upgrading the DSC extension version (you’re using 2.80.0.0; newer versions have better error handling and compatibility)

内容的提问来源于stack exchange,提问作者Enzo Derozereuil

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 12:47:45