ARM模板/ DSC-部署4个Sharepoint VM-在VM上复制Powershell模块时出错

问题描述 投票:0回答:1

我正在尝试使用ARM模板和所需状态配置(DSC)在AD域集中将4个SharePoint虚拟机(2 App / 2 Web)部署到Azure。我使用DSC配置来配置我的Sharepoint Vms,但是可以想象,有问题...

在我的ARM模板(JSON)中,我对DSC扩展有以下定义:

{
        "name": "ConfiguringSharepoint",
        "type": "Microsoft.Resources/deployments",
        "apiVersion": "2015-01-01",
        "dependsOn": [
            "Microsoft.Resources/deployments/AddSPVMsToAD"
        ],
        "properties": {
            "mode": "Incremental",
            "templateLink": {
                "uri": "[variables('configuration').configuringSharepointUrl]",
                "contentVersion": "1.0.0.0"
            },
            "parameters": {
                "spappVMName": {
                    "value": "[parameters('spappVMName')]"
                },
                "sqlVMName": {
                    "value": "[parameters('sqlVMName')]"
                },
                "location": {
                    "value": "[parameters('location')]"
                },
                "spConfigurationModulesURL": {
                    "value": "[variables('configuration').spConfigurationModulesURL]"
                },
                "spConfigurationFunction": {
                    "value": "[variables('configuration').spConfigurationFunction]"
                },
                "domainName": {
                    "value": "[parameters('domainName')]"
                },
                "adminUserName": {
                    "value": "[parameters('adminUserName')]"
                },
                "adminPassword": {
                    "value": "[parameters('adminPassword')]"
                },
                "sharePointSetupUserAccountUserName": {
                    "value": "[parameters('sharePointSetupUserAccountUserName')]"
                },
                "sharePointFarmAccountUserName": {
                    "value": "[parameters('sharePointFarmAccountUserName')]"
                },
                "sqlServerServiceAccountUserName": {
                    "value": "[parameters('sqlServerServiceAccountUserName')]"
                },
                "sqlAOAGName": {
                    "value": "[variables('sqlAOAGName')]"
                },
                "administrationContentDatabaseName": {
                    "value": "[variables('administrationContentDatabaseName')]"
                },
                "configDatabaseName": {
                    "value": "[variables('configDatabaseName')]"
                },
                "contentDatabaseName": {
                    "value": "[variables('contentDatabaseName')]"
                },
                "sharepointCAfqdn": {
                    "value": "[variables('sharepointCAfqdn')]"
                },
                "sharePointSetupUserAccountPassword": {
                    "value": "[parameters('sharePointSetupUserAccountPassword')]"
                },
                "sharePointFarmAccountPassword": {
                    "value": "[parameters('sharePointFarmAccountPassword')]"
                },
                "sharePointFarmPassphrasePassword": {
                    "value": "[parameters('sharePointFarmPassphrasePassword')]"
                },
                "sqlServerServiceAccountPassword": {
                    "value": "[parameters('sqlServerServiceAccountPassword')]"
                },
                "spwebVMName": {
                    "value": "[parameters('spwebVMName')]"
                },
                "sharepointFarmName": {
                    "value": "[parameters('sharepointFarmName')]"
                },
                "sharepointWebfqdn": {
                    "value": "[variables('sharepointWebfqdn')]"
                },
                "spSiteTemplateName": {
                    "value": "[parameters('spSiteTemplateName')]"
                }
            }
        }
    }

“ spConfigurationModulesURL”参数指向Azure blob容器,其中包含带有SharePointConfiguration.ps1。位于ZIP存档的根目录中。

完整的网址如下所示:https://azuredeploy.blob.core.windows.net/azuredeploy-dsc/SharePointConfiguration.ps1.zip

以及SharePointConfiguration.ps1.zip ZIP存档的内容:SharePointConfiguration.ps1.zip

在扩展程序在第一个VM(Azure-spapp0)上运行时,在Azure上,出现以下错误:

