Friday, July 19, 2019




Azure DevOps – New Era – Create New Build Pipeline


Ref : microsoft.com

In my Previous article I shared about “how to start with AzureDevOps and how to create new organization”. https://www.dotnetpiper.com/2019/07/azure-devops-new-era.html AZURE DEVOPS – A NEW ERA Here in this we will proceed further where we left and will create New Build pipeline with the impressive User interface.
Here I have a small application which has the following structure shown below as screen shot app-structure



I have already placed in Azure GitHub , To push your code from VS code you can refer this url :
I’m assume so far you would have pushed your code there and we are ready to go.
Create a new project and follow the following steps
Step1: Refer image create-project-first ,create-project-two and create-project-success








Go to pipeline -> Builds-> New Pipeline and click . refer an image new-pipeline



As soon as you create new pipeline it reaches to the windows from there you would be able to select the classic editor as shown below in screen shot:
So choose Use the classic editor to create a pipeline without YAML.


After completing this you will reach on the page where you will have to select code repository
These repository are as follows:
  1. ·         Azure Repose Git
  2. ·         GitHub
  3. ·         GitHub Enterprise Server
  4. ·         Subversion
  5. ·         Bitbucket Cloud
  6. ·         Other Git

For my purpose I’ve selected Azure Repos Git , which we have already created above.
Kindly refer a screen shot for reference and click on Continue. Refer image Azure-repose-git

 

As soon as you go with above steps it takes you on the page where you have to choose one of the templates which you can consider as ‘Configuration as Code’. For my purpose I will select Empty job as shown top right of screen. Refer image Empty-job



After selecting Empty Job you will be redirecting to next level ,where you should be able to see the Pipeline details as well as Agent Job details on the right side of screen. The entire screen will be divided into two parts.

Kindly fill the desire details like Display Name and AgentPools . Agent Pools is defined as follows
When you queue a build, it executes on an agent from the selected pool. You can select a Microsoft-hosted pool, or a self-hosted pool that you manage.

To reach up to this level you have to click on the (+) icon right to the Agent Job 1 and you will get the screen just on the right side.

Step 1: Firstly, click on the (+) icon to proceed , As soon as you click on the + icon you will have a window appears on the right side . Search for “Copy Files” from and fill the required details. Please follow the screen shots Copy-Files.jpg



Once you select this please fill the essentials details in the page appears. Kindly follow the upcoming screen shots copy-files and target-folder







Target folder is the place where we keep our code base at pipeline level and further we will use this for publishing it.
NOTE: You can understand this in such a way that the local path on the agent where any artifacts(e.g. layman) are copied to before being pushed to their destination. For example: c:\agent_work\1\a 

A typical way to use this folder is to publish your build artifacts with the 
Copy files and Publish build artifacts tasks. Reference Microsoft

Note: This directory is purged before each new build, so you don't have to clean it up yourself.
Step2:
Click on the (+) button next to  Agent Job 1  and choose the publish build artifact. At this level we have to give the path of the folder which we want to publish. As we remember in last step we copied the artifacts in : $(Build.ArtifactStagingDirectory). The same folder  or file path to publish. This can be a fully-qualified path or a path relative to the root of the repository. Wildcards are not supported. Variables  are supported. Example: $(Build.ArtifactStagingDirectory).

There are 4 properties which we will consider in our scenario .

1.     1. Display name :  Name can be anything as per your choice like Publish Artifact: drop
2. Path to publish : The folder or file path to publish. This can be a fully-qualified path or a path relative to the root of the        repository
3.  Artifact name: The name of the artifact to create in the publish location.
4.  Artifact publish location : Choose whether to store the artifact in Azure Pipelines, or to copy it to a file share that must be accessible from the build agent.


Refer and image publish-artifact as shown below:




Step3: Click on the (+) button next to  Agent Job 1  and choose the publish build artifact. Here we will be managing ARM templates for CI-CD pipeline because we are creating resources with help of ARM templates or azure automation . Fill the required details on the page .Please refer an image arm-templates-publish-build-artifacts as shown below:



