タイトルには拡張が必要です。要約すると、次のことは不可能だと思います。
- Web サイトを IIS 8 ホストに展開する
- Web 配置パッケージの使用
- VS 2013 ですぐに使える公開機能を使用する
- 特定のサイトに展開する権限が委任されている管理者以外の IIS マネージャー ユーザーを使用する
それはすべて、すべてを台無しにする1つの小さな詳細に帰着するように見えますが、すべてがバラバラになるまでのプロセスを説明する必要があります.
Publish
Web パッケージに発行するように構成された VS 2013 で発行プロファイルを作成します。次に、開発者コマンド プロンプトで次のコマンドを実行します。
msbuild Solution.sln /t:Build /p:DeployOnBuild=true;PublishProfile=Publish;IsDesktopBuild=false
これはビルド プロセスを経て、_PublishedWebsites\Web_Package
フォルダー内に予想されるパッケージと展開ファイルが表示されます。次のステップは、Web_Package フォルダーからこれを実行することです。
Web.deploy.cmd /Y /M:https://example.blah:8172/MsDeploy.axd /U:user /P:p@44w0rd /A:Basic
ここで問題が発生します。これにより、次の拡張コマンドが生成されます (読みやすいように書式設定されています)。
msdeploy.exe
-source:package='.\Web.zip'
-dest:auto,computerName="https://example.blah:8172/MsDeploy.axd",userName="user",password="p@44w0rd",authtype="Basic",includeAcls="False"
-verb:sync
-disableLink:AppPoolExtension
-disableLink:ContentExtension
-disableLink:CertificateExtension
-setParamFile:".\Web.SetParameters.xml"
その実行結果は次のとおりです。
Error Code: ERROR_USER_UNAUTHORIZED
More Information: Connected to the remote computer ("example.blah") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.
次のように、展開されたコマンドだけを手動で再実行し、site
パラメータに MsDeploy.axd URL のタグを付けることで、この問題を解決できます。
msdeploy.exe
-source:package='.\Web.zip'
-dest:auto,computerName="https://example.blah:8172/MsDeploy.axd?site=example.blah",userName="user",password="p@44w0rd",authtype="Basic",includeAcls="False"
-verb:sync
-disableLink:AppPoolExtension
-disableLink:ContentExtension
-disableLink:CertificateExtension
-setParamFile:".\Web.SetParameters.xml"
ただし、MSBuild によって自動生成された Web.deploy.cmd を介してこれを設定する方法がわかりません。私がこれを試してみると:
Web.deploy.cmd /Y /M:https://example.blah:8172/MsDeploy.axd?site=example.blah /U:user /P:p@44w0rd /A:Basic
結果は次のようになります (ここでも、読みやすいように書式設定されています)。
msdeploy.exe
-source:package='D:\DEV\Solution\Web\bin\_PublishedWebsites\Web_Package\Web.zip'
-dest:auto,computerName="https://example.blah:8172/MsDeploy.axd?site",userName="user",password="p@44w0rd",authtype="Basic",includeAcls="False"
-verb:sync
-disableLink:AppPoolExtension
-disableLink:ContentExtension
-disableLink:CertificateExtension
-setParamFile:"D:\DEV\Solution\Web\bin\_PublishedWebsites\Web_Package\Web.SetParameters.xml" example.blah
Error: Unrecognized argument 'example.blah'. All arguments must begin with "-".
Error count: 1.
管理者アカウントを使用して、このプロセスを正常に実行できます。しかし、非管理者にはこの site= querystring 値が必要であり、自動生成された Web.deploy.cmd にはそれがないようです。
ここで明らかな何かが欠けていますか?IIS 管理側で不足しているアクセス許可はありますか? このブログ投稿で指示されているように、管理サービスの委任ルールが設定されていることを確認しました。