{“代码”:“ DeploymentFailed”,“消息”:“至少一项资源部署操作失败。有关详细信息,请列出部署操作。有关用法的详细信息,请参阅https://aka.ms/arm-debug。”,“详细信息”:[{“代码“:”冲突“,”消息“:” {\ r \ n \“状态\”:\“失败\”,\ r \ n \“错误\”:{\ r \ n \“代码\”:\ “ ResourceDeploymentFailure \”,\ r \ n \“ message \”:\“资源操作完成,终端供应状态为'Failed'。\”,\ r \ n \“ details \”:[\ r \ n {\ r \ n \“代码\”:\“ VMExtensionProvisioningError \”,\ r \ n \“消息\”:\“ VM在处理扩展名'Microsoft.Powershell.DSC'时报告了故障。错误消息:\“ DSC扩展收到错误的输入:执行脚本或模块'SharePointConfiguration.ps1'时发生错误:术语'C:\ Packages \ Plugins \ Microsoft.Powershell.DSC \ 2.80.0.0 \ bin \。 。\ DSCWork \ SharePointConfiguration.ps1.2 \ SharePointConfiguration.ps1'无法识别为cmdlet,函数,脚本文件或可运行程序的名称。请检查名称的拼写,或者是否包含路径,请验证路径正确,然后重试。.\ n请更正输入,然后重试执行扩展。\“。\” \ r \ n} \ r \ n] \ r \ n} \ r \ n}“}]}]]

因此,我分析了VM上的Azure日志,发现DSC并未按预期将所需的Powershell模块从ZIP存档复制到“ C:\ ProgramFiles \ WindowsPowerShell \ Modules \”,而是他正在复制整个解压缩存档“ SharePointConfiguration.ps1”,然后尝试像模块一样安装。因此它显然失败了。

[Azure-spapp0 VM上的Powershell模块文件夹的屏幕:C:\Program Files\WindowsPowerShell\Modules

[Azure登录Azure-spapp0 VM(C:\ WindowsAzure \ Logs \ Plugins \ Microsoft.Powershell.DSC \ 2.80.0.0):

VERBOSE: [2020-01-29 15:18:08Z] Downloading configuration package
VERBOSE: [2020-01-29 15:18:08Z] Downloading 
https://azuredeploy.blob.core.windows.net/azuredeploy-dsc/SharePointConfiguration.ps1.zip to 
C:\Packages\Plugins\Microsoft.Powershell.DSC\2.80.0.0\bin\..\DSCWork\SharePoint
Configuration.ps1.2\SharePointConfiguration.ps1.zip
VERBOSE: [2020-01-29 15:18:19Z] Extracting SharePointConfiguration.ps1.zip
VERBOSE: [2020-01-29 15:18:19Z] Installing custom DSC resource modules to 
C:\Program Files\WindowsPowerShell\Modules
VERBOSE: [2020-01-29 15:18:19Z] Installing custom DSC resource module 
SharePointConfiguration.ps1
VERBOSE: [2020-01-29 15:18:19Z] Copying 
C:\Packages\Plugins\Microsoft.Powershell.DSC\2.80.0.0\DSCWork\SharePointConfigu
ration.ps1.2\SharePointConfiguration.ps1 to C:\ProgramFiles\WindowsPowerShell\Modules\SharePointConfiguration.ps1 ...
VERBOSE: [2020-01-29 15:18:19Z] Looking for the definition of the configuration
 function.
VERBOSE: [2020-01-29 15:18:19Z] Executing 
C:\Packages\Plugins\Microsoft.Powershell.DSC\2.80.0.0\bin\..\DSCWork\SharePoint
Configuration.ps1.2\SharePointConfiguration.ps1
VERBOSE: [2020-01-29 15:18:19Z] Loading VM agent telemetry assemblies ...
VERBOSE: [2020-01-29 15:18:19Z] [ERROR] while enabling MDS telemetry... [MDS 
Telemetry] C:\WindowsAzure\Packages\WindowsAzureEventSource.dll does not exist 
...
VERBOSE: [2020-01-29 15:18:19Z] [ERROR] An error occurred while executing 
script or module 'SharePointConfiguration.ps1':  The term 
'C:\Packages\Plugins\Microsoft.Powershell.DSC\2.80.0.0\bin\..\DSCWork\SharePoin
tConfiguration.ps1.2\SharePointConfiguration.ps1' is not recognized as the name
 of a cmdlet, function, script file, or operable program. Check the spelling of
 the name, or if a path was included, verify that the path is correct and try 
again.

我获得了另一个DSC扩展,以将我的VM添加到AD域,并且将模块正确地复制到同一VM上:

VERBOSE: [2020-01-29 15:15:08Z] Extracting AddSpServersToAD.ps1.zip
VERBOSE: [2020-01-29 15:15:08Z] Installing custom DSC resource modules to 
C:\Program Files\WindowsPowerShell\Modules
VERBOSE: [2020-01-29 15:15:08Z] Installing custom DSC resource module 
xActiveDirectory
VERBOSE: [2020-01-29 15:15:08Z] Copying 
C:\Packages\Plugins\Microsoft.Powershell.DSC\2.80.0.0\DSCWork\AddSpServersToAD.
ps1.1\xActiveDirectory to C:\Program 
Files\WindowsPowerShell\Modules\xActiveDirectory ...
VERBOSE: [2020-01-29 15:15:08Z] Installing custom DSC resource module 
xComputerManagement
VERBOSE: [2020-01-29 15:15:08Z] Copying 
C:\Packages\Plugins\Microsoft.Powershell.DSC\2.80.0.0\DSCWork\AddSpServersToAD.
ps1.1\xComputerManagement to C:\Program 
Files\WindowsPowerShell\Modules\xComputerManagement ...
VERBOSE: [2020-01-29 15:15:08Z] Looking for the definition of the configuration
 function.
VERBOSE: [2020-01-29 15:15:08Z] Executing 
C:\Packages\Plugins\Microsoft.Powershell.DSC\2.80.0.0\bin\..\DSCWork\AddSpServe
rsToAD.ps1.1\AddSpServersToAD.ps1

为什么DSC在为将VM添加到域时做的正确时,却没有为SharePoint的DSC配置复制Powershell模块文件?我认为这就是为什么我在Azure上收到此错误的原因,但我也许错了。

我试图重命名我的文件,以查看路径中是否有任何混乱,但这没有用。

我希望,您提供了足够的信息来帮助我解决此问题。预先感谢您的帮助。

azure powershell sharepoint azure-resource-manager dsc
1个回答
0
投票

我猜它是Azure / DSC扩展错误,但我仍在调查中。对于我而言,这是一次错误。

© www.soinside.com 2019 - 2024. All rights reserved.