If you notice, Templates folder is there  in “path to publish”  property. You can get that after clicking on the “…” button right to this. Once you click on this it prompts you a pop-up to choose the path for templates from azure repos as shown in image arm-templates-files. This is mush needed to create our resources on the fly, we will be utilizing this in azure release pipeline further.



Note: I’ll write a separate article on Azure templates also.

Once you are done with all above required steps than choose save & queue option from dropdown 

appears top in the tabs section , as you save , it triggers the build .Kindly find one of the screeb=n shot as 
depicted in image save-and-queue .



You can also trigger it manually from the user interface from the Build pipeline once you have saved your pipeline .There should be a QUEUE button on top right corner , click on Queue button window should appear to run the pipeline . Choose Hosted VS 2017 and choose branch we desire to build against. Once it is completed you should be able to see the green tick mark on the right side.
 Refer build-pipeline image show below:






Thursday, July 18, 2019

Azure DevOps – A New Era


Azure DevOps – A New Era

Azure DevOps : A very well know VSTS Visual Studio Team Services has become Azure DevOps with new features , icons ,Repos and Test plans along with plenty of rich feature an excerpt from Microsoft Site as shown below:


The single service that was Visual Studio Team Services (VSTS) is now becoming a new set of Azure DevOps services. Throughout our documentation and websites, and in the product, you'll start to notice new icons and names for Azure DevOps and each of the services within it:
·         Azure Pipelines to continuously build, test, and deploy to any platform and cloud.
·         Azure Boards for powerful work management.
·         Azure Artifacts for Maven, npm, and NuGet package feeds.
·         Azure Repos for unlimited cloud-hosted private Git repos.
·         Azure Test Plans for planned and exploratory testing.
Now a days I’m exploring Azure Devops and will share enough practical based articles and blogs pertinent to Azure PaaS e.g. Azure Devops and Azure CDN etc.
In this article will share you about the how does it look like and how can you explore this.
Step1. Copy and paste the following url https://dev.azure.com, it will open the screen to ask for your credentials .
The following screen (img1)  will appear if you open it for the first time as depicted below:


You can choose either to go with start free or sign in to Azure Devops ,I have my own account to I’m ready to go. Azure devops provides some out-of-ox feature which you can implement as shown below in screen shot (img2) as well.



You can also visit this link for more in depth details about Azure DevOps. https://azure.microsoft.com/en-in/blog/introducing-azure-devops/
Step2:  Once you have logged in AzureDevOps site, it should be look like this though I’ve already created few of my projects as shown below in screen shot(img3).




Prerequisites”

 

To create a new project you should have new organization

·         You must have an organization created in Azure DevOps. If you don't have one, do that now.
·         As an organization owner, you can create projects. If you're not the owner, then you must be a member of the Project Collection Administrators Group or have your Create new projects permission set to Allow.


Kindly refer an image above and find (+New Organization) button at marked yellow must be at bottom left on screen. As soon as you click on “New Organization” button the following screens will appear . Please accept terms and conditions and proceed further.Img4

Img5 :
 
Once you are done with creating your organization than you will be eligible to create new project. Refer img6 as shown below:



To achieve this you can also go to home page and click on the create project button at top right corner of the screen, as soon as you click on that it appears with the following screen which you have to fill to proceed further. Refer img 7.


Once you are done with this , you are good to go and will see the detailed information on the screen. Reference AzureDevOps
Select one of the following tasks to get started:
·         Invite to begin adding others to your project. Note, if this is your first project, then you must first invite users to your organization.
·         Boards to begin adding work items.
·         Repos to open Repos>Files page where you can clone or import a repository, or initialize a README file for your project summary page.
·         Pipelines to start defining a pipeline.
·         Test Plans to start defining test plans and test suites.
·         Manage your services to disable the visibility of one or more services.




