顯示具有 Azure 標籤的文章。 顯示所有文章
顯示具有 Azure 標籤的文章。 顯示所有文章

2014年4月29日 星期二

[Azure] 如何讓 Azure Website 支援 json 檔案的存取

預設 Azure Website 是沒有支援 json MIME Type 的

要開啟的方式很簡單,修改 Web.config 檔案即可

若沒有 Web.Config 這個檔案,直接使用以下內容:

儲存後,上傳至 /site/wwwroot 目錄下即可

若是已經有 Web.Config 檔案,則直接加入 這個段落的設定並重新佈署即可

[Azure] 透過 FTP 上傳靜態網頁至 Azure WebSite

今天突然有個要將靜態網頁(static html)放到 Azure WebSite 的需求

想想之前都是用 Visual Studio 佈署的,只是放個網頁應該不需要用到 Visual Studio 這種龐然大物吧......?

後來發現原來可以透過 FTP 簡單把網頁上傳即可,找到以下資料可供參考!

Windows Azure Website: Uploading/Downloading files over FTP and collecting Diagnostics logs - Avkash Chauhan's Blog - Site Home - MSDN Blogs

運用 FTP 上傳檔案至 Windows Azure Web Sites - Tom Lee's blog - Site Home - MSDN Blogs

透過 FTP 軟體連上後,再把網頁丟到 /site/wwwroot 目錄下就可以囉!

2014年4月17日 星期四

[Azure] 解決部署到 Cloud Service Web Role 後,第一次進入網頁速度很慢的問題

最近開發的一個 Azure 上的專案,發現若是 Cloud Service 上的 web role 重新佈署後,網頁第一次瀏覽都會非常的慢,等個 30 秒以上是常態~

後來發現原來是 IIS IdleTime 的問題,可以透過 startup command 來解決~

詳細的原因 & 解決方式可參考以下兩個網頁:

  1. Windows Azure WebSites and Cloud Services Slow on First Request | Simon J.K. Pedersen's SharePoint blog
  2. c# - Disable IIS Idle Timeouts in Azure Web Role - Stack Overflow

2013年10月13日 星期日

[Azure] 障礙排除筆記



Q1:從其他資料庫將資料匯入到 Windows Azure SQL Database 時(或是直接新增資料時),出現以下訊息:

Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again
Ans:Windows Azure SQL Database 規定每個 table 都必須要有一個 clustered index,才可以進行資料的編輯。
新增 Clustered Index 的語法如下:
CREATE UNIQUE CLUSTERED INDEX [index name] ON [Schema Name].[Table Name]([Column Name 1], [Column Name 2], .... etc);

Q2:如何將 Visual Studio、Team Foundation Service、Windows Azure 整合在一起?

Ans:這使用到 Continuous Integration(持續整合) 的技術,請參考此篇文章 => Continuous delivery with Team Foundation Service in Windows Azure

Q3:在專案中加入 Entity Framework 後,在本機測試正常,但佈署到 Windows Azure 卻出現以下訊息:

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Ans:將專案中的所有參考,在屬性頁中都設定為"複製到本機(Copy To Local)"即可


Q4:在本機中存取 Windows Azure Storage 都正常,但佈署到 Windows Azure Web Site 上後,卻出現以下訊息:

 Could not load file or assembly 'msshrtmi' or one of its dependencies
Ans:Windows Azure Web Site 不支援 Microsoft.WindowsAzure.ServiceRuntime,改用雲端服務(Cloud Services) 即可。

Q5:WCF Data Services 不支援 $format=json

Ans:預設安裝的 WCF Data Services 元件的版本為 5.0.0.0,升級到 5.6.0.0 即可(目前最新版本為 5.6.0.0),同時為了避免部署到 Azure 上之後發生錯誤,必須修改 WcfDataService1.svc 的內容,將 Version 的參數從 5.0.0.0 改為 5.6.0.0