George Trifonov http://www.gtrifonov.com Developer journey Fri, 21 Dec 2012 20:13:12 +0000 en-US hourly 1 http://wordpress.org/?v=3.5.1 Windows Azure Media Services – Job Progress in Portal http://www.gtrifonov.com/2012/12/21/windows-azure-media-services-job-progress-in-portal/?utm_source=rss&utm_medium=rss&utm_campaign=windows-azure-media-services-job-progress-in-portal http://www.gtrifonov.com/2012/12/21/windows-azure-media-services-job-progress-in-portal/#comments Fri, 21 Dec 2012 20:07:03 +0000 admin http://www.gtrifonov.com/?p=212 With latest update of Windows Azure Management Portal you are able to track progress or a Windows Azure Media Services Job submitted through portal. Try it now.

There are few filtering options available:
- datetime filter
- job id filter
- job status filter

Windows Azure Media Services Job Progress

Windows Azure Media Services Job Progress

]]>
http://www.gtrifonov.com/2012/12/21/windows-azure-media-services-job-progress-in-portal/feed/ 0
A potentially dangerous Request.Path value was detected from the client http://www.gtrifonov.com/2011/07/29/a-potentially-dangerous-request.path-value-was-detected-from-the-client/?utm_source=rss&utm_medium=rss&utm_campaign=a-potentially-dangerous-request.path-value-was-detected-from-the-client http://www.gtrifonov.com/2011/07/29/a-potentially-dangerous-request.path-value-was-detected-from-the-client/#comments Fri, 29 Jul 2011 21:30:58 +0000 admin http://www.gtrifonov.com/2011/07/29/a-potentially-dangerous-request.path-value-was-detected-from-the-client/ I have a Odata service implementation and started getting errors where one of parameters in query has ‘:’.

Solution:

<system.web>
    <httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters=""/>
<pages validateRequest="false">
]]>
http://www.gtrifonov.com/2011/07/29/a-potentially-dangerous-request.path-value-was-detected-from-the-client/feed/ 0
IOC- MEF,UNITY reading of a day http://www.gtrifonov.com/2011/07/13/ioc-mefunity-reading-of-a-day/?utm_source=rss&utm_medium=rss&utm_campaign=ioc-mefunity-reading-of-a-day http://www.gtrifonov.com/2011/07/13/ioc-mefunity-reading-of-a-day/#comments Wed, 13 Jul 2011 21:44:36 +0000 admin http://www.gtrifonov.com/2011/07/13/ioc-mefunity-reading-of-a-day/ Couple of good readings regarding MEF usage.

]]>
http://www.gtrifonov.com/2011/07/13/ioc-mefunity-reading-of-a-day/feed/ 0
Reseting local Windows Azure storage http://www.gtrifonov.com/2011/06/17/reseting-local-windows-azure-storage/?utm_source=rss&utm_medium=rss&utm_campaign=reseting-local-windows-azure-storage http://www.gtrifonov.com/2011/06/17/reseting-local-windows-azure-storage/#comments Fri, 17 Jun 2011 21:07:12 +0000 admin http://www.gtrifonov.com/2011/06/17/reseting-local-windows-azure-storage/ ...Continue Reading]]> I run few days into a problem when I was not able to delete local development storage tables using Windows Azure API and system was throwing me exceptions. The reason of these exceptions I guess was the fact that table were very big.

In basic scenarios resetting can be archived with Storage emulator UI. 

 

clip_image002

 

I tried this but my machine became unresponsive because due too DSService.exe and sql service.

clip_image002[5]

Killing services left azure tables as they were before.

It turned out that you can also use %Azure SDK%\bin\devstore\dsinit.exe  /forceCreate command , which worked perfectly for me.

]]>
http://www.gtrifonov.com/2011/06/17/reseting-local-windows-azure-storage/feed/ 2
LINQ Contains operation is not supported by Azure Table API http://www.gtrifonov.com/2011/06/16/linq-contains-operation-is-not-supported-by-azure-table-api/?utm_source=rss&utm_medium=rss&utm_campaign=linq-contains-operation-is-not-supported-by-azure-table-api http://www.gtrifonov.com/2011/06/16/linq-contains-operation-is-not-supported-by-azure-table-api/#comments Thu, 16 Jun 2011 17:12:58 +0000 admin http://www.gtrifonov.com/2011/06/16/linq-contains-operation-is-not-supported-by-azure-table-api/  

Unfortunately Azure API not supporting Contains LINQ expressions .

 

