Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more spelling/formatting/link fixes

  • Loading branch information...
commit c5e278d5ee2d5e561502e105eb41d07049507f1b 1 parent 819dadb
@cephalin cephalin authored
View
19 articles/cdn-cloud-service-with-cdn.md
@@ -37,8 +37,8 @@ This tutorial has the following prerequisites:
<span class="wa-icon-bulb"></span>
<h5><a name="note"></a>You need an Azure account to complete this tutorial:</h5>
<ul>
- <li>You can <a href="http://acom-int.azurewebsites.net/en-us/pricing/free-trial/?WT.mc_id=A261C142F">open an Azure account for free</a> - You get credits you can use to try out paid Azure services, and even after they're used up you can keep the account and use free Azure services, such as Web Sites.</li>
- <li>You can <a href="http://acom-int.azurewebsites.net/en-us/pricing/member-offers/msdn-benefits-details/?WT.mc_id=A261C142F">activate MSDN subscriber benefits</a> - Your MSDN subscription gives you credits every month that you can use for paid Azure services.</li>
+ <li>You can <a href="http://azure.microsoft.com/en-us/pricing/free-trial/?WT.mc_id=A261C142F">open an Azure account for free</a> - You get credits you can use to try out paid Azure services, and even after they're used up you can keep the account and use free Azure services, such as Web Sites.</li>
+ <li>You can <a href="http://azure.microsoft.com/en-us/pricing/member-offers/msdn-benefits-details/?WT.mc_id=A261C142F">activate MSDN subscriber benefits</a> - Your MSDN subscription gives you credits every month that you can use for paid Azure services.</li>
<ul>
</div>
@@ -207,9 +207,9 @@ When you integrate a cloud service Web role with Azure CDN, it is relatively eas
Suppose in your cloud application you want to generate memes based on a Chuck Norris image like this:
- ![](media/cdn-cloud-service-with-cdn/cdn-5-memegenerator.PNG)
+![](media/cdn-cloud-service-with-cdn/cdn-5-memegenerator.PNG)
-You have a simple Index action that allows the customers to specify the superlatives in the image, then generates the meme once they post to the action. Since it's Chuck Norris, you would expect this page to become wildly popular globally. This is a good example of serving semi-dynamic content with Azure CDN.
+You have a simple `Index` action that allows the customers to specify the superlatives in the image, then generates the meme once they post to the action. Since it's Chuck Norris, you would expect this page to become wildly popular globally. This is a good example of serving semi-dynamic content with Azure CDN.
Follow the steps above to setup this controller action:
@@ -359,15 +359,15 @@ public ActionResult Show(string id)
If your local debugger is attached, then you will get the regular debug experience with a local redirect. If it's running in the cloud service, then it will redirect to:
- http://<cdnName>.vo.msecnd.net/MemeGenerator/Generate?top=<formInput>&bottom=<formInput>
+ http://<yourCDNName>.vo.msecnd.net/MemeGenerator/Generate?top=<formInput>&bottom=<formInput>
Which corresponds to the following origin URL at your CDN endpoint:
- http://cephalinservice.cloudapp.net/cdn/MemeGenerator/Generate?top=<formInput>&bottom=<formInput>
+ http://<youCloudServiceName>.cloudapp.net/cdn/MemeGenerator/Generate?top=<formInput>&bottom=<formInput>
After URL rewrite rule previously applied, the actual file that gets cached to your CDN endpoint is:
- http://cephalinservice.cloudapp.net/MemeGenerator/Generate?top=<formInput>&bottom=<formInput>
+ http://<youCloudServiceName>.cloudapp.net/MemeGenerator/Generate?top=<formInput>&bottom=<formInput>
You can then use the `OutputCacheAttribute` attribute on the `Generate` method to specify how the action result should be cached, which Azure CDN will honor. The code below specify a cache expiration of 1 hour (3,600 seconds).
@@ -570,7 +570,7 @@ The [Bundle](http://msdn.microsoft.com/en-us/library/system.web.optimization.bun
This new extension method uses the same idea to inject script in the HTML to check the DOM for the a matching class name, rule name, and rule value defined in the CSS bundle, and falls back to the origin Web server if it fails to find the match.
4. Publish the cloud application again and access the home page.
-5. View the HTML code for the page. You should find in injected scripts:
+5. View the HTML code for the page. You should find injected scripts similar to the following:
<pre class="prettyprint">...
&lt;link href=&quot;http://az632148.vo.msecnd.net/Content/css?v=1.0.0.25474&quot; rel=&quot;stylesheet&quot;/&gt;
@@ -615,3 +615,6 @@ The [Bundle](http://msdn.microsoft.com/en-us/library/system.web.optimization.bun
# More Information #
[Overview of the Azure Content Delivery Network (CDN)](http://msdn.microsoft.com/library/azure/ff919703.aspx)
+[Serve Content from Azure CDN in Your Web Application](http://azure.microsoft.com/en-us/Documentation/Articles/cdn-serve-content-from-cdn-in-your-web-application/)
+[ASP.NET Bundling and Minification](http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification)
+[Using CDN for Azure](http://azure.microsoft.com/en-us/documentation/articles/cdn-how-to-use/)
View
36 articles/cdn-serve-content-from-cdn-in-your-web-application.md
@@ -15,7 +15,7 @@ This tutorial shows you how to take advantage of Azure CDN to improve the reach
In this tutorial, you will learn how to do the following:
- [Serve static content from an Azure CDN endpoint](#deploy)
-- [Automating content upload from your ASP.NET application to your CDN endpoint](#upload)
+- [Automate content upload from your ASP.NET application to your CDN endpoint](#upload)
- [Configure the CDN cache to reflect the desired content update](#update)
- [Serve fresh content immediately using query strings](#query)
@@ -25,15 +25,15 @@ This tutorial has the following prerequisites:
- An active [Microsoft Azure account](http://azure.microsoft.com/en-us/account/). You can sign up for a trial account
- Visual Studio 2013 with [Azure SDK](http://go.microsoft.com/fwlink/p/?linkid=323510&clcid=0x409)
-- A simple ASP.NET MVC application to test CDN URLs. [Automating content upload from your ASP.NET application to your CDN endpoint](#upload) uses an ASP.NET MVC application as an example.
-- [Azure PowerShell](http://go.microsoft.com/?linkid=9811175&clcid=0x409) (used by [Automating content upload from your ASP.NET application to your CDN endpoint](#upload))
+- A simple ASP.NET MVC application to test CDN URLs. [Automate content upload from your ASP.NET application to your CDN endpoint](#upload) uses an ASP.NET MVC application as an example.
+- [Azure PowerShell](http://go.microsoft.com/?linkid=9811175&clcid=0x409) (used by [Automate content upload from your ASP.NET application to your CDN endpoint](#upload))
<div class="wa-note">
<span class="wa-icon-bulb"></span>
<h5><a name="note"></a>You need an Azure account to complete this tutorial:</h5>
<ul>
- <li>You can <a href="http://acom-int.azurewebsites.net/en-us/pricing/free-trial/?WT.mc_id=A261C142F">open an Azure account for free</a> - You get credits you can use to try out paid Azure services, and even after they're used up you can keep the account and use free Azure services, such as Web Sites.</li>
- <li>You can <a href="http://acom-int.azurewebsites.net/en-us/pricing/member-offers/msdn-benefits-details/?WT.mc_id=A261C142F">activate MSDN subscriber benefits</a> - Your MSDN subscription gives you credits every month that you can use for paid Azure services.</li>
+ <li>You can <a href="http://azure.microsoft.com/en-us/pricing/free-trial/?WT.mc_id=A261C142F">open an Azure account for free</a> - You get credits you can use to try out paid Azure services, and even after they're used up you can keep the account and use free Azure services, such as Web Sites.</li>
+ <li>You can <a href="http://azure.microsoft.com/en-us/pricing/member-offers/msdn-benefits-details/?WT.mc_id=A261C142F">activate MSDN subscriber benefits</a> - Your MSDN subscription gives you credits every month that you can use for paid Azure services.</li>
<ul>
</div>
@@ -116,7 +116,7 @@ Let's get to it. Follow the steps below to start using the Azure CDN:
Note that I'm not using the HTTPS address given in the blob management interface in Visual Studio. By using HTTP, you test whether the content is publicly accessible, which is a requirement for Azure CDN.
-13. If you can see the blob rendered properly in your browser, change the URL from http://<storageaccountname>.blob.core.windows.net to the URL of your Azure CDN. In my case, to test the first image at my CDN endpoint, I would use `http://az623979.vo.msecnd.net/cdn/cephas_lin.png`.
+13. If you can see the blob rendered properly in your browser, change the URL from `http://<yourStorageAccountName>.blob.core.windows.net` to the URL of your Azure CDN. In my case, to test the first image at my CDN endpoint, I would use `http://az623979.vo.msecnd.net/cdn/cephas_lin.png`.
>[WACOM.NOTE] You can find the CDN endpoint's URL in the Azure management portal, in the CDN tab.
@@ -130,14 +130,14 @@ Let's get to it. Follow the steps below to start using the Azure CDN:
Pay attention to the numbers for the **Request** timing, which is the time to first byte, or the time taken to send the request and receive the first response from the server. When I access the blob, which is hosted in the East Asia region, it takes 266 ms for me - since the request must traverse the entire Pacific Ocean just to get to the server. However, when I access the Azure CDN, it takes only 16 ms, which is nearly a **20-fold gain in performance**!
-15. Now, it's just a matter of using the new link in your Web page, such as the following:
+15. Now, it's just a matter of using the new link in your Web page. For example, I can add the following image tag:
<img alt="Mugshot" src="http://az623979.vo.msecnd.net/cdn/cephas_lin.png" />
In this section, you have learned how to create a CDN endpoint, upload content to it, and link to CDN contentfrom any Web page.
<a name="upload"></a>
-## Automating content upload from your ASP.NET application to your CDN endpoint ##
+## Automate content upload from your ASP.NET application to your CDN endpoint ##
If you want to easily upload all of the static content in your ASP.NET Web application to your CDN endpoint, or if your deploy your Web application using continuous delivery (for an example, see [Continuous Delivery for Cloud Services in Azure](http://azure.microsoft.com/en-us/documentation/articles/cloud-services-dotnet-continuous-delivery/)), you can use Azure PowerShell to automate the synchronization of the latest content files to Azure blobs every time you deploy your Web application. For example, you can run the script at [Upload Content Files from ASP.NET Application to Azure Blobs](http://gallery.technet.microsoft.com/scriptcenter/Upload-Content-Files-from-41c2142a) upload all the content files in an ASP.NET application. To use this script:
@@ -145,9 +145,9 @@ If you want to easily upload all of the static content in your ASP.NET Web appli
5. In the Azure PowerShell window, run `Get-AzurePublishSettingsFile` to download a publish settings file for your Azure account.
6. Once you have downloaded your publish settings file, run the following:
- Import-AzurePublishSettingsFile "<DownloadedFilePath>"
+ Import-AzurePublishSettingsFile "<yourDownloadedFilePath>"
- >[WACOM.NOTE] Once you import your publish settings file, it will be the default Azure account used for all Azure PowerShell sessions. This means that the above steps only need to be done once.
+ >[WACOM.NOTE] Once you import your publish settings file, it will be the default Azure account used for all Azure PowerShell sessions. This means that the above steps only need to be done once.
1. Download the script from the [download page]((http://gallery.technet.microsoft.com/scriptcenter/Upload-Content-Files-from-41c2142a)). Save it into your ASP.NET application's project folder.
2. Right-click the downloaded script and click **Properties**.
@@ -155,7 +155,7 @@ If you want to easily upload all of the static content in your ASP.NET Web appli
4. Open a PowerShell window and run the following:
cd <ProjectFolder>
- .\UploadContentToAzureBlobs.ps1 -StorageAccount "<StorageAccountName>" -StorageContainer "<ContainerName>"
+ .\UploadContentToAzureBlobs.ps1 -StorageAccount "<yourStorageAccountName>" -StorageContainer "<yourContainerName>"
This script uploads all files from your *\Content* and *\Scripts* folders to the specified storage account and container. It has the following advantages:
@@ -166,7 +166,7 @@ This script uploads all files from your *\Content* and *\Scripts* folders to the
For the `-StorageContainer` parameter, it makes sense to use the name of your Web application, or the Visual Studio project name. Whereas I used the generic "cdn" as the container name previously, using the name of your Web application allows related content to be organized into the same easily identifiable container.
-Once the content has finished uploading, you can link to anything in your *\Content* and *\Scripts* folder in your HTML code, such as in your .cshtml files, using `http://<cdnName>.vo.msecnd.net/<containerName>`. Here is an example of something I can use in a Razor view:
+Once the content has finished uploading, you can link to anything in your *\Content* and *\Scripts* folder in your HTML code, such as in your .cshtml files, using `http://<yourCDNName>.vo.msecnd.net/<containerName>`. Here is an example of something I can use in a Razor view:
<img alt="Mugshot" src="http://az623979.vo.msecnd.net/MyMvcApp/Content/cephas_lin.png" />
@@ -183,7 +183,7 @@ The good news is that you can customize cache expiration. Similar to most browse
![](media/cdn-serve-content-from-cdn-in-your-web-application/cdn-updates-1.PNG)
-You can also do this in your PowerShell script to set all blobs' Cache-Control headers. For the script in [Automating content upload from your ASP.NET application to your CDN endpoint](#upload), find the following code snippet:
+You can also do this in your PowerShell script to set all blobs' Cache-Control headers. For the script in [Automate content upload from your ASP.NET application to your CDN endpoint](#upload), find the following code snippet:
Set-AzureStorageBlobContent `
-Container $StorageContainer `
@@ -200,7 +200,7 @@ and modify it as follows:
-Context $context `
-File $file.FullName `
-Blob $blobFileName `
- -Properties @{ContentType=$contentType, "CacheControl="public, max-age=3600"} `
+ -Properties @{ContentType=$contentType, CacheControl="public, max-age=3600"} `
-Force
You may still need to wait for the full 7-day cached content on your Azure CDN to expire before it pulls the new content, with the new Cache-Control header. This illustrates the fact that custom caching values do not help if you want your content update to go live immediately, such as JavaScript or CSS updates. However, you can work around this issue by versioning your content through query strings. For more information, see [Serve fresh content immediately using query strings](#query).
@@ -222,7 +222,7 @@ When I publish a CSS update and use a different version number in my CSS URL:
To a CDN endpoint that has query strings enabled, the two URLs are unique to each other, and it will make a new request to my Web server to retrieve the new *bootstrap.css*. To a CDN endpoint that doesn't have query strings enabled, however, these are the same URL, and it will simply serve the cached *bootstrap.css*.
-The trick then is to update the version number automatically. In Visual Studio, this is easy to do. In a .cshtml file where you would use the link above, you can specify a version number based on the assembly number.
+The trick then is to update the version number automatically. In Visual Studio, this is easy to do. In a .cshtml file where I would use the link above, I can specify a version number based on the assembly number.
<pre class="prettyprint">
@{
<mark>var cdnVersion = System.Reflection.Assembly.GetAssembly(
@@ -235,7 +235,7 @@ The trick then is to update the version number automatically. In Visual Studio,
&lt;link href=&quot;http://az623979.vo.msecnd.net/MyMvcApp/Content/bootstrap.css<mark>?v=@cdnVersion</mark>&quot; rel=&quot;stylesheet&quot;/&gt;
</pre>
-If you change the assembly number as part of every publish cycle, then you can be sure to get a unique version number every time you publish your Web app, which will remain the same until the next publish cycle. Or, you can make Visual Studio automatically increment the assembly version number every time the Web app builds by opening *Properties\AssemblyInfo.cs* in your Visual Studio project and use * in `AssemblyVersion`. For example:
+If you change the assembly number as part of every publish cycle, then you can likewise be sure to get a unique version number every time you publish your Web app, which will remain the same until the next publish cycle. Or, you can make Visual Studio automatically increment the assembly version number every time the Web app builds by opening *Properties\AssemblyInfo.cs* in your Visual Studio project and use `*` in `AssemblyVersion`. For example:
[assembly: AssemblyVersion("1.0.0.*")]
@@ -246,9 +246,11 @@ Currently, the only place you find adequate integration between ASP.NET bundling
- You must manually upload the bundled scripts to blob storage. A programmatic solution is proposed at [stackoverflow](http://stackoverflow.com/a/13736433).
- In your .cshtml files, transform the rendered script/CSS tags to use the Azure CDN. For example:
- @Html.Raw(Styles.Render("~/Content/css").ToString().Insert(0, "http://az623979.vo.msecnd.net"))
+ @Html.Raw(Styles.Render("~/Content/css").ToString().Insert(0, "http://<yourCDNName>.vo.msecnd.net"))
For more information on integrating Azure CDN with Azure Cloud Services, see [Integrate a cloud application with Azure CDN](http://azure.microsoft.com/en-us/documentation/articles/cloud-services-how-to-create-deploy/).
# More Information #
[Overview of the Azure Content Delivery Network (CDN)](http://msdn.microsoft.com/library/azure/ff919703.aspx)
+[Integrate a cloud application with Azure CDN](http://azure.microsoft.com/en-us/Documentation/Articles/cdn-cloud-service-with-cdn/)
+[Using CDN for Azure](http://azure.microsoft.com/en-us/documentation/articles/cdn-how-to-use/)
Please sign in to comment.
Something went wrong with that request. Please try again.