<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Kudu on 耕作筆記本</title>
		<link>https://dailybrew.dev/tags/kudu/</link>
		<description>Recent content in Kudu on 耕作筆記本</description>
		<generator>Hugo</generator>
		<language>zh-tw</language>
		
		
		
		
			<lastBuildDate>Thu, 09 Apr 2020 19:28:34 +0800</lastBuildDate>
		
			<atom:link href="https://dailybrew.dev/tags/kudu/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Azure Post Deployment Actions 筆記</title>
				<link>https://dailybrew.dev/posts/2020/04/azure-post-deployment-action-hooks/</link>
				<pubDate>Thu, 09 Apr 2020 19:28:34 +0800</pubDate>
				<guid>https://dailybrew.dev/posts/2020/04/azure-post-deployment-action-hooks/</guid>
				<description>&lt;ul&gt;&#xA;&lt;li&gt;於 D:\home\site\deployments\tools\ 下新增 PostDeploymentActions 目錄&lt;/li&gt;&#xA;&lt;li&gt;於目錄內增加 Post Deployment Actions Scripts，可以是 .cmd 或 .ps1 結尾的檔案，加入的檔案將會依序執行&lt;/li&gt;&#xA;&lt;li&gt;於檔案內寫入要執行的語法&lt;/li&gt;&#xA;&lt;li&gt;kudu 提供 unzip command 來將 zip 檔解壓縮&#xA;&lt;ul&gt;&#xA;&lt;li&gt;如果不要讓 command 跳出詢問視窗，可以在 檔名參數前加 -o 來 override&lt;/li&gt;&#xA;&lt;li&gt;要指定解壓路徑，於檔名後 -d 加路徑，不存在的路徑將會自動建立&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;unzip -o D:&lt;span class=&#34;se&#34;&gt;\h&lt;/span&gt;ome&lt;span class=&#34;se&#34;&gt;\s&lt;/span&gt;ite&lt;span class=&#34;se&#34;&gt;\w&lt;/span&gt;wwroot&lt;span class=&#34;se&#34;&gt;\p&lt;/span&gt;ublish&lt;span class=&#34;se&#34;&gt;\p&lt;/span&gt;ublish.zip -d D:&lt;span class=&#34;se&#34;&gt;\h&lt;/span&gt;ome&lt;span class=&#34;se&#34;&gt;\s&lt;/span&gt;ite&lt;span class=&#34;se&#34;&gt;\w&lt;/span&gt;wwroot&lt;span class=&#34;se&#34;&gt;\p&lt;/span&gt;ublish&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;加入 Post Deployment Action Script 的方法有幾種：&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;使用 ftp 上傳&lt;/li&gt;&#xA;&lt;li&gt;使用 app service 管理工具 kudu 的 web console 來透過 command line 新增檔案&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Site：https://my-azure.azurewebsites.net&lt;/li&gt;&#xA;&lt;li&gt;Kudu：https://my-azure.&lt;strong&gt;scm&lt;/strong&gt;.azurewebsites.net&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;在 kudu console 中可以順道測試 script，推薦使用&lt;/p&gt;&#xA;&lt;p&gt;如果要在 powershell script 裡面輸出任何字串，應用 Write-Output 來取代&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