After this you can have a glimpse of each section to get familiar with this. In the next article I will be exchanging my learning about to create Build Pipeline for Azure CDN in AzureDevOps and will follow with Release pipeline and other pertinent stuff.

Stay Tuned : #AzureDevOps

Wednesday, July 3, 2019

Push code to azure repos using vs code

Push code to azure repos using vs code
While creating and pushing code to azure repo in Azure devops , for the first time I have to push code







>git init
>git add .
>git commit -am "Add function app"
>git remote add origin
https://sachinkalia@dev.azure.com/sachinkalia/AzureCDN/_git/AzureCDN
> git push -u origin --all
Note : In case if you confront an error “Fatal : Remote origin already exists.” while pushing code to Azure Repos
please use this command before “add origin” git remote rm  origin

Please refer below images for references





















After pushing code to Azure devops ,Jump to Repos in order to see the content you pushed. Please refer below image for reference.






Hope it will help you sometime while start work with Azure DevOps :)



Push code to azure repos using vs code

While creating and pushing code to azure repo in Azure devops , for the first time I have to push code

>git init
>git add .

>git commit -am "Add function app"
>git remote add origin
https://sachinkalia@dev.azure.com/sachinkalia/AzureCDN/_git/AzureCDN
> git push -u origin –all

Note : In case if you confront an error “Fatal : Remote origin already exists.” while pushing code to Azure Repos

please use this command before “add origin” git remote rm  origin

Please refer below images for references

Friday, May 24, 2019

Session about Azure Search and Azure Storage

Session about Azure Search

1. Azure Search
2. Azure Search Models.
3. Use different data Sources
4. Create Index
5. Upload Data using C# SDK
6. Usage of ARM Portal to upload data
7. New Features in C#8.0

Image

Image

Sunday, March 10, 2019

To Run Docker base application on specific IP Address

Image result for docker image

While exploring Docker with .net Core , I confronted various issues later I sorted them one by one.

One of them was after creating images and container it was not hosting on localhost , it troubled me a lot and finally i found a solution for this which I'm sharing through this post.

Step1:

List all the running docker containers

docker container ls
  docker ps -a
  docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" 7d13c58d6311

docker ps –a

Step2. After getting list of running container and you should be able to see WebServer with respect to each container running.webserver is nothing just a container ID in simple words.Here depicted below is a list of running container on my workstation:


Kindly use the below command in order to find the specific ip. I’ve used one of the containerId and in order to get IP on which an application might be host.docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" 7d13c58d6311

Response: 192.168.172.121

Just open any browser and paste the following URl in that or use the following command to run it in Internet Edge browser

start microsoft-edge:http://192.168.172.121



Some Valuable Commands:


docker build -tag dotnetpiper .
docker image ls
docker run -d -p 8080:8080 dotnetpiper:latest
docker run --name sampleCon -p 8080:8080 dotnetpiper:latest

docker container ls
docker ps -a
docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" 4345811895a7
192.168.165.6


  start microsoft-edge:http://192.168.172.121

Monday, October 22, 2018

Azure Blob Storage Tiers

Azure Blob Storage Tiers

Image result for azure

There are few points which you should remember while developing or managing Azure Storage pertinent to Tier for data access.


Azure Hot Storage  Tier ----> It uses for fast retrieval of data or lowest data retrieval cost and lowest data access cost though higher data storage cost involve.

Azure Cool Storage  Tier ---> Higher in data retrieval cost while lower in data storage cost.

Azure Archive Storage  Tier  ---> Highest data retrieval cost while Lowest data storage cost .


Kindly consider all above points while you are about to choose Storage Tier’s in Azure


Warm Regards

Sachin Kalia

Saturday, October 13, 2018

WINDOWS POWERSHELL COMMANDS

WINDOWS POWERSHELL COMMANDS

Open your power shell from command prompt as a administrator.

Point to remember : Declare any variable with $y in PowerShell


