<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>How to &#8211; Sibeesh Passion</title>
	<atom:link href="https://www.sibeeshpassion.com/category/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 02 Jun 2021 15:21:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>How to &#8211; Sibeesh Passion</title>
	<link>https://www.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Validation Using Template Driven Forms in Angular 5</title>
		<link>https://www.sibeeshpassion.com/validation-using-template-driven-forms-in-angular-5/</link>
					<comments>https://www.sibeeshpassion.com/validation-using-template-driven-forms-in-angular-5/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 22 Apr 2018 15:58:46 +0000</pubDate>
				<category><![CDATA[Angular]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Angular 5]]></category>
		<category><![CDATA[Angular 5 Validations]]></category>
		<category><![CDATA[ng5]]></category>
		<category><![CDATA[Template Driven Forms]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=12798</guid>

					<description><![CDATA[[toc] Introduction In this post, we are going to see how to do validation using template driven forms in Angular 5, this is just a different approach that you can follow, as we have discussed another way in our previous post. At the end of this article, you will get to know how you can implement validations in Angular 5 application using Template Driven Forms. This post is a continuation of the course Developing an Angular 5 App series if you haven&#8217;t gone through the previous posts yet, I strongly recommend you to do that. You can find the links to [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Introduction</h2>
<p>In this post, we are going to see how to do validation using template driven forms in <a href="http://sibeeshpassion.com/category/client-side-technologies/angular/">Angular</a> 5, this is just a different approach that you can follow, as we have discussed another way in our previous post. At the end of this article, you will get to know how you can implement validations in Angular 5 application using <em>Template Driven Forms.</em> This post is a continuation of the course <em>Developing an Angular 5 App</em> series if you haven&#8217;t gone through the previous posts yet, I strongly recommend you to do that. You can find the links to the previous posts below. I hope you will like this article.</p>
<h2><em>Developing an Angular 5 App</em> series</h2>
<p>These are the previous posts in this series. Please go ahead and have a look.</p>
<ol>
<li><a href="http://sibeeshpassion.com/what-is-new-and-how-to-set-up-our-first-angular-5-application/">What Is New and How to Set Up our First Angular 5 Application</a></li>
<li><a href="http://sibeeshpassion.com/angular-5-basic-demo-project-overview/">Angular 5 Basic Demo Project Overview</a></li>
<li><a href="http://sibeeshpassion.com/generating-your-first-components-and-modules-in-angular-5-app/">Generating Your First Components And Modules in Angular 5 App</a></li>
<li><a href="http://sibeeshpassion.com/implement-validations-in-angular-5-app/">Implement Validations in Angular 5 App</a></li>
</ol>
<h2><span id="source-code">Source Code</span></h2>
<p>You can always clone or download the source code <a href="https://github.com/SibeeshVenu/ng5">here</a></p>
<h2>Background</h2>
<p>Validations have a vital role in all application no matter in what language it is been developed. And since it is an essential part, there are many ways to achieve it. We are going to see Template Driven Forms approach here.</p>
<h2>Using the code</h2>
<p style="text-align: left;">It is recommended to clone the project from GitHub, so that you can try everything your own. Let&#8217;s go ahead and write some codes now.</p>
<h3>Install Bootstrap</h3>
<p>Before we begin, let&#8217;s install bootstrap in our application.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="shell">PS F:\My Projects\ng5&gt; npm install bootstrap --save</pre>
<p>As we are developing this application using Angular CLI, we can add the reference of Bootstrap in our Angular-CLI.json file. The styles section of that file will look like below after you add the reference.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="json">"styles": [
        "styles.css",
        "../node_modules/bootstrap/dist/css/bootstrap.min.css"
      ]</pre>
<p>Please be noted that there are many other ways to configure Bootstrap in our application, here we are not going to explain that.</p>
<h3>Importing ngForm to a variable</h3>
<p>Let&#8217;s clean codes in our Registration component and add a new form which has a form variable, and this form variable can hold the values of our form. There are many things you can do with this variable, for now, let&#8217;s say it is our model values container.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;div class="container"&gt;
  &lt;div class="row"&gt;
    &lt;div class="no-float center-block col-lg-4 col-sm-4"&gt;
      &lt;mat-card&gt;
        &lt;mat-card-header&gt;
          &lt;img mat-card-avatar src="../../../assets/images/App-login-manager-icon.png"&gt;
          &lt;mat-card-title&gt;Sign up&lt;/mat-card-title&gt;
          &lt;mat-card-subtitle&gt;Trust us for your data, and sign up&lt;/mat-card-subtitle&gt;
        &lt;/mat-card-header&gt;
        &lt;mat-card-content&gt;
          &lt;form #regsiterForm="ngForm" (ngSubmit)="register(regsiterForm)"&gt;
          &lt;/form&gt;
        &lt;/mat-card-content&gt;
      &lt;/mat-card&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>
<pre class="EnlighterJSRAW" data-enlighter-language="js">import { OnInit, Component } from "@angular/core";

@Component({
  selector: 'app-registration',
  templateUrl: './registration.component.html',
  styleUrls: ['./registration.component.css']
})
export class RegistrationComponent implements OnInit {
  constructor() {
  }

  ngOnInit() {
  }
}


</pre>
<h3>Implement Validation for User Name field using Template Driven Forms</h3>
<p>As we have created our form, now it is time to generate out input controls into it.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;form #regsiterForm="ngForm" (ngSubmit)="register(regsiterForm)"&gt;
    &lt;div class="signup-fields"&gt;
        &lt;div class="form-group"&gt;
            &lt;input type="text" required name="userName" class="form-control" placeholder="User Name"&gt;
        &lt;/div&gt;
        &lt;div&gt;
            &lt;button class="btn btn-primary btn-block" type="submit"&gt;Signup&lt;/button&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/form&gt;</pre>
<p>What we have above is a simple HTML with template driven form, where we are going to introduce the validation. Let&#8217;s modify the userName field now.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;input type="text" [(ngModel)]="userName" #userName="ngModel" required name="userName" class="form-control" placeholder="User Name"&gt;</pre>
<p>What we are trying to achieve by the above code is, creating a reference variable userName and assign the input value to it. Basically, this is a two-way binding, where we can set the data from our component and update it in the form, and vice versa. Now if you run your application, you should see an error as below.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">Uncaught Error: Cannot assign to a reference or variable!
    at _AstToIrVisitor.visitPropertyWrite (compiler.js:26025)
    at PropertyWrite.visit (compiler.js:4585)
    at convertActionBinding (compiler.js:25475)
    at eval (compiler.js:27987)
    at Array.forEach (&lt;anonymous&gt;)
    at ViewBuilder._createElementHandleEventFn (compiler.js:27983)
    at nodes.(anonymous function) (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:27620:27)
    at eval (compiler.js:27928)
    at Array.map (&lt;anonymous&gt;)
    at ViewBuilder._createNodeExpressions (compiler.js:27927)</pre>
<p>This is because we are using the same name for both model and reference variable. So we should change it. To do so, let&#8217;s create a User Model (user.model.ts) and reference it to our Register component.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">export class User {
    id: any;
    userName: string;
    email: string;
    userRole: string;
    profileImage: string;
    phoneNumber: string;
    firstName: string;
    lastName: string;
}</pre>
<pre class="EnlighterJSRAW" data-enlighter-language="js">import { User } from '../models/user.model'</pre>
<p>Now we can change our input as below.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;input type="text" [(ngModel)]="user.userName" #userName="ngModel" required name="userName" class="form-control" placeholder="User Name"&gt;</pre>
<p>Please make sure that to declare a user in registration component.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">export class RegistrationComponent implements OnInit {
  user = new User();
  constructor() {
  }

  ngOnInit() {
  }
}
</pre>
<p>Now if you run your application, you can see that the Submit button will be enabled only if the form is valid, that is, only if you enter any values in the username field.</p>
<h3>Decorate the validation message</h3>
<p>Now we know that our form is working fine, but don&#8217;t we need to give a message to the users if they haven&#8217;t given any values in the fields? Let&#8217;s add few more markups in our HTML.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;div class="form-group" [class.has-error]="userName.invalid" [class.has-success]="userName.valid"&gt;
    &lt;input type="text" [(ngModel)]="user.userName" #userName="ngModel" required name="userName" class="form-control" placeholder="User Name"&gt;
    &lt;span class="help-block" *ngIf="userName.errors?.required"&gt;
                  User Name is required
                &lt;/span&gt;
&lt;/div&gt;</pre>
<p>We are enabling the class &#8220;has-error&#8221; and &#8220;has-success&#8221; dynamically by checking the valid and invalid property of userName field. We are also showing our required field message in a new span if there are any required errors in our userName model. Now if you run your app, you can see that the validation is working fine.</p>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/userName-validation-without-touch-property.jpg"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-12799" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/userName-validation-without-touch-property.jpg" alt="" width="455" height="299" srcset="/wp-content/uploads/2018/04/userName-validation-without-touch-property.jpg 455w, /wp-content/uploads/2018/04/userName-validation-without-touch-property-300x197.jpg 300w, /wp-content/uploads/2018/04/userName-validation-without-touch-property-400x263.jpg 400w" sizes="(max-width: 455px) 100vw, 455px" /></a></p>
<p>But isn&#8217;t that validation showing by default, we should show the message only if the user touched our field, and refused to type anything right? Let&#8217;s add &#8220;userName.touched&#8221; in our markup.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;div class="form-group" [class.has-error]="userName.invalid &amp;&amp; userName.touched" [class.has-success]="userName.valid"&gt;
    &lt;input type="text" [(ngModel)]="user.userName" #userName="ngModel" required name="userName" class="form-control" placeholder="User Name"&gt;
    &lt;span class="help-block" *ngIf="userName.errors?.required &amp;&amp; userName.touched"&gt;
                  User Name is required
                &lt;/span&gt;
&lt;/div&gt;</pre>
<h3>Implement the validation for other fields as well</h3>
<p>Now it is time to implement the same in other fields.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;div class="container" style="margin-top:100px;"&gt;
  &lt;div class="row justify-content-center align-items-center"&gt;
    &lt;div class="col-lg-4 col-sm-4 center-block "&gt;
      &lt;mat-card&gt;
        &lt;mat-card-header&gt;
          &lt;img mat-card-avatar src="../../../assets/images/App-login-manager-icon.png"&gt;
          &lt;mat-card-title&gt;Sign up&lt;/mat-card-title&gt;
          &lt;mat-card-subtitle&gt;Trust us for your data, and sign up&lt;/mat-card-subtitle&gt;
        &lt;/mat-card-header&gt;
        &lt;mat-card-content&gt;
          &lt;form #regsiterForm="ngForm" (ngSubmit)="register(user)"&gt;
            &lt;div class="signup-fields"&gt;
              &lt;div class="form-group" [class.has-error]="userName.invalid &amp;&amp; userName.touched" [class.has-success]="userName.valid"&gt;
                &lt;input type="text" [(ngModel)]="user.userName" #userName="ngModel" required name="userName" class="form-control" placeholder="User Name"&gt;
                &lt;span class="help-block" *ngIf="userName.errors?.required &amp;&amp; userName.touched"&gt;
                  User Name is required
                &lt;/span&gt;
              &lt;/div&gt;
              &lt;div class="form-group" [class.has-error]="email.invalid &amp;&amp; email.touched" [class.has-success]="email.valid"&gt;
                &lt;input type="text" required [email]="user.email !== ''" [(ngModel)]="user.email" name="email" class="form-control" placeholder="Email"
                  #email="ngModel"&gt;
                &lt;span class="help-block" *ngIf="email.errors?.required &amp;&amp; email.touched"&gt;
                  Email is required
                &lt;/span&gt;
                &lt;span class="help-block" *ngIf="email.errors?.email &amp;&amp; email.touched"&gt;
                  Email is invalid
                &lt;/span&gt;
              &lt;/div&gt;
              &lt;div class="form-group" [class.has-error]="password.invalid &amp;&amp; password.touched" [class.has-success]="password.valid"&gt;
                &lt;input type="password" [(ngModel)]="user.password" required class="form-control" name="password" placeholder="Password" #password="ngModel"&gt;
                &lt;span class="help-block" *ngIf="password.invalid &amp;&amp; password.touched"&gt;
                  Password is required
                &lt;/span&gt;
              &lt;/div&gt;
              &lt;div class="form-group" [class.has-error]="confirmPasswordControl.invalid &amp;&amp; confirmPasswordControl.touched" [class.has-success]="confirmPasswordControl.valid"&gt;
                &lt;input type="password" required class="form-control" name="confirmPassword" placeholder="Confirm Password" [(ngModel)]="confirmPassword"
                  #confirmPasswordControl="ngModel"&gt;
                &lt;span class="help-block" *ngIf="confirmPasswordControl.errors?.required &amp;&amp; confirmPasswordControl.touched"&gt;
                  Confirm password is required
                &lt;/span&gt;
              &lt;/div&gt;
              &lt;div&gt;
                &lt;button class="btn btn-primary btn-block" type="submit" [disabled]="regsiterForm.invalid"&gt;Signup&lt;/button&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/form&gt;
        &lt;/mat-card-content&gt;
      &lt;/mat-card&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>
<p>For email validation, we have given an additional attribute and set the condition as [email]=&#8221;user.email !== &#8221;&#8221;, this is for not showing both the required validation and email validation together. This will show the required message if the user touched the field and not giving any values, and the email validation will get fired only if the entered value is not a valid email. Sounds good?</p>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/Template-Driven-Form-Validations.jpg"><img decoding="async" class="alignnone size-full wp-image-12800" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/Template-Driven-Form-Validations.jpg" alt="" width="476" height="601" srcset="/wp-content/uploads/2018/04/Template-Driven-Form-Validations.jpg 283w, /wp-content/uploads/2018/04/Template-Driven-Form-Validations-238x300.jpg 238w, /wp-content/uploads/2018/04/Template-Driven-Form-Validations-400x505.jpg 400w, /wp-content/uploads/2018/04/Template-Driven-Form-Validations-475x600.jpg 475w" sizes="(max-width: 476px) 100vw, 476px" /></a></p>
<h3>Add register function</h3>
<p>Finally, let&#8217;s add our function register.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="js">import { OnInit, Component } from "@angular/core";
import { User } from '../models/user.model';
@Component({
  selector: 'app-registration',
  templateUrl: './registration.component.html',
  styleUrls: ['./registration.component.css']
})
export class RegistrationComponent implements OnInit {
  user = new User();
  constructor() {
  }

  ngOnInit() {
  }

  register(user: User): void{
    console.log(user);
  }
}


</pre>
<p>Once it is done, let&#8217;s open our browser console and see the data.</p>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/Console-output.jpg"><img decoding="async" class="alignnone size-full wp-image-12801" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/Console-output.jpg" alt="" width="415" height="245" srcset="/wp-content/uploads/2018/04/Console-output.jpg 415w, /wp-content/uploads/2018/04/Console-output-300x177.jpg 300w, /wp-content/uploads/2018/04/Console-output-400x236.jpg 400w" sizes="(max-width: 415px) 100vw, 415px" /></a></p>
<p>Here we have seen how we can implement validation using template driven form. I will write my next article about implementing custom validators using directives in Angular, for comparing our password and confirm password field. Till then, bye.</p>
<h2><span id="conclusion">Conclusion</span></h2>
<p>Thanks a lot for reading. Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h2><span id="your-turn-what-do-you-think">Your turn. What do you think?</span></h2>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/validation-using-template-driven-forms-in-angular-5/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Implement Shared Custom Validator Directive in Angular</title>
		<link>https://www.sibeeshpassion.com/implement-shared-custom-validator-directive-in-angular/</link>
					<comments>https://www.sibeeshpassion.com/implement-shared-custom-validator-directive-in-angular/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 22 Apr 2018 15:21:33 +0000</pubDate>
				<category><![CDATA[Angular]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Angular 5]]></category>
		<category><![CDATA[Angular 5 Validations]]></category>
		<category><![CDATA[Angular directives]]></category>
		<category><![CDATA[Angular Shared Directive]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=12804</guid>

					<description><![CDATA[[toc] Introduction In this post, we are going to see how to create a custom validator directive in Angular 5. We have already seen how to do validation in our previous posts, and we have not done any validations for comparing the password and confirm the password, remember? Here we are going to see that. At the end of this article, you will get to know how to create a new shared directive according to our requirements. This post is a continuation of the course Developing an Angular 5 App series if you haven&#8217;t gone through the previous posts yet, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Introduction</h2>
<p>In this post, we are going to see how to create a custom validator directive in <a href="http://sibeeshpassion.com/category/client-side-technologies/angular/">Angular</a> 5. We have already seen how to do validation in our previous posts, and we have not done any validations for comparing the password and confirm the password, remember? Here we are going to see that. At the end of this article, you will get to know how to create a new shared directive according to our requirements<em>.</em> This post is a continuation of the course <em>Developing an Angular 5 App</em> series if you haven&#8217;t gone through the previous posts yet, I strongly recommend you to do that. You can find the links to the previous posts below. I hope you will like this article.</p>
<h2><em>Developing an Angular 5 App</em> series</h2>
<p>These are the previous posts in this series. Please go ahead and have a look.</p>
<ol>
<li><a href="http://sibeeshpassion.com/what-is-new-and-how-to-set-up-our-first-angular-5-application/">What Is New and How to Set Up our First Angular 5 Application</a></li>
<li><a href="http://sibeeshpassion.com/angular-5-basic-demo-project-overview/">Angular 5 Basic Demo Project Overview</a></li>
<li><a href="http://sibeeshpassion.com/generating-your-first-components-and-modules-in-angular-5-app/">Generating Your First Components And Modules in Angular 5 App</a></li>
<li><a href="http://sibeeshpassion.com/implement-validations-in-angular-5-app/">Implement Validations in Angular 5 App</a></li>
<li>Validation Using Template Driven Forms in Angular 5</li>
</ol>
<h2><span id="source-code">Source Code</span></h2>
<p>You can always clone or download the source code <a href="https://github.com/SibeeshVenu/ng5">here</a></p>
<h2>Background</h2>
<p>Validations have a vital role in all application no matter in what language it is been developed. And since it is an essential part, there are many ways to achieve it. If we create a custom shared directive for creating a compare validator, it would be a great piece of code right, which can be reused.</p>
<h2>Using the code</h2>
<p style="text-align: left;">It is recommended to clone the project from GitHub, so that you can try everything your own. Let&#8217;s go ahead and write some codes now.</p>
<h3>Creating a custom directive</h3>
<p>Let&#8217;s just create a new directive in a shared folder and name it <em>equal.validator.directive.ts. </em>Now open that file and start writing the code. Let&#8217;s import some of the core components first.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="js">import { Validator, AbstractControl, NG_VALIDATORS } from "@angular/forms";
import { Directive, Input } from "@angular/core";</pre>
<p>Now Let&#8217;s define our class and @Directive.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="js">import { Validator, AbstractControl, NG_VALIDATORS } from "@angular/forms";
import { Directive, Input } from "@angular/core";

@Directive({
    selector: "[appEqualValidator]",
    providers: [{
        provide: NG_VALIDATORS,
        useExisting: EqualValidatorDirective,
        multi: true
    }]
})
export class EqualValidatorDirective implements Validator {
    validate(c: AbstractControl): { [key: string]: any; } {
        throw new Error("Method not implemented.");
    }
    registerOnValidatorChange?(fn: () =&gt; void): void {
        throw new Error("Method not implemented.");
    }
}</pre>
<p>As you can see that, we are actually inheriting our new class  EqualValidatorDirective from Validator. Now we need to change the implementations of the method inside it. We should also add our new directive in app.module.ts file.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="js">import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule} from '@angular/platform-browser/animations'
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MatButtonModule, MatCardModule, MatInputModule, MatSnackBarModule, MatToolbarModule } from '@angular/material';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { EqualValidatorDirective } from './shared/equal.validator.directive';

import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { NavComponent } from './nav/nav.component';
import { RegistrationComponent } from './registration/registration.component';
import { LoginComponent } from './login/login.component';

import { AuthService } from './auth.service';
import { AuthGuard } from './auth.guard';

const myRoots: Routes = [
  { path: '', component: HomeComponent, pathMatch: 'full' , canActivate: [AuthGuard]},
  { path: 'register', component: RegistrationComponent },
  { path: 'login', component: LoginComponent},
  { path: 'home', component: HomeComponent, canActivate: [AuthGuard]}
];

@NgModule({
  declarations: [
    AppComponent,
    HomeComponent,
    NavComponent,
    RegistrationComponent,
    LoginComponent,
    EqualValidatorDirective
  ],
  imports: [
    BrowserModule, BrowserAnimationsModule, FormsModule, ReactiveFormsModule,
    MatButtonModule, MatCardModule, MatInputModule, MatSnackBarModule, MatToolbarModule,
    RouterModule.forRoot(myRoots)
  ],
  providers: [AuthService, AuthGuard],
  bootstrap: [AppComponent]
})
export class AppModule { }
</pre>
<p>&nbsp;</p>
<h3>Implement validate</h3>
<p>Before we do that, we should add our new cutom directive selector in our confirm password field, because that&#8217;s where we are going to use our validator. So we are going to change our markup for confirm password field as below.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">&lt;div class="form-group" [class.has-error]="confirmPasswordControl.invalid &amp;&amp; confirmPasswordControl.touched" [class.has-success]="confirmPasswordControl.valid"&gt;
    &lt;input type="password" required class="form-control" name="confirmPassword" appEqualValidator="password" placeholder="Confirm Password" [(ngModel)]="confirmPassword" #confirmPasswordControl="ngModel"&gt;
    &lt;span class="help-block" *ngIf="confirmPasswordControl.errors?.required &amp;&amp; confirmPasswordControl.touched"&gt;
                  Confirm password is required
                &lt;/span&gt;
&lt;/div&gt;</pre>
<p>As you can see, we are using the selector  <em>appEqualValidator=&#8221;password&#8221; </em>in our confirm password field. Please do check my previous posts if you are not sure how to implement other validations like email and required.</p>
<p>Now let&#8217;s go back to our custom directive and make some changes.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="js">export class EqualValidatorDirective implements Validator {
    @Input() appEqualValidator: string;
    validate(c: AbstractControl): { [key: string]: any; } {
        const controlToCompare = c.parent.get(this.appEqualValidator)
        if (controlToCompare &amp;&amp; controlToCompare.value == c.value)return { "equal": true };
        return { "notEqual": true }
    }
    registerOnValidatorChange?(fn: () =&gt; void): void {
        throw new Error("Method not implemented.");
    }
}</pre>
<p>Here, we get our confirmPassword control in the absolute control &#8220;c&#8221;, and in the next line, we are just finding our password control by getting the parent element of confirmPassword. Once we get that, we can easily perform the comparison easily right? So, if it matches we return  { &#8220;equal&#8221;: true }; or else { &#8220;notEqual&#8221;: true }. Sounds good?</p>
<h3>Introduce new span for custom message</h3>
<p>Now we have a custom validator which compares two values, and the only thing which pending is, that to create a span for showing our new message in UI. Let&#8217;s change our markup now.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;div class="form-group" [class.has-error]="confirmPasswordControl.invalid &amp;&amp; confirmPasswordControl.touched" [class.has-success]="confirmPasswordControl.valid"&gt;
    &lt;input type="password" required class="form-control" name="confirmPassword" appEqualValidator="password" placeholder="Confirm Password" [(ngModel)]="confirmPassword" #confirmPasswordControl="ngModel"&gt;
    &lt;span class="help-block" *ngIf="confirmPasswordControl.errors?.required &amp;&amp; confirmPasswordControl.touched"&gt;
                  Confirm password is required
                &lt;/span&gt;
    &lt;span class="help-block" *ngIf="confirmPasswordControl.errors?.notEqual 
                      &amp;&amp; confirmPasswordControl.touched &amp;&amp; !confirmPasswordControl.errors?.required"&gt;
                  Password doesn't match
                &lt;/span&gt;
