Copy the VHD from one Storage account to another Storage account in azure

Today i was looking to copy the VHD from one account to another account (user) . i was looking for the powershell option then i found the AzCopy was useful

Here is steps to do that

Download and install AzCopy

  1. Download the latest version of AzCopy, or the latest preview version.
  2. Run the installation. By default, the AzCopy installation creates a folder named AzCopy under %ProgramFiles(x86)%\Microsoft SDKs\Azure\ (on a machine running 64-bit Windows) or %ProgramFiles%\Microsoft SDKs\Azure\ (on a machine running 32-bit Windows). However, you can change the installation path from the setup wizard.
  3. If desired, you can add the AzCopy installation location to your system path.
  4. Synchronously copy files in Azure File Storage

With the new option /SyncCopy in 4.1.0-Preview version, user can copy files from File Storage to File Storage, from File Storage to Blob Storage and from Blob Storage to File Storage.

AzCopy /Source:https://myaccount1.file.core.windows.net/myfileshare1/ /Dest:https://myaccount2.file.core.windows.net/myfileshare2/ /SourceKey:key1 /DestKey:key2 /S /SyncCopy


To get the key in Azure portal
  1. In the Management Portal, click Storage, and then click the name of the storage account to open the dashboard.
  2. Click Manage Keys.Manage Access Keys opens.Managekeys
  3. To copy a storage access key, select the key text. Then right-click, and click Copy.
Regards
Elam

 

Delete a Team project from Visual studio online

Today i was trying to clean up my http://www.visualstudio.com . I saw lot of un used project was created. I was thinking to delete the project. here are Steps to delete the team project from www.visualstudio.com

Step 1 : Login to your “name.visualstudio.com” website.
Step 2: Click on the settings Icon on the top bar . As shown below
Settings Icon

Step 3: It will open a new page as shown below . Click on “View the collection administration page

Control page
Step 4: Now You will see all your project List . Right-Click on the project you want to delete . You will see a delete button click on that . As shown below

Delete Pic

Step 5: You will get the Popup for confirmation. Once you confirm the project will be deleted, You will not cannot able to store it back

Confirmation window

Please comment me if you have any question. I am happy to help you

Elam

Post data to CRM 2013 from Infopath using XRM

There was ask form me to check, whether we can post data to CRM 2013 Via InfoPath 2013 form. I was aware that we can call a Custom WCF service which call CRM service and post the data to CRM from InfoPath form.

I was wondering whether we can use the custom code in the InfoPath to post the data to CRM. I did a small POC and found that it’s possible to post data using XRM sdk from InfoPath form

Here are the steps to follow

Step 1

Create an InfoPath Form

Pic10

Step2:

Go to File menu à Submit Options. In that select the option as shown in the Pic below

Pic11

 

Step 3:

Click on the Edit code and VS Will open and add the below code in the FormEvents_Submit

var Contact = new Entity("Contact");
Contact.Attributes["name"] = "Test from crm";
Uri oUri= new Uri("https://<Orgname>.api.crm5.dynamics.com/XRMServices/2011/Organization.svc");
//** Your client credentials
ClientCredentials clientCredentials = new ClientCredentials();
clientCredentials.UserName.UserName = <<username>;
clientCredentials.UserName.Password = <<Password>>;

//Create your Organization Service Proxy
OrganizationServiceProxy _serviceProxy = new OrganizationServiceProxy(oUri,null,clientCredentials,null);

_serviceProxy.Create(Contact);

And also refer the below XRm Dll’s

using Microsoft.Xrm.Sdk; (Microsoft.Xrm.Sdk.dll)
using Microsoft.Xrm.Sdk.Client; (Microsoft.Xrm.Sdk.dll)
using System.ServiceModel.Description; (System.ServiceModel.dll)

Build the code and close the VS

 

Step 4:

Give Full trust permission to the form. Go to file menu à Form Options.

Follow as per below diagram

Pic12

Save the form and preview the form. And submit it, you can see the record is created in the CRM.

Happy Coding

 

Elam

CRM 2013 Sub-grid user experience for new record creation

We have an odd design choice in CRM 2013 with the new sub-grid design. By default, when you add a new 1: N sub-grid to a form to display a custom entity you will get the following user experience.  The user clicks the + icon to add a new child record via the sub-grid:

pic1

CRM reveals a lookup control to allow the user to browse for an existing record:

pic2

If user want to add a new record, the user clicks the + button and the lookup appears. They don’t want to search for a record but the only thing they can do to move forward is click on the magnifying glass, this executes a search and reveals the lookup control’s search results:

pic3

There is however a new “+ New’ button for user, so user need to press that. That gets where user want to be, popping the create form so user can create my new child record:

pic4

Saving that new record automatically closes the form and refreshes the parent form revealing new child record in the sub-grid:

pic5

 

I want to change the default behavior.  Now I used Ribbon Workbench and call up the Ribbon definition for my entity.  I right-click on the “Add Existing” and select Hide Button:

pic6

Ribbon Workbench is showing me 2 buttons, I am going to hide both. Then I publish the change:

pic7

Now the Behavior changed.

Here’s the user experience now…

The user clicks the + button:

pic8

And up pops up for create form:

pic9

It’s a supported way, we are just changing only the Ribbon button

Elam

Shrink LDF file in SQL SERVER 2008

Reposting it again 🙂

 

Today i had a problem.  when i checked my database LDF file (log) file it’s some where around 25GB. I was trying to shrink the file it’s not possible. Could not able to shrink it from management studio. Found an workaround for that, Here the command for it.

First make the database to SIMPLE Recovery mode and do it.

– Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE [databasename]
SET RECOVERY SIMPLE;
GO
– Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE ([log file name], 1);
GO
– Reset the database
ALTER DATABASE [databasename]
SET RECOVERY FULL;
GO

Let me know if any questions

Elam

Improve the single page visitor

Yesterday when i was looking at my website data i found most of the my visitor are single page visitor. Who came down to my 2 post one is for SQL server and another to Jquery page. Both the posts ranked well in the google. Now my problem is how to convert this visitor to see other posts ? .

Here is what i am planning to convert the visitor

1) Given the link to other corresponding pages in that post
2) Written couple of continues post for that topics

These will increase the visitor. will update the post again in another one month

Regards,
Elam

Shrink LDF file in SQL SERVER 2008

Today i had a problem.  when i checked my database LDF file (log) file it’s some where around 25GB. I was trying to shrink the file it’s not possible. Could not able to shrink it from management studio. Found an workaround for that, Here the command for it.

First make the database to SIMPLE Recovery mode and do it.

— Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE [databasename]
SET RECOVERY SIMPLE;
GO
— Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE ([log file name], 1);
GO
— Reset the database
ALTER DATABASE [databasename]
SET RECOVERY FULL;
GO

Let me know if any questions

Elam

Steps to check website and Sql performance

Hi all,
It’s been very long time since i updated my blog.  i am really sorry for that. Well coming to the topic. I was working for one of our entrprise customer. We have web analytics data close to 90GB.  we are building another application to displaying the data, so i need to migrate the data to new database.

Intially when we started our migration it takes almost 6 days for one month data. I was wondering what to da. Then i followed the below mention steps and it come down to 3 Hours for one month.

Steps
1 check for each query execution time and also the subtree cost.  to get subtree cost include execution steps from the top bar in management studio. When sub tree cost is more sql server uses full 100% cpu time and memory.
2 created the index for each table.  while creating index make sure you create index for all where condition combination.
3 use temp table instead of union all query. Because i combine almost 60 table in single query. So instead of union all i used temp table to get the data
4 remove unnessary column in the select statement

Once you follow this points. It  will increase the website and sql performance

If any questions just mail me or add a comment

Elam

Google Analytics Sub Domain Tracking

Today I had an issue For one of our customer. They had implemented the Google analytics tracking code in their website and they have so many sub domain which they want to track in main domain GA profile Id. They had implemented the Ga code properly and also used _gaq.push([‘_setDomainName’, ”]);, but the problem is the sub domain is still capture as new visit.

when I check the problem it simple they forget to change the subdomains option in the GA profile settings page. it need to be like this

Ga Profile Settings

After I changed this also it was not working. because they had added “.”(dot) before the domain. For example if you want to capture the sub domain for elamparuthi.com. we need to set it like this

_gaq.push([‘_setDomainName’, ‘elamparuthi.com‘]);

Not

_gaq.push([‘_setDomainName’, ‘.elamparuthi.com‘]);

I used GA debugger chrome extension to debug this. it’s really nice tool.You can download it from here

https://chrome.google.com/webstore/detail/jnkmfdileelhofjcijamephohjechhna

Elam

Facebook f8 features

First my impression on the features they had released is WOW. Actually couple was week back I was thinking “what I was doing last year same day”. Try to find that in facebook I try scroll my wall to find but could not find it because of the amount of status msg I had, now this timeline feature solve this out. What a feature it is. I got a developer preview for testing and had a look at it it’s cool to use. Will post my preview image later tomorrow.Video upload and music , nice one to have on facebook . Next is new open graph it is awesome we can have so many things now. Will write an another post on this by this week end and I love the insights for the app, every Analytics guy will love it. They can do a separate analysis for apps alone

Will write an another post in details by tomorrow

Facebook rocks

Elam