Contains Syntax:

LINQ

public static Product[] GetProducts(Guid[] prodIDs)

{

   return (from p in GetProducts()

where prodIDs.Contains(p.ProductID)

select p).ToArray<Product>();

}

TSQL expression  – WHERE [t0].[ProductID] IN (@p0, @p1)’,

LINQ contains syntax example has been taken from http://weblogs.asp.net/dwahlin/archive/2008/05/09/using-linq-to-perform-quot-where-in-value1-value2-quot-queries.aspx

]]>
http://www.gtrifonov.com/2011/06/16/linq-contains-operation-is-not-supported-by-azure-table-api/feed/ 0
Improving performance for Windows Azure tables http://www.gtrifonov.com/2011/06/15/improving-performance-for-windows-azure-tables/?utm_source=rss&utm_medium=rss&utm_campaign=improving-performance-for-windows-azure-tables http://www.gtrifonov.com/2011/06/15/improving-performance-for-windows-azure-tables/#comments Wed, 15 Jun 2011 18:30:09 +0000 admin http://www.gtrifonov.com/2011/06/15/improving-performance-for-windows-azure-tables/ ...Continue Reading]]> Original article NET and ADO.NET Data Service Performance Tips for Windows Azure Tables.

 

Summary:

Default .NET HTTP connections is set to 2

Config file:  
  <system.net> 
    <connectionManagement> 
      <add address = "*" maxconnection = "48" /> 
    </connectionManagement> 
  </system.net> 

In code:  
ServicePointManager.DefaultConnectionLimit = 48; 

Turn off 100-continue (saves 1 roundtrip)

    Code:  
    ServicePointManager.Expect100Continue = false; // or on service point if only a particular service needs to be disabled.  
     
    Config file:  
    <system.net> 
    
        <settings> 
    
          <servicePointManager expect100Continue="false" /> 
    
        </settings> 
     
    </system.net> 

To improve performance of ADO.NET Data Service deserialization name CLR Enity and table identically and use ResolveType on the

public void Query(DataServiceContext context) 
                {  
                     // set the ResolveType to a method that will return the appropriate type to creat

                     context.ResolveType = this.ResolveEntityType;   

                }  
 public Type ResolveEntityType(string name) 
 {  

                      // if the context handles just one type, you can return it without checking the   
                      // value of "name".  Otherwise, check for the name and return the appropriate  
                      // type (maybe a map of Dictionary<string, Type> will be useful) 

                      Type type  = typeof(Customer);
                      return type;  
}  

Turn entity tracking off for query results that are not going to be modified.

    context.MergeOption = MergeOption.NoTracking;

    Use unconditional updates/deletes

    context.AttachTo("TableName", entity, "*");   
    context.UpdateObject(entity); 

 Turning off Nagle may help Inserts/Updates

Code:   
ServicePointManager.UseNagleAlgorithm = false; 

Config file: 

<system.net> 
    <settings> 
      <servicePointManager expect100Continue="false" useNagleAlgorithm="false"/> 
    </settings> 
</system.net> 
]]>
http://www.gtrifonov.com/2011/06/15/improving-performance-for-windows-azure-tables/feed/ 0
StorageClient.StorageClientException: The specified blob already exists http://www.gtrifonov.com/2011/06/02/storageclient.storageclientexception-the-specified-blob-already-exists/?utm_source=rss&utm_medium=rss&utm_campaign=storageclient.storageclientexception-the-specified-blob-already-exists http://www.gtrifonov.com/2011/06/02/storageclient.storageclientexception-the-specified-blob-already-exists/#comments Thu, 02 Jun 2011 21:19:21 +0000 admin http://www.gtrifonov.com/2011/06/02/storageclient.storageclientexception-the-specified-blob-already-exists/ ...Continue Reading]]> Got interesting exception today while trying to upload multiple file blobs to Azure container.

 

private void UploadFileToBlob(string url, Asset asset,string filepath,string filename)
       {
           var container = new CloudBlobContainer(url);

           //Get a reference to a blob, which may or may not exist.
           CloudBlob blob = container.GetBlobReference(filename);
           blob.DeleteIfExists();
           //Upload content to the blob, which will create the blob if it does not already exist.
           blob.UploadFile(filepath);
       }

When I am executing UploadFileToBlob for one file it is working. On different multiple files it is throwing exception “StorageClient.StorageClientException: The specified blob already exists”.

Did some research and found out that this problem associated with multithreading in local dev storage:



This is a known issue with development storage. This happens when there are multiple threads launched to upload the blocks (which constitute the blob). Basically what is happening is that development storage makes use of SQL Server as the data store. Now first thing it does is makes an entry into the table which stores blob information. If there are multiple threads working then all of these threads will try to perform the same operation. After the first thread succeeds, the subsequent threads will result in this exception being raised.

http://stackoverflow.com/questions/4897826/azure-storage-error-the-specified-blob-already-exists-but-it-doesn’t.

Kind of weird, will try to investigate more to see how to resolve this issue and if size of file is really matter. Please let me know if you found any workarounds.

]]>
http://www.gtrifonov.com/2011/06/02/storageclient.storageclientexception-the-specified-blob-already-exists/feed/ 0
Deploying MVC dependencies to Azure http://www.gtrifonov.com/2011/06/02/deploying-mvc-dependencies-to-azure/?utm_source=rss&utm_medium=rss&utm_campaign=deploying-mvc-dependencies-to-azure http://www.gtrifonov.com/2011/06/02/deploying-mvc-dependencies-to-azure/#comments Thu, 02 Jun 2011 16:32:23 +0000 admin http://www.gtrifonov.com/2011/06/02/deploying-mvc-dependencies-to-azure/ ...Continue Reading]]> If you creating web application to be deployed to Windows Azure, you probably noticed that deployment and azure instance initialization may take a while. Any missing reference or break will cause you time and lost productivity.

Few days ago I spent couple of hours trying to include all mvc references one by one making sure that application app has minimum set of required assemblies.

Phil hack published an article http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx regarding how to include MVC,Razor dependencies into your deployment.

By default Azure instance will not have required packages installed. So you need to make sure that all files will be located in your bin folder.

“If your server doesn’t have ASP.NET MVC 3 installed, you’ll need to make sure the following set of assemblies are deployed in the bin folder of your web application:

  • Microsoft.Web.Infrastructure.dll
  • System.Web.Helpers.dll
  • System.Web.Mvc.dll
  • System.Web.Razor.dll
  • System.Web.WebPages.Deployment.dll
  • System.Web.WebPages.dll
  • System.Web.WebPages.Razor.dll

Simply right click on your project to add deployable dependencies.

 add-deployable-assemblies

For other GAC assemblies which are not part of .net 4.0 framework make sure to set Copy Local flag to true:

image

]]>
http://www.gtrifonov.com/2011/06/02/deploying-mvc-dependencies-to-azure/feed/ 0
ODATA WCF Data Services Friendly URLS using Routing http://www.gtrifonov.com/2011/06/01/odata-wcf-data-services-friendly-urls-using-routing/?utm_source=rss&utm_medium=rss&utm_campaign=odata-wcf-data-services-friendly-urls-using-routing http://www.gtrifonov.com/2011/06/01/odata-wcf-data-services-friendly-urls-using-routing/#comments Wed, 01 Jun 2011 18:54:16 +0000 admin http://www.gtrifonov.com/2011/06/01/odata-wcf-data-services-friendly-urls-using-routing/ ...Continue Reading]]> When you creating your first OData WCF Data service common tasks is to give a friendly URL instead of using filename.svc as entry point.You can archive it with URL routing feature in ASP.NET MVC.Just modify your Global.asax.cs route registration block to include following lines.

public static void RegisterRoutes(RouteCollection routes)
       {
           routes.Clear();
           var factory = new DataServiceHostFactory();
           RouteTable.Routes.Add(
               new ServiceRoute("API", factory, typeof (TestOdataService)));

It tells system to associate data service factory handler with a given URL.

]]>
http://www.gtrifonov.com/2011/06/01/odata-wcf-data-services-friendly-urls-using-routing/feed/ 2
iPad User agent string http://www.gtrifonov.com/2011/05/26/ipad-user-agent-string-2/?utm_source=rss&utm_medium=rss&utm_campaign=ipad-user-agent-string-2 http://www.gtrifonov.com/2011/05/26/ipad-user-agent-string-2/#comments Thu, 26 May 2011 16:26:51 +0000 admin http://www.gtrifonov.com/?p=143 ...Continue Reading]]> Here it is:
Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10
You can test how you page looks like in Apple IPad by using safari browser and changing it from Safari to IPad.
Google analytics also providing report to see what mobile devices your visitors used.

]]>
http://www.gtrifonov.com/2011/05/26/ipad-user-agent-string-2/feed/ 0