&lt;/div&gt;</pre>
<p>As you can see, we are showing the custom message only if the directive returns notEqual property and there are no required errors. Let&#8217;s run our application and see it in action.</p>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/Custom-Shared-Equal-Validator-Directive.jpg"><img decoding="async" class="alignnone size-full wp-image-12805" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/Custom-Shared-Equal-Validator-Directive.jpg" alt="" width="384" height="529" srcset="/wp-content/uploads/2018/04/Custom-Shared-Equal-Validator-Directive.jpg 259w, /wp-content/uploads/2018/04/Custom-Shared-Equal-Validator-Directive-218x300.jpg 218w" sizes="(max-width: 384px) 100vw, 384px" /></a></p>
<p>&nbsp;</p>
<p>Here we have seen how we can implement shared custom validator directive. Let&#8217;s connect to a database and save these values in next article. Till then, bye.</p>
<h2><span id="conclusion">Conclusion</span></h2>
<p>Thanks a lot for reading. Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h2><span id="your-turn-what-do-you-think">Your turn. What do you think?</span></h2>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/implement-shared-custom-validator-directive-in-angular/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Recover your lost data in any Windows machine easily</title>
		<link>https://www.sibeeshpassion.com/recover-your-lost-data-in-any-windows-machine-easily/</link>
					<comments>https://www.sibeeshpassion.com/recover-your-lost-data-in-any-windows-machine-easily/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 12 Oct 2017 15:36:02 +0000</pubDate>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Find lost files in Windows]]></category>
		<category><![CDATA[Get your lost data easily]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Recover files in Windows]]></category>
		<category><![CDATA[Stellar phoenix windows data recovery]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12517</guid>

					<description><![CDATA[[toc] Introduction Before I write this post, let me ask you a question first, how many of you are worried about losing the data you have on your machine? Wouldn&#8217;t it too good to have a recovery software in your machine always? At any point in time, we may lose our data mistakenly, it may be done by yourself, by any family member or friends when they use your system. With a help of a data recovery software, you can still get the data which you thought lost. Here in this post, I am going to write a product review [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>Before I write this post, let me ask you a question first, how many of you are worried about losing the data you have on your machine? Wouldn&#8217;t it too good to have a recovery software in your machine always? At any point in time, we may lose our data mistakenly, it may be done by yourself, by any family member or friends when they use your system. With a help of a data recovery software, you can still get the data which you thought lost. Here in this post, I am going to write a <a href="http://sibeeshpassion.com/category/products/" rel="noopener" target="_blank">product </a>review for a recovery software which is Stellar Phoenix Windows Data Recovery &#8211; Professional. I hope you will like this. Now let&#8217;s begin.</p>
<h3>Background</h3>
<p>I wouldn&#8217;t doubt you if you ask me a question, though we have a lot of data recovery software, why did I choose this one? My answer is straightforward, it is fast, and easy to use, and offering a lot of other advanced options for our easy recovery.</p>
<h3>Let&#8217;s explore some features of this product</h3>
<p>Once you install the product, open it and apply the license key if you have one, however you can always use a free version.</p>
<div id="attachment_12518" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/10/Stellar-Phoenix-Windows-Data-Recovery-e1507736912205.png"><img decoding="async" aria-describedby="caption-attachment-12518" src="http://sibeeshpassion.com/wp-content/uploads/2017/10/Stellar-Phoenix-Windows-Data-Recovery-e1507736912205.png" alt="Stellar Phoenix Windows Data Recovery" width="634" height="447" class="size-full wp-image-12518" /></a><p id="caption-attachment-12518" class="wp-caption-text">Stellar Phoenix Windows Data Recovery</p></div>
<p>
As you can see you can select any type of files you need. Once you select that, please do not waste time and click on next button. Remember, we have a lot of data to be recovered.
</p>
<div id="attachment_12520" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/10/Select-location-of-the-filies-to-be-recovered-e1507821525889.png"><img decoding="async" aria-describedby="caption-attachment-12520" src="http://sibeeshpassion.com/wp-content/uploads/2017/10/Select-location-of-the-filies-to-be-recovered-e1507821525889.png" alt="Select location of the files to be recovered" width="634" height="447" class="size-full wp-image-12520" /></a><p id="caption-attachment-12520" class="wp-caption-text">Select location of the files to be recovered</p></div>
<p>Now you have chosen the location, let’s hit the scan button.</p>
<div id="attachment_12521" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/10/Data-recovery-scanning-e1507821718153.png"><img decoding="async" aria-describedby="caption-attachment-12521" src="http://sibeeshpassion.com/wp-content/uploads/2017/10/Data-recovery-scanning-e1507821718153.png" alt="Data recovery scanning" width="634" height="447" class="size-full wp-image-12521" /></a><p id="caption-attachment-12521" class="wp-caption-text">Data recovery scanning</p></div>
<p>The scanning speed is comparatively good when it compares to other recovery software, that was one of the reasons why I chose this product.</p>
<div id="attachment_12522" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/10/Data-recovery-scanning-result-e1507821817525.png"><img decoding="async" aria-describedby="caption-attachment-12522" src="http://sibeeshpassion.com/wp-content/uploads/2017/10/Data-recovery-scanning-result-e1507821817525.png" alt="Data recovery scanning result" width="634" height="447" class="size-full wp-image-12522" /></a><p id="caption-attachment-12522" class="wp-caption-text">Data recovery scanning result</p></div>
<p>When it is completed, you will get an alert as above, where you can see the report. Now you can select the items or folder which you want to recover, and click the recover button.</p>
<div id="attachment_12523" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/10/Select-the-items-or-folders-to-be-recovered-e1507821952647.png"><img decoding="async" aria-describedby="caption-attachment-12523" src="http://sibeeshpassion.com/wp-content/uploads/2017/10/Select-the-items-or-folders-to-be-recovered-e1507821952647.png" alt="Select the items or folders to be recovered" width="634" height="447" class="size-full wp-image-12523" /></a><p id="caption-attachment-12523" class="wp-caption-text">Select the items or folders to be recovered</p></div>
<p>Last but not the least, you will have to select the location where exactly you need to save the recovered items. You can choose the folder by click the Browse button shown in the system.</p>
<div id="attachment_12524" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/10/Select-the-location-where-the-recovered-data-to-be-saved-e1507822088653.png"><img decoding="async" aria-describedby="caption-attachment-12524" src="http://sibeeshpassion.com/wp-content/uploads/2017/10/Select-the-location-where-the-recovered-data-to-be-saved-e1507822088653.png" alt="Select the location where the recovered data to be saved" width="634" height="447" class="size-full wp-image-12524" /></a><p id="caption-attachment-12524" class="wp-caption-text">Select the location where the recovered data to be saved</p></div>
<p>Once you select the location, the recovery process will get started and the recovered items will be there for you. Here I have just recovered my driving license, which got deleted somehow. <br />
What are you going to recover using this tool? Let me know your experience using this product, I would love to hear from you. Thanks a lot for reading!.</p>
<h3>Follow up</h3>
<p>You may find some information about the product <em>Stellar Phoenix WIndows Data Recovery-Professional</em> <a href="https://www.stellarinfo.com/windows-data-recovery-professional.php" rel="noopener" target="_blank">here</a>.</p>
<h3>Conclusion</h3>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h3>Your turn. What do you think?</h3>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/recover-your-lost-data-in-any-windows-machine-easily/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to get NOC from any RTO offices in India</title>
		<link>https://www.sibeeshpassion.com/how-to-get-noc-from-any-rto-offices-in-india/</link>
					<comments>https://www.sibeeshpassion.com/how-to-get-noc-from-any-rto-offices-in-india/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 22 Sep 2017 19:20:13 +0000</pubDate>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Get NOC in India]]></category>
		<category><![CDATA[Get Road Tax Paid back]]></category>
		<category><![CDATA[Getting NOC Easily]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[How to get NOC]]></category>
		<category><![CDATA[No Objection Certificate]]></category>
		<category><![CDATA[NOC from Chennai]]></category>
		<category><![CDATA[NOC to Kerala]]></category>
		<category><![CDATA[Road Tax Cashback]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12502</guid>

					<description><![CDATA[[toc] Introduction Many people still think, getting an NOC or No Objection Certificate from an RTO office is a tough job to do. Trust me, I was one among those people. Then I figured it out it isn&#8217;t that hard. Here, in this post, we are going to a see how to get a NOC from any RTO in India easily. Though the rules are same, the process may be different for some percentages, but it will be same if you are applying for NOC from Chennai, Tamilnadu, India, as I got my NOC from there. I wanted to reregister [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>Many people still think, getting an NOC or No Objection Certificate from an RTO office is a tough job to do. Trust me, I was one among those people. Then I figured it out it isn&#8217;t that hard. Here, in this post, we are going to a see <a href="http://sibeeshpassion.com/category/How-To" target="_blank">how to</a> get a NOC from any RTO in India easily. Though the rules are same, the process may be different for some percentages, but it will be same if you are applying for NOC from Chennai, Tamilnadu, India, as I got my NOC from there. I wanted to reregister my bike in Ernakulam, Kerala. I will be explaining each step that you may need to take to get it, please be noted that the documents mentioned are needed as per the rule when I write this blog. I hope you will like this post. Thanks much for visiting. </p>
<h3>Background</h3>
<p>Finally, after 6 years of my career in Chennai, I got a transfer to Kochi, Kerala. Though I had to do lots of work like shifting my home, finding a residency in Kochi etc, one thing my mind always curious about was, getting an NOC, because to reregister any vehicle in any cities in India, a must-have document is NOC. When I enquired about it, most of my friends said it is a long process, and some people even said I may need to spend 3000 INR to get it. Before giving money to any agents, who usually ask 2000 INR to 4000 INR, depends on the city you live, I thought of trying it out myself. And luckily the process was not at all hard as I thought. Here in this post, I am going to share you my experience on the same. </p>
<h3>Documents needed</h3>
<p>As the first step, I visited the Shollinganallure RTO office in Chennai, as my bike was registered in that RTO. The moment I entered the office, I could see a huge crowd, and then my eyes started searching for an agent who can do this work for me. Finally, I could find an agent, and after a discussion with him, I made the below conclusion.</p>
<li>Need to pay 2500 INR</li>
<li>We need to collect the Pollution Certificate by ourself</li>
<li>We need to collect the Certificate from Commissioner Office</li>
<p>And at last, if we give him all the documents, his work is just arranging the documents and submit it to the RTO office which is just 200 meter away. Isn&#8217;t it great? I just left his office and decided to do everything my own.</p>
<blockquote><p>If you are fine with the agents, you can always do that. There will be at least one agent office near to all RTO, just inquire about it, I am sure you will be able to find one.</p></blockquote>
<p>Ok, let&#8217;s try to list down all the documents needed first as I got the list from the Helping Center in RTO office(Usually a person sits near the entrance), then we can discuss how you can get those.</p>
<li>Commissioner Certificate</li>
<li>RC Book Original</li>
<li>Pollution Certificate</li>
<li>Form 28, 3 copies with Chasis pencil print</li>
<li>Insurance Certificate</li>
<p>When I was noting down this document names, my mind was thinking how I am going to get a certificate from Commissioner office, considering the difficulty in getting a document from a government office in India. Let&#8217;s leave all that for now, and discuss how to get it. </p>
<h3>Getting a Commissioner Certificate for NOC</h3>
<p>Google is always my friend, so I just googled the address of the commissioner office in Chennai. When I write this blog, this was the address. </p>
<blockquote><p>
No. 132, Commissioaner Office Building, EVK Sampath Rd, Vepery, Periyamet, Chennai, Tamil Nadu 600007
</p></blockquote>
<p><iframe loading="lazy" src="https://www.google.com/maps/embed?pb=!1m22!1m12!1m3!1d124361.08361303603!2d80.19323426011725!3d13.081187662151502!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!4m7!3e6!4m0!4m4!1s0x3a52660f0377b00f%3A0x658d531aaca11d57!3m2!1d13.081197099999999!2d80.26327479999999!5e0!3m2!1sen!2sin!4v1506103170968" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe></p>
<p>This is the certificate which will mention about all the penalties you have, all the traffic rule violations. And you will have to pay if you have any fine for any of your act. It was Monday 9.00 AM when I start from my home at Old Pallavaram. I thought I can reach there in one hour, later I found my assumptions were wrong. Finally it was 10.40 AM when I reach as the traffic was more at that time. A normall security will be performed when you enter the campus, once the security guards verified your bags and vehicle, they will ask you to go af collect the temporary ID card, the athority for that, will always be neat to the gate. </p>
<p>You need to enter your address, mobile number, purpose of visit in a registry given and get your temporary ID card. Once you get it, please don&#8217;t waste your time. Walk into main building, or say someone about your purpose of visit, they will narate you to the right building. After raeching to the NOC department, I found the mistakes I did. I didn&#8217;t even take one photostat of any document, so I had to go down and take those, there I wasted around one hour. Normally the Xerox shops near commissioner office, are always crowded. Trust me, you will find a long queue, just to take a photostat. These are the documents you need. </p>
<li>RC Book Copy</li>
<li>Insurance Certificate</li>
<li>ID proof</li>
<li>Address proof</li>
<blockquote><p>Please carry all the original documents with you as it is needed for them for verification</p></blockquote>
<p>As I was staying in Chennai for rent, I was not having any valid address proof except the rental agreement. If you belong to my category, please carry the original rental agreement with you, if you don&#8217;t have original please take a xerox copy. Once after you arranged all the documents, give it to the official, after verifying the documents, he/she will give you a form to be filled with your vehicle chasis number, engine number etc. </p>
<p>You will have to pay 20 INR as a processing fee. After you pay the amount, please do not forget to collect the receipt. If you are submitting the document before 12.00 PM, you will get the commissioner certificate on the next day in between 3.00 PM to 5.00 PM. While coming for collecting the certificate, be sure that you have the receipt with you. That is all for that day. I was able to go office from there directly, even though I was late.</p>
<p>On the next day, we planned to go there from office. Me and my friend Divya started from office around 2.00 PM after lunch. It was a long journey as my office was at Thoraipakkam, Chennai. The ride to the destination was really great, I must thank Divya for being such an amazing co-rider. She was able to come even in the hot sun. Thank you Divya. </p>
<p>We reached there at 3.30 and the same security checkin was performed, this time it was not that crowded, so I was able to get a temporary IC card easily. I was rushing towards the NOC department as we both needed to attend a client call at 6.00 PM. So we wanted to be in office at least by 5.50 PM. But I was not lucky on that day, I had to wait for one hour as the official was not available the at desk. It was 4.30 PM when I get the certificate in my hand. I was feeling a bit relaxed after seeing that certificate, because I knew with that certificate, 60% of NOC work is done. By the way we were able to reach office by 5.55 PM, and the call went well, this is just for your information. </p>
<h3>Getting a Pollution Certificate</h3>
<p>This is an easy job. You can always find a pollution test office near to the RTO office. Please ride your bike there, and ask for the pollution certificate. You may have to pay 50 INR for the work, within 10 minutes you will get a pollution certificate in hand. Below is the sample pollution certificate for your reference. </p>
<div id="attachment_12508" style="width: 645px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/09/IMG_20170831_074248-e1506106919606.jpg"><img decoding="async" aria-describedby="caption-attachment-12508" src="http://sibeeshpassion.com/wp-content/uploads/2017/09/IMG_20170831_074248-e1506106919606.jpg" alt="Sample Pollution Certificate" width="635" height="459" class="size-full wp-image-12508" /></a><p id="caption-attachment-12508" class="wp-caption-text">Sample Pollution Certificate</p></div>
<h3>Form 28, 3 copies with Chasis pencil print</h3>
<p>Now take three copies of your Form 28, you can download it from internet. If you don&#8217;t like to browse for it, you can find the same here in this <a href="https://vahan.nic.in/nrservices/faces/forms/form28.pdf" rel="noopener" target="_blank">link</a>. Now fill all the three copies with appropriate data, and please make sure that you are taking a pencil sketch or print of your vehicles Chasis number. The official will verify whether you have the pencil print in all the three copies. </p>
<h3>Submission process</h3>
<p>Once you arrange all the document, please give it to the official for the verification. And if everything is fine, you will be asked to go and get it signed with RTO officer. Wait, the process is not yet over. Now you have to go to the cash counter and pay 200 INR as the processing fee. Once you paid, please collect the bill and paste it on the application. </p>
<p>Cool, you have done it. Now give it to the counter and please don&#8217;t forget to ask about when you can come and collect from the office. </p>
<h3>What if, you are not available for collecting NOC</h3>
<p>You can still get the NOC, even if you are not available in the applied city. However you may need to sign an authorization letter saying about your absense and to whom the certicate can be delivered to, with that any of your family/friends can get it for you. </p>
<blockquote><p>There is an option to get back the road tax you have paid for the initial city, I will share about that in my next post. It can be done only after you reregister the vehicle.</p></blockquote>
<h3>Conclusion</h3>
<p>This is the process I was going to get an NOC from Chennai, Tamilnadu. Please be noted that it may vary a bit according to the state government rules.Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h3>Your turn. What do you think?</h3>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on any other Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/how-to-get-noc-from-any-rto-offices-in-india/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Upload Contents To Azure Container, CDN in WordPress Folder Format</title>
		<link>https://www.sibeeshpassion.com/upload-contents-to-azure-container-cdn-in-wordpress-folder-format/</link>
					<comments>https://www.sibeeshpassion.com/upload-contents-to-azure-container-cdn-in-wordpress-folder-format/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 29 May 2017 16:09:25 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure CDN]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Azure Blobs With Hierarchy Folders]]></category>
		<category><![CDATA[Azure Storage And WordPress]]></category>
		<category><![CDATA[Azure With WordPress]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12411</guid>

					<description><![CDATA[[toc] Introduction Here, in this article we are going to a see how we upload contents to our Azure container in our CDN storage in a WordPress folder format. You may be thinking what is so special in WrdPress folder format, what makes the difference in other formats? When I say WordPress folder format, I mean one folder in an another folder. In WordPress we usually have the structure as wwwroot/wp-content/uploads/2017/05/. The real problem is, we can not create a container inside a container. Yeah, you heard it right. But, you don&#8217;t need to worry about it, there is always [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>Here, in this article we are going to a see how we upload contents to our <a href="http://sibeeshpassion.com/category/Azure" target="_blank">Azure </a>container in our CDN storage in a WordPress folder format. You may be thinking what is so special in WrdPress folder format, what makes the difference in other formats? When I say WordPress folder format, I mean one folder in an another folder. In WordPress we usually have the structure as <em>wwwroot/wp-content/uploads/2017/05/</em>. The real problem is, we can not create a container inside a container. Yeah, you heard it right. But, you don&#8217;t need to worry about it, there is always few ways we can achieve this need, in this post I am going to show you that. I hope you will like this. Now let&#8217;s begin.</p>
<h3>Background</h3>
<p>I recently created a Azure CDN for my website, and when I was just trying to upload the files to my Azure storage, I got stuck with the problem, that we can not create a container inside a container.</p>
<div id="attachment_12413" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/No-option-to-upload-a-container-inside-a-container.png"><img decoding="async" aria-describedby="caption-attachment-12413" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/No-option-to-upload-a-container-inside-a-container.png" alt="No option to upload a container inside a container" width="634" height="209" class="size-full wp-image-12413" srcset="/wp-content/uploads/2017/05/No-option-to-upload-a-container-inside-a-container.png 634w, /wp-content/uploads/2017/05/No-option-to-upload-a-container-inside-a-container-300x99.png 300w, /wp-content/uploads/2017/05/No-option-to-upload-a-container-inside-a-container-400x132.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12413" class="wp-caption-text">No option to upload a container inside a container</p></div>
<p>If it is possible, changing URLs of my entire images and other contents would have been pretty much easier, hope you know what I mean? We could have just uploaded the root folder and change the main URL to our CDN endpoint. In my case, change the URL http://sibeeshpassion.com/ to http://cdn.sibeeshpassion.com/ could fix the issues, and with some plugins, we can easily do that. </p>
<p>In this post, we are going to see two possible solution we can use. </p>
<li>Use &#8220;/&#8221; in the Azure blob </li>
<li>Upload the folders via tools like Storage Explorer </li>
<h3>Use &#8220;/&#8221; in the Azure blob</h3>
<p>One good thing here is we can always create virtual folders by having the “/” character as a delimiter/part of the blob name to build the hierarchy we need. In our case it is <em>wwwroot/wp-content/uploads/2017/05/</em>. Though the Blob service in Azure storage is based on flat storage scheme, not a hierarchical scheme, we can still specify a character or string delimiter within a blob name to create a virtual hierarchy. For example, we can always create unique blobs as preceding</p>
<li>/sibeeshpassion.png</li>
<li>/2017/01//sibeeshpassion.png</li>
<li>/wp-content/uploads/2017/01/sibeeshpassion.png</li>
<p>You can follow <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata" target="_blank">this post</a> for getting more information abut this.  </p>
<h3>Upload the folders via tools like Storage Explorer</h3>
<p>This step is pretty much easier than the above mentioned way. Here we are going use the tools like Storage Explorer to do the task for us. Uploading each contents manually and renaming them in hierarchical format would be a tough task, am I right? If you are having around 20-50 images or contents in your site, that won&#8217;t be a problem. But my case was bit different, as I had around 5000 images and other contents, so I personally selected this method. </p>
<p>To get started, you will have to download the tool <a href="http://storageexplorer.com/" target="_blank">Microsoft Azure Storage Explorer</a>, once you download, please install it and open it.</p>
<p>Now, add your Azure account in Storage Explorer.</p>
<div id="attachment_12414" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Add-Account-in-Microsoft-Azure-Storage-Explorer.png"><img decoding="async" aria-describedby="caption-attachment-12414" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Add-Account-in-Microsoft-Azure-Storage-Explorer.png" alt="Add Account in Microsoft Azure Storage Explorer" width="634" height="490" class="size-full wp-image-12414" srcset="/wp-content/uploads/2017/05/Add-Account-in-Microsoft-Azure-Storage-Explorer.png 462w, /wp-content/uploads/2017/05/Add-Account-in-Microsoft-Azure-Storage-Explorer-300x232.png 300w, /wp-content/uploads/2017/05/Add-Account-in-Microsoft-Azure-Storage-Explorer-400x309.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12414" class="wp-caption-text">Add Account in Microsoft Azure Storage Explorer</p></div>
<p>Once you add your account, the tool wish list down all of your storage and resources you have with that account. Now go to your storage account and create a container. Let&#8217;s create and name our container as wp-content.</p>
<div id="attachment_12415" style="width: 318px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Creating-a-BLOB-Container.png"><img decoding="async" aria-describedby="caption-attachment-12415" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Creating-a-BLOB-Container.png" alt="Creating a BLOB Container" width="308" height="201" class="size-full wp-image-12415" srcset="/wp-content/uploads/2017/05/Creating-a-BLOB-Container.png 308w, /wp-content/uploads/2017/05/Creating-a-BLOB-Container-300x196.png 300w" sizes="(max-width: 308px) 100vw, 308px" /></a><p id="caption-attachment-12415" class="wp-caption-text">Creating a BLOB Container</p></div>
<p>Now what is pending from our end is, uploading the folders. Let&#8217;s create one sample folder with one image.</p>
<div id="attachment_12416" style="width: 489px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Files-and-Folders-to-Upload.png"><img decoding="async" aria-describedby="caption-attachment-12416" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Files-and-Folders-to-Upload.png" alt="Files and Folders to Upload" width="479" height="187" class="size-full wp-image-12416" srcset="/wp-content/uploads/2017/05/Files-and-Folders-to-Upload.png 479w, /wp-content/uploads/2017/05/Files-and-Folders-to-Upload-300x117.png 300w, /wp-content/uploads/2017/05/Files-and-Folders-to-Upload-400x156.png 400w" sizes="(max-width: 479px) 100vw, 479px" /></a><p id="caption-attachment-12416" class="wp-caption-text">Files and Folders to Upload</p></div>
<p>Now click on the upload button and select the root folder you need to upload.</p>
<div id="attachment_12417" style="width: 517px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded.png"><img decoding="async" aria-describedby="caption-attachment-12417" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded.png" alt="Select the Folder to be Uploaded" width="507" height="344" class="size-full wp-image-12417" srcset="/wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded.png 507w, /wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded-300x204.png 300w, /wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded-320x218.png 320w, /wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded-160x110.png 160w, /wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded-400x271.png 400w" sizes="(max-width: 507px) 100vw, 507px" /></a><p id="caption-attachment-12417" class="wp-caption-text">Select the Folder to be Uploaded</p></div>
<p>Once you are done uploading, I am sure that you can see those files in your storage account. Please be noted that it follows the same hierarchy we needed.</p>
<div id="attachment_12418" style="width: 731px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Select-the-Uploaded-Files-e1495893001229.png"><img decoding="async" aria-describedby="caption-attachment-12418" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Select-the-Uploaded-Files-e1495893001229.png" alt="Select the Uploaded Files" width="721" height="185" class="size-full wp-image-12418" srcset="/wp-content/uploads/2017/05/Select-the-Uploaded-Files-e1495893001229.png 634w, /wp-content/uploads/2017/05/Select-the-Uploaded-Files-e1495893001229-300x77.png 300w, /wp-content/uploads/2017/05/Select-the-Uploaded-Files-e1495893001229-400x103.png 400w" sizes="(max-width: 721px) 100vw, 721px" /></a><p id="caption-attachment-12418" class="wp-caption-text">Select the Uploaded Files</p></div>
<p>Now if you just copy the file URL and open it in the browser, you can see the content you have just uploaded.</p>
<blockquote><p>
Please be noted that, the default access policy of a container is private, thus you will not be able to load the contents via browser. Most probably you will be getting a 404 error. To fix this you will have to change the access policy wither to blob or container. You can follow this post: <a href="http://sibeeshpassion.com/fix-for-404-resourcenotfound-error-after-uploading-to-azure-container/" target="_blank">Fix For 404 ResourceNotFound Error After Uploading to Azure Container</a>
</p></blockquote>
<p>Just for the reference you can always login to your Azure portal and check the blob, there you can find the hierarchical blob.</p>
<div id="attachment_12420" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Hierarchy-Folder-Structure-in-Azure-Storage-Container.png"><img decoding="async" aria-describedby="caption-attachment-12420" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Hierarchy-Folder-Structure-in-Azure-Storage-Container.png" alt="Hierarchy Folder Structure in Azure Storage Container" width="634" height="339" class="size-full wp-image-12420" srcset="/wp-content/uploads/2017/05/Hierarchy-Folder-Structure-in-Azure-Storage-Container.png 634w, /wp-content/uploads/2017/05/Hierarchy-Folder-Structure-in-Azure-Storage-Container-300x160.png 300w, /wp-content/uploads/2017/05/Hierarchy-Folder-Structure-in-Azure-Storage-Container-400x214.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12420" class="wp-caption-text">Hierarchy Folder Structure in Azure Storage Container</p></div>
<p>Thanks for reading, I will come back with another article which explore Azure CDN. Happy Uploading!.</p>
<h3>Conclusion</h3>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h3>Your turn. What do you think?</h3>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/upload-contents-to-azure-container-cdn-in-wordpress-folder-format/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Azure Content Delivery Network (CDN) &#8211; A Walk Through</title>
		<link>https://www.sibeeshpassion.com/azure-content-delivery-network-cdn-a-walk-through/</link>
					<comments>https://www.sibeeshpassion.com/azure-content-delivery-network-cdn-a-walk-through/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 28 May 2017 04:47:13 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Azure CDN]]></category>
		<category><![CDATA[Benefits Of CDN]]></category>
		<category><![CDATA[Increase Website Performance With Azure CDN]]></category>
		<category><![CDATA[Why to use CDN]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12387</guid>

					<description><![CDATA[[toc] Introduction This post is going to walk through about Azure Content Delivery Network (CDN). Before we go deep into Azure CDN, it is recommended that you must know What is a CDN and What is the use of a CDN? So let&#8217;s go and try to answer those. What is a CDN In our day to day life, we all open websites many times, how fast you area getting responses from those sites? Some might be loading very fast, others may be slow, have you ever thought why there is such a huge delay in giving response? There are [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>[toc]</p>



<h3 class="wp-block-heading">Introduction</h3>



<p>This post is going to walk through about <a href="http://sibeeshpassion.com/category/Azure" target="_blank" rel="noopener noreferrer">Azure</a> Content Delivery Network (CDN). Before we go deep into Azure CDN, it is recommended that you must know What is a CDN and What is the use of a CDN? So let&#8217;s go and try to answer those.</p>



<h4 class="wp-block-heading">What is a CDN</h4>



<p>In our day to day life, we all open websites many times, how fast you area getting responses from those sites? Some might be loading very fast, others may be slow, have you ever thought why there is such a huge delay in giving response? There are a lot of possible reasons behind it, here we are going to discuss about one reason and a solution that we can do, that is CDN. With the help of a CDN, we can reduce the physical distance between the user and our website server, and we can cache our images and other contents, so that the contents can be serced quickly.</p>



<h4 class="wp-block-heading">What is a Azure CDN</h4>



<p>Azure CDN, caches all the static contents that you have in your website, in different locations. Using a Azure CDN, can reduce the number of riund trips for getting the required contents, hence we get better performance and user experience.</p>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/cdn-overview.png"><img decoding="async" width="640" height="355" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/cdn-overview.png" alt="cdn-overview" class="wp-image-12392" srcset="/wp-content/uploads/2017/05/cdn-overview.png 640w, /wp-content/uploads/2017/05/cdn-overview-300x166.png 300w, /wp-content/uploads/2017/05/cdn-overview-400x222.png 400w" sizes="(max-width: 640px) 100vw, 640px" /></a><figcaption>cdn-overview</figcaption></figure>



<p>Image Courtesy: Microsoft Docs</p>



<p>Advantages of having a Azure CDN are listed below.</p>



<ul class="wp-block-list"><li>Better performance for your apps and services</li><li>Global distributed network</li><li>Highly scalable infrastructure</li><li>Active redundancy and failover</li><li>High reliability</li><li>Robust security</li></ul>



<h3 class="wp-block-heading">Background</h3>



<p>I own a personal website(<a href="http://sibeeshpassion.com/" target="_blank" rel="noopener noreferrer">http://sibeeshpassion.com/</a>) and I wanted to make sure the end users of my site, get a better experience, creating a CDN is the first step towards it. And in this article I am just sharing how a Azure CDN can help in that. I hope you will like this.</p>



<h3 class="wp-block-heading">Creating a Azure CDN</h3>



<p>To create a CDN, you must login to <a href="https://portal.azure.com/" target="_blank" rel="noopener noreferrer">https://portal.azure.com/</a> and then click on the New icon.</p>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Azure-Create-New-Resource.png"><img decoding="async" width="470" height="506" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Azure-Create-New-Resource.png" alt="Azure Create New Resource" class="wp-image-12393" srcset="/wp-content/uploads/2017/05/Azure-Create-New-Resource.png 470w, /wp-content/uploads/2017/05/Azure-Create-New-Resource-279x300.png 279w, /wp-content/uploads/2017/05/Azure-Create-New-Resource-400x431.png 400w" sizes="(max-width: 470px) 100vw, 470px" /></a><figcaption>Azure Create New Resource</figcaption></figure>



<p>Now, search for CDN.</p>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Search-for-CDN-e1495867660307.png"><img decoding="async" width="634" height="261" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Search-for-CDN-e1495867660307.png" alt="Search for CDN" class="wp-image-12394" srcset="/wp-content/uploads/2017/05/Search-for-CDN-e1495867660307.png 634w, /wp-content/uploads/2017/05/Search-for-CDN-e1495867660307-300x124.png 300w, /wp-content/uploads/2017/05/Search-for-CDN-e1495867660307-400x165.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><figcaption>Search for CDN</figcaption></figure>



<p>Our next step is to create the CDN profile, to do so, you must fill the form according to your preferences.</p>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Create-CDN-Profile.png"><img decoding="async" width="172" height="357" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Create-CDN-Profile.png" alt="Create CDN Profile" class="wp-image-12395" srcset="/wp-content/uploads/2017/05/Create-CDN-Profile.png 172w, /wp-content/uploads/2017/05/Create-CDN-Profile-144x300.png 144w, /wp-content/uploads/2017/05/Create-CDN-Profile-289x600.png 289w" sizes="(max-width: 172px) 100vw, 172px" /></a><figcaption>Create CDN Profile</figcaption></figure>



<p>Please be sure that you are checking your price tier and, as per your needs, you can select one. Here I am selecting S1 Standard Verizon.</p>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Choose-the-Pricing-Tier-e1495868644842.png"><img decoding="async" width="306" height="357" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Choose-the-Pricing-Tier-e1495868644842.png" alt="Choose the Pricing Tier" class="wp-image-12396" srcset="/wp-content/uploads/2017/05/Choose-the-Pricing-Tier-e1495868644842.png 306w, /wp-content/uploads/2017/05/Choose-the-Pricing-Tier-e1495868644842-257x300.png 257w, /wp-content/uploads/2017/05/Choose-the-Pricing-Tier-e1495868644842-400x466.png 400w, /wp-content/uploads/2017/05/Choose-the-Pricing-Tier-e1495868644842-515x600.png 515w" sizes="(max-width: 306px) 100vw, 306px" /></a><figcaption>Choose the Pricing Tier</figcaption></figure>



<p>As we have created our CDN Profile, now it is time to create an End Point. Navigate to your CDN profile and click on the End Point.</p>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Endpoint-Option-in-CDN-e1495868879477.png"><img decoding="async" width="634" height="182" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Endpoint-Option-in-CDN-e1495868879477.png" alt="Endpoint Option in CDN" class="wp-image-12397" srcset="/wp-content/uploads/2017/05/Endpoint-Option-in-CDN-e1495868879477.png 634w, /wp-content/uploads/2017/05/Endpoint-Option-in-CDN-e1495868879477-300x86.png 300w, /wp-content/uploads/2017/05/Endpoint-Option-in-CDN-e1495868879477-400x115.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><figcaption>Endpoint Option in CDN</figcaption></figure>



<p>You must add the required data in the upcoming Add and end point form. Here, the name is the name of your CDN end point, that will be created as <em>.azureedge.net</em>.</p>



<p>Once you are finished, you can see that your CDN end point is in running.</p>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/CDN-Endpoint-Running-e1495869358444.png"><img decoding="async" width="634" height="118" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/CDN-Endpoint-Running-e1495869358444.png" alt="CDN Endpoint Running" class="wp-image-12398" srcset="/wp-content/uploads/2017/05/CDN-Endpoint-Running-e1495869358444.png 634w, /wp-content/uploads/2017/05/CDN-Endpoint-Running-e1495869358444-300x56.png 300w, /wp-content/uploads/2017/05/CDN-Endpoint-Running-e1495869358444-400x74.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><figcaption>CDN Endpoint Running</figcaption></figure>



<h3 class="wp-block-heading">Creating a Custom Domain</h3>



<p>We have successfully created an Azure CDN, but is that really over? For some people it is, but for others it is not. Let&#8217;s see why? We have an option to add a custom domain for our CDN, that&#8217;s cool right? If you noticed well, we have created a CDN as <a href="https://cdn-sp.azureedge.net" target="_blank" rel="noopener noreferrer">https://cdn-sp.azureedge.net</a> but it would be great we can get one as <a href="https://cdn.sibeeshpassion.com" target="_blank" rel="noopener noreferrer">https://cdn.sibeeshpassion.com</a> right?. So here in this step, we are going to see how we can get a custom domain for our CDN.</p>



<p>To start with, login to your Azure Portal and browse for the CDN profile we have just created and click on the end point to which you want to map your custom domain.</p>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Custom-Domain-Option-in-CDN-e1495870062544.png"><img decoding="async" width="634" height="77" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Custom-Domain-Option-in-CDN-e1495870062544.png" alt="Custom Domain Option in CDN" class="wp-image-12399" srcset="/wp-content/uploads/2017/05/Custom-Domain-Option-in-CDN-e1495870062544.png 634w, /wp-content/uploads/2017/05/Custom-Domain-Option-in-CDN-e1495870062544-300x36.png 300w, /wp-content/uploads/2017/05/Custom-Domain-Option-in-CDN-e1495870062544-400x49.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><figcaption>Custom Domain Option in CDN</figcaption></figure>



<p>Now login to your Domain Registrar&#8217;s website and navigate to DNS records (If you could not find DNS records, search for Domain Name or Name Server Management). Here I am using BigRocks, and the screenshots may be different for other service providers.</p>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Manage-DNS-in-BigRock-e1495870314831.png"><img decoding="async" width="634" height="274" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Manage-DNS-in-BigRock-e1495870314831.png" alt="Manage DNS in BigRock" class="wp-image-12400" srcset="/wp-content/uploads/2017/05/Manage-DNS-in-BigRock-e1495870314831.png 634w, /wp-content/uploads/2017/05/Manage-DNS-in-BigRock-e1495870314831-300x130.png 300w, /wp-content/uploads/2017/05/Manage-DNS-in-BigRock-e1495870314831-400x173.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><figcaption>Manage DNS in BigRock</figcaption></figure>



<p>Navigate to the CNAME creation page, please check in advanced settings if you could not find it in default settings page. And fill the required fields.</p>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/CNAME-Creation-in-DNS-Window-e1495870474351.png"><img decoding="async" width="634" height="266" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/CNAME-Creation-in-DNS-Window-e1495870474351.png" alt="CNAME Creation in DNS Window" class="wp-image-12401" srcset="/wp-content/uploads/2017/05/CNAME-Creation-in-DNS-Window-e1495870474351.png 634w, /wp-content/uploads/2017/05/CNAME-Creation-in-DNS-Window-e1495870474351-300x126.png 300w, /wp-content/uploads/2017/05/CNAME-Creation-in-DNS-Window-e1495870474351-400x168.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><figcaption>CNAME Creation in DNS Window</figcaption></figure>



<p>Now, go back to azure portal, and give the custom domain name, we created in the DNS management settings(cdn.sibeeshpassion.com), in the Add a custom domain form.</p>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Adding-Custom-Hostname.png"><img decoding="async" width="164" height="357" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Adding-Custom-Hostname.png" alt="Adding Custom Hostname" class="wp-image-12402" srcset="/wp-content/uploads/2017/05/Adding-Custom-Hostname.png 164w, /wp-content/uploads/2017/05/Adding-Custom-Hostname-138x300.png 138w, /wp-content/uploads/2017/05/Adding-Custom-Hostname-275x600.png 275w" sizes="(max-width: 164px) 100vw, 164px" /></a><figcaption>Adding Custom Hostname</figcaption></figure>



<p>Click Add. If everything goes fine, you should be able to enable the custom domain and the process will get started. The process includes the following tasks.</p>



<ul class="wp-block-list"><li> Submitting request </li><li> Domain validation </li><li> Certificate provisioning </li><li> Complete </li></ul>



<p>The domain validation will be automatically done if you had added a CNAME in your host provider DNS configuration which points to your CDN host name. If not, you will get a mail (The mail id in the WHOIS database), please wait for it.</p>



<p>In the certificate provisioning task, you can either have your own certificate in the Azure Key Valut and use it, or an auto generated one from Azure. The process may take up to 6 hours, yes it is quite a lot of time. </p>



<p>If everything goes well, the process will be completed, and you can see it in your custom domain overview. </p>



<figure class="wp-block-image"><img decoding="async" width="649" height="75" src="https://sibeeshpassion.com/wp-content/uploads/2019/06/Certificate-Deployed-Azure-CDN.png" alt="" class="wp-image-13736" srcset="/wp-content/uploads/2019/06/Certificate-Deployed-Azure-CDN.png 649w, /wp-content/uploads/2019/06/Certificate-Deployed-Azure-CDN-300x35.png 300w, /wp-content/uploads/2019/06/Certificate-Deployed-Azure-CDN-425x49.png 425w" sizes="(max-width: 649px) 100vw, 649px" /><figcaption>Certificate Deployed</figcaption></figure>



<p>You can see the complete status when you click on your custom domain.</p>



<figure class="wp-block-image"><img decoding="async" width="650" height="683" src="https://sibeeshpassion.com/wp-content/uploads/2019/06/Azure-CDN-Custom-Doman-Overview.png" alt="" class="wp-image-13737" srcset="/wp-content/uploads/2019/06/Azure-CDN-Custom-Doman-Overview.png 650w, /wp-content/uploads/2019/06/Azure-CDN-Custom-Doman-Overview-286x300.png 286w, /wp-content/uploads/2019/06/Azure-CDN-Custom-Doman-Overview-425x447.png 425w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>Azure CDN Custom Domian Overview</figcaption></figure>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Success-Notification-Custom-Domain-CDN.png"><img decoding="async" width="525" height="225" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Success-Notification-Custom-Domain-CDN.png" alt="Success Notification Custom Domain CDN" class="wp-image-12403" srcset="/wp-content/uploads/2017/05/Success-Notification-Custom-Domain-CDN.png 525w, /wp-content/uploads/2017/05/Success-Notification-Custom-Domain-CDN-300x129.png 300w, /wp-content/uploads/2017/05/Success-Notification-Custom-Domain-CDN-400x171.png 400w" sizes="(max-width: 525px) 100vw, 525px" /></a><figcaption>Success Notification Custom Domain CDN</figcaption></figure>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Please be noted that, the verification process may take few minutes or hours. If you are sure that the CNAME configuration is correct, please wait some more time and check if you are getting any error.</p></blockquote>



<h3 class="wp-block-heading">Update to Premium</h3>



<p>I recently changed my Azure CDN to premium, which offers wide variety of services. You can compare the features <a href="https://docs.microsoft.com/en-us/azure/cdn/cdn-features">here</a>. The premium gives you a separate portal to manage your CDN,  https://cdn.windowsazure.com. You can see some of the features in the preceding image.</p>



<figure class="wp-block-image"><img decoding="async" width="255" height="516" src="https://sibeeshpassion.com/wp-content/uploads/2019/06/Azure-CDN-Premium-Features.png" alt="" class="wp-image-13738" srcset="/wp-content/uploads/2019/06/Azure-CDN-Premium-Features.png 255w, /wp-content/uploads/2019/06/Azure-CDN-Premium-Features-148x300.png 148w" sizes="(max-width: 255px) 100vw, 255px" /><figcaption>Azure CDN Premium Features</figcaption></figure>



<p>That&#8217;s all for today, I will come with another article which explore Azure CDN more. Till then, bye.</p>



<h3 class="wp-block-heading">Conclusion</h3>



<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>



<h3 class="wp-block-heading">Your turn. What do you think?</h3>



<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>



<p>Kindest Regards<br>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/azure-content-delivery-network-cdn-a-walk-through/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Fix for 404 ResourceNotFound Error After Uploading to Azure Container</title>
		<link>https://www.sibeeshpassion.com/fix-for-404-resourcenotfound-error-after-uploading-to-azure-container/</link>
					<comments>https://www.sibeeshpassion.com/fix-for-404-resourcenotfound-error-after-uploading-to-azure-container/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sat, 27 May 2017 09:18:15 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Azure 404 Error]]></category>
		<category><![CDATA[Azure Container]]></category>
		<category><![CDATA[Azure ResourceNotFound]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12406</guid>

					<description><![CDATA[[toc] Introduction Here, in this post we are going to a see how we can resolve the error 404 ResourceNotFound Error After Uploading to Azure CDN . It is obvious that you may feel very sad, if you are unable to see the image you recently uploaded to Azure container. But, you don&#8217;t need to worry about it, as the fix for this error is very simple and in this post I am going to show you that. I hope you will like this. Now let&#8217;s begin. Background I recently created a new container in my Azure storage account and [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>Here, in this post we are going to a see how we can resolve the error 404 <em>ResourceNotFound Error After Uploading to Azure CDN </em>. It is obvious that you may feel very sad, if you are unable to see the image you recently uploaded to <a href="http://sibeeshpassion.com/category/Azure" target="_blank">Azure </a>container. But, you don&#8217;t need to worry about it, as the fix for this error is very simple and in this post I am going to show you that. I hope you will like this. Now let&#8217;s begin.</p>
<h3>Background</h3>
<p>I recently created a new container in my Azure storage account and uploaded one image in it. And when I was just opening that image in my browser, I was just getting an error as preceding.</p>
<p>[xml]<br />
This XML file does not appear to have any style information associated with it. The document tree is shown below.<br />
<Error><br />
<Code>ResourceNotFound</Code><br />
<Message><br />
The specified resource does not exist. RequestId:36bdbcfb-0001-0022-44c6-d60b93000000 Time:2017-05-27T08:55:09.8382429Z<br />
</Message><br />
</Error><br />
[/xml]</p>
<p>I was able to download that image and the problem exists only when I open it in the browser. Then I came to know about the Access policy of Azure containers. Here we are going to see a bit introduction about that policy. </p>
<h3>Solution for Azure 404 Error</h3>
<p>Step 1: Login to your Azure Portal and navigate to your container.<br />
Step 2: Now, click on the three dots (&#8230;) and then Access Policy.<br />
Step 3: Select the access type you prefer.</p>
<p><div id="attachment_12408" style="width: 603px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Option-to-see-Azure-Container-Policy.png"><img decoding="async" aria-describedby="caption-attachment-12408" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Option-to-see-Azure-Container-Policy.png" alt="Option to see Azure Container Policy" width="593" height="210" class="size-full wp-image-12408" srcset="/wp-content/uploads/2017/05/Option-to-see-Azure-Container-Policy.png 593w, /wp-content/uploads/2017/05/Option-to-see-Azure-Container-Policy-300x106.png 300w, /wp-content/uploads/2017/05/Option-to-see-Azure-Container-Policy-400x142.png 400w" sizes="(max-width: 593px) 100vw, 593px" /></a><p id="caption-attachment-12408" class="wp-caption-text">Option to see Azure Container Policy</p></div></p>
<p>According to Microsoft, Access Policy specifies whether data in the container may be accessed publicly. By default, container data is private to the account owner. Use &#8216;Blob&#8217; to allow public read access for blobs. Use &#8216;Container&#8217; to allow public read and list access to the entire container.</p>
<p>So here I am going to give the policy as Blob.</p>
<p><div id="attachment_12409" style="width: 553px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Change-the-Azure-Access-Policy-to-Blob.png"><img decoding="async" aria-describedby="caption-attachment-12409" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Change-the-Azure-Access-Policy-to-Blob.png" alt="Change the Azure Access Policy to Blob" width="543" height="214" class="size-full wp-image-12409" srcset="/wp-content/uploads/2017/05/Change-the-Azure-Access-Policy-to-Blob.png 543w, /wp-content/uploads/2017/05/Change-the-Azure-Access-Policy-to-Blob-300x118.png 300w, /wp-content/uploads/2017/05/Change-the-Azure-Access-Policy-to-Blob-400x158.png 400w" sizes="(max-width: 543px) 100vw, 543px" /></a><p id="caption-attachment-12409" class="wp-caption-text">Change the Azure Access Policy to Blob</p></div></p>
<p>You can always do this with some C# code as well.</p>
<p>[csharp]<br />
public static void SetPublicContainerPermissions(CloudBlobContainer container)<br />
{<br />
    BlobContainerPermissions perm = container.GetPermissions();<br />
    perm.PublicAccess = BlobContainerPublicAccessType.Blob;<br />
    container.SetPermissions(perm);<br />
}<br />
[/csharp]</p>
<p>Here is the above example, we are accessing the permissions and assigning the Blob access type. You can always use &#8216;Container&#8217; if you want to limit the access to container. In any case, if you need to remove the permission to anonymous users, you can use <em>BlobContainerPublicAccessType.Off</em>. Once you are done, please reload the URL again the browser, I am sure you will be able to see your image. Happy Uploading!.</p>
<h3>Conclusion</h3>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h3>Your turn. What do you think?</h3>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/fix-for-404-resourcenotfound-error-after-uploading-to-azure-container/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Do You Know A Wow Game Is Already Installed In Your Android Phone?</title>
		<link>https://www.sibeeshpassion.com/do-you-know-a-wow-game-is-already-installed-in-your-android-phone/</link>
					<comments>https://www.sibeeshpassion.com/do-you-know-a-wow-game-is-already-installed-in-your-android-phone/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 06 Apr 2017 13:06:49 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Android Mobile. Things you don't know in your Android phone]]></category>
		<category><![CDATA[Android OS]]></category>
		<category><![CDATA[Android Tips]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12173</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/do-you-know-a-wow-game-is-already-installed-in-your-android-phone/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>New Debugging Features In Visual Studio 2017</title>
		<link>https://www.sibeeshpassion.com/new-debugging-features-in-visual-studio-2017/</link>
					<comments>https://www.sibeeshpassion.com/new-debugging-features-in-visual-studio-2017/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 27 Mar 2017 15:10:52 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Visual Studio 2017]]></category>
		<category><![CDATA[New debugging features in VS2017]]></category>
		<category><![CDATA[Visual Studio Debugging Options]]></category>
		<category><![CDATA[VS2017]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12160</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/new-debugging-features-in-visual-studio-2017/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Understand the Internal Structure of SQL Database File</title>
		<link>https://www.sibeeshpassion.com/understand-the-internal-structure-of-sql-database-file/</link>
					<comments>https://www.sibeeshpassion.com/understand-the-internal-structure-of-sql-database-file/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andrew Jackson]]></dc:creator>
		<pubDate>Thu, 23 Mar 2017 15:55:59 +0000</pubDate>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Database File]]></category>
		<category><![CDATA[SQL Internal Structure]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12149</guid>

					<description><![CDATA[You must have thought how to store data in SQL Server? SQL Server is the platform, which provides a proper management of database. There is no doubt that it follows a strategy for the storage of all the files. All the users of SQL are aware with the fact that database objects are stored in MDF file. MDF files are responsible for the management of data in SQL Server. Therefore, in this article, we will learn the storage system of data in SQL Server data files. Database Files and its Storage Structure in SQL Server Database in SQL Server has [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>You must have thought how to store data in SQL Server? SQL Server is the platform, which provides a proper management of database. There is no doubt that it follows a strategy for the storage of all the files. All the users of SQL are aware with the fact that database objects are stored in MDF file. MDF files are responsible for the management of data in SQL Server. Therefore, in this article, we will learn the storage system of data in SQL Server data files.</p>
<h2>Database Files and its Storage Structure in SQL Server</h2>
<p>Database in SQL Server has two operating system files:</p>
<ul>
<li>Data Files</li>
<li>Log File</li>
</ul>
<p><strong>Data Files</strong></p>
<p>A data file consists of objects and data. Depending upon the needs, data files can be divided into two types: </p>
<p><strong>Primary Database File</strong></p>
<p>Each database has one primary data file. All the tables, database objects, indexes and views are stored in that file. The file extension of primary database file is .mdf. </p>
<p><strong>Secondary Database File</strong></p>
<p>This type is used at the time of exceeding the maximum allocated size for an individual file on Windows. It helps the database to increase in size. File extension for this file is .ndf.</p>
<p><strong>Log File</strong></p>
<p>Whenever users want to recover whole of the database in SQL Server, they require certain information, which are inside a log file. For one database there will be one log file and transactions of database are written on it even before to the data file. The file extension used by it is .ldf. LDF stands for Transactional Log file.</p>
<p><strong>Inner Structure of Data File</strong></p>
<p>Each database has its space to store the data, which is divided into different pages that are numbered from 0 to N. During the expansion of database files from its default size, those pages which are created newly are numbered from the last highest page number plus 1. In the similar way, at the time of shrinking of files it eliminates pages in decreasing order, which in the same manner starts from the highest page number. The basic unit of I/O for SQL Server operations is a page and each page is of 8 KB. A data file is a large array of pages. SQL Server stores different data with the help of multiple pages, Some of them are GAM, Index, IAM, Data, SGAM, and TextMix.</p>
<p><strong>Page Addressing:</strong></p>
<p>Now, if we analyze the pages addressing then we can see that every page in SQL Server is of equal size that is 8192 bytes. Each page has its own address, which is unique. It is a part of single database file. The ID of the file makes the first part of the unique address. Pages are numbered starting from 0. This is the mentioned format in which page address is written:</p>
<p> <strong>file number</strong>  :  <strong>page number</strong> </p>
<p>Data page is very essential among the page types. This is used for the storage of records to a database. </p>
<p>Structure of Data Page:</p>
<p>A data page contains three sections.</p>
<ul>
<li>Page Header</li>
<li>Page Body</li>
<li>Slot Array or Row offset</li>
</ul>
<p><strong>Page Header (0-95 bytes)</strong></p>
<p>The first 96 bytes of a particular page is known as page header, which consists of the information of the page.</p>
<p>That is, Page ID, No of records in that page and IDs of previous/next pages.</p>
<p><strong>Page Body</strong></p>
<p>It is that part where actual data is stored. It is followed by the free space and slot array. </p>
<p><strong>Slot Array</strong></p>
<p>Slot array, also known as off-set array, is an array of two-byte values, which is read by the SQL Server in reverse i.e. from the very end of the page. Slot array keep slot points to a byte in the page wherever a record begins. First slot of the record slot array is saved in the last two bytes of the page that points to the page of the first record saved at the page. </p>
<p><strong>Conclusion</strong></p>
<p>One of the essential things that should be kept in mind is that, In SQL Server, the database file (.mdf) store its data as per 8 kb pages and it is important for SQL Server to sustain the sequence of data pages as per their header information. In case of mismatching of information or the data is not stored in sequential order into data pages, there is possibility in the corruption of database or you may face <a href="http://www.sqlrecoverytool.com/fix-ms-sql-server-error-5172.html" target="_blank">SQL database error like 5172</a>, which is a header corruption error.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/understand-the-internal-structure-of-sql-database-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
