autoplay controls width=”760px” height=”400″ align=”center”poster=”images/img_01.jpg” data-setup='{“nativeControlsForTouch”: false,
“language”:”ja”}’>
To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video
コメントの追加
</form>
<p id=”summary”>読み込み中…</p>
</article>
</div>
<footer> <a href=”http://www.windowsazure.com/en-us/develop/mobile/”> Learn more about Microsoft Azure Mobile Services </a>
<ul id=”errorlog”>
</ul>
</footer>
</div>
https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js
http://ajax.aspnetcdn.com/ajax/mobileservices/MobileServices.Web-1.2.5.min.js
http://page.js
<!–
アプリケーションに関するエンド ユーザーの利用状況分析を収集するには、
追跡する各ページに以下のスクリプトを挿入します。
このコードを、終了 </head> タグの直前と、
andその他のすべてのスクリプトの前に配置します。最初のデータが数秒後に
自動的に表示されます。
–>
var appInsights=window.appInsights||function(config){
function r(config){t[config]=function(){var i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},u=document,e=window,o=”script”,s=u.createElement(o),i,f;for(s.src=config.url||”//az416426.vo.msecnd.net/scripts/a/ai.0.js”,u.getElementsByTagName(o)[0].parentNode.appendChild(s),t.cookie=u.cookie,t.queue=[],i=[“Event”,”Exception”,”Metric”,”PageView”,”Trace”];i.length;)r(“track”+i.pop());return r(“setAuthenticatedUserContext”),r(“clearAuthenticatedUserContext”),config.disableExceptionTracking||(i=”onerror”,r(“_”+i),f=e[i],e[i]=function(config,r,u,e,o){var s=f&&f(config,r,u,e,o);return s!==!0&&t[“_”+i](config,r,u,e,o),s}),t
}({
instrumentationKey:”fa12e109-658e-4b57-b60e-76d064e7a878”
});
window.appInsights=appInsights;
appInsights.trackPageView();
</body>
</html>
———————————————————————————————-
-
Azure Web Appの作成
作成した、HTMLファイルをホスティングします。
方法はいくつかありますが、ここではFTPアップロードの手順と、Visual Studio “Monaco”の方法を提示します。
FTP upload:
https://daiyuhatakeyama.wordpress.com/2013/11/25/windows-azure-website-%e3%81%b8%e3%81%aephp%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e4%bd%9c%e6%88%90%e6%89%8b%e9%a0%86/
[de:code 2014] Visual Studio Online “Monaco” の全貌 ~ あのエリック・ガンマが作った最新開発環境のすべて ~
https://channel9.msdn.com/events/de-code/2014/TL-009
さて、ここまで来ると視聴ページができて、Mobileサービスを使った投稿の動作確認もできていると思います。
よくある問題:
・Mobile Servicesで投稿ができない
CROSの設定をしてください。具体的には、Azure Web Appでページホスティングをしていますので、「*.azurewebsite.net 」の様に指定をします。
-
Azure Media Servicesでのライブ配信確認
収録システムで、実際にライブ配信ができているか、確認を行います。
先のAzure Media Servicesでのチャネル作成の手順の最後でも良いですし、以下も参考にしてください。
https://daiyuhatakeyama.wordpress.com/2014/09/11/azure-media-services-live-streaming-%e3%81%aa%e3%81%a9%e3%81%8cpublic-preview%e3%81%ab%e3%81%aa%e3%82%8a%e3%81%be%e3%81%97%e3%81%9f/
無事に映像が出ていれば、OKです。
当日朝の作業
-
Azure Web App、Mobile App、SQL Databaseのキャパシティを本番用に。
いずれも、「無料」モードですと、アクセスできる数に上限があります。スケーリング設定を行いましょう。
Azure Web App、Mobile App:
https://azure.microsoft.com/ja-jp/documentation/articles/web-sites-scale/
Webの高速化には、Redis Cacheも併用を。今回の規模では不要だと思います。
https://azure.microsoft.com/ja-jp/documentation/services/redis-cache/
SQL Database:
https://azure.microsoft.com/ja-jp/documentation/articles/sql-database-scale-up/
データ量も、同時書き込みも多くなる場合には、こちらをご参考にしてください。
Azure SQL データベースのパフォーマンス ガイダンス: https://msdn.microsoft.com/library/azure/dn369873.aspx
-
Azure Media Servicesの本番設定
Streaming Unitの数を2以上にし (念のため、です)、Streaming Unit上でのCDNを有効化します。設定完了に90分はかかりますので、前日には設定完了している事が望ましいです。
https://azure.microsoft.com/ja-jp/documentation/articles/media-services-manage-origins/#enable_cdn
実際のライブ配信時には、手順の指さし確認が大事です。以下大まかなものですが、ご参考にしてください。
Azure Media Servicesを使ったライブ配信ご参考:
< https://channel9.msdn.com/Events/de-code/decode-2015/DEV-014>
サンプルコード
ここまでお読みいただけるとご理解いただけると思いますが、大したものはありません…
https://github.com/dahatake/Azure-Media-Services-Samples
今後について
今回は手順をドキュメントとしてご紹介しました。これが、何度か実際に行えて手順としての妥当性確認が終わると、今度は「自動化」という事につながります。現在、Azureのインフラは、Azure Resource Managerベースに置き換えられていっていますが、Azure Mobile App、Azure Media Services、Application Insightがその対応を終えると、この手順はテンプレートから実施、という道が見えてきます。パラメーターセットを都度行うだけですね。
お時間あれば、ご一読ください。
Azure Resource Managerの概要: https://azure.microsoft.com/ja-jp/documentation/articles/resource-group-overview/
Azure Resource Managerの本質とhow: https://docs.com/user313939/1c4aec6f-3d43-48e5-b839-51f4f6124155/azure-resource-manager-how