C:\WINDOWS\system32>$array ="India","Japan","Aus","US","UK"

C:\WINDOWS\system32> $array

It will list an array


PS C:\WINDOWS\system32> $array[2]

It gives value on index 2 , which is AUS in our case.


image

$array=("India","Asia"),("Japan","Asia"),("AUstralia","Australia"),("UK","EUROPE"),("US","North America”)

PS C:\WINDOWS\system32> $array

PS C:\WINDOWS\system32> $array[0][1]
Asia
PS C:\WINDOWS\system32> $array[1][1]
Asia
PS C:\WINDOWS\system32> $array[1][0]


======================================

Some mathematical commands show below:

PS C:\WINDOWS\system32> $y=get-service
PS C:\WINDOWS\system32> $y.count
292
PS C:\WINDOWS\system32> [math]::sqrt("9")
3
PS C:\WINDOWS\system32> $x="192.78788"
PS C:\WINDOWS\system32> [math]::round($x,2)
192.79








4. To update the value of an index in array as shown below:

PS C:\WINDOWS\system32> $array[1][0]="Singapore"
PS C:\WINDOWS\system32> $array[1][0]



5. To change the variable case in upper and lower use the following command


PS C:\WINDOWS\system32> $x="The quick brown fox jumps right over the lazy little dogs"
PS C:\WINDOWS\system32> $x.ToUpper()
THE QUICK BROWN FOX JUMPS RIGHT OVER THE LAZY LITTLE DOGS
PS C:\WINDOWS\system32> $x.TOLOWER()

Output
the quick brown fox jumps right over the lazy little dogs


6. To replace any word


PS C:\WINDOWS\system32> $x.replace("The","That")
That quick brown fox jumps right over the lazy little dogs



7. To Get complete service object in a variable

Declare any variable with $y in PowerShell

PS C:\WINDOWS\system32> $y=get-service
PS C:\WINDOWS\system32> $y.count
Output : 292

Wednesday, October 10, 2018

Conducted and Executed Azure session in Noida today Some Glimpse Conversation following topics
Image result for azure images
  • Azure
    ARM Portal (Azure Resource Manager)
    Azure Service Model
    ARM Portal Deep Dive
    Platform As A Service(PaaS)
    Hosting .Net WEBAPI Application
    Application Insights
    Application Insights Telemetry
    Live Streaming of execution
    Logic Apps as WebHook
    Logic apps integration with Skype/Slack for notification
    Create Logic apps for Twitter Integration with Slack(AI Usage)
    Stay in Cloud








10 OCT 2018

@Azure @ARM @LogicApps

Sunday, October 7, 2018

POWER SHELL COMMANDS

POwer SHELL COMMANDS

get-help workerrole
get-help webrole
get-help *content*
get-help storage
get-command *event
get-eventlog system
get-eventlog system -newest 10 // to get latest 10 log
 
get-eventlog system -newest 10 | where {$_.instanceid -eq 129} // To get the specific event
 
get-eventlog system -newest 10 | where {$_.instanceid -lt 1219} // to get all events less than event id 129
  
get-service | export-csv -path E:\Service.csv -- to export all services to E drive through command 
import-csv E:\Service.csv

TO Export all process in xml format :

get-process | export-clixml -path  e:\training.xml
TO Export all process in txt format :
get-process | out-file -filepath  e:\training.txt
To open in notepad :
invoke-item  e:\training.txt

To get all service in html format:

get-service | convertto-html

get-service | convertto-html | set-content E:\xyz.xml

To retrieve only two columns from Services:

get-service | convertto-html -property name,status


List of service starts with character “S”

get-service s*

To get process which has id less than 100
get-process | where id -lt 100

To Get service which are running using where clause in powershell:

get-service | where {$_.status -eq "running"}
get-service | where {$_.status -eq "stopped"}

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({
          google_ad_client: "ca-pub-3599209542351256",
          enable_page_level_ads: true
     });
</script>