Showing posts with label Azure Cloud. Show all posts
Showing posts with label Azure Cloud. Show all posts

Sunday, June 7, 2020


Create Build Pipeline using YAML in Azure DevOps

This video covers the followings:


1. Explanation of Dot Net Core and Cosmos DB integration
2. Explanation of YAML file
3. Create build pipeline in Azure DevOps

#Azure #AzureDevOps #YAML #CosmosDB #NetCore


Reach for more Video's click here :

Thursday, March 26, 2020


 Enable performance counter for Log analytics and execute KUSTO Query

 

This article states you about how can you execute log analytics query or KUSTO query over log analytics workspace. A KUSTO query is combination of SQL,PowerShell and bash and becomes KQL (Kusto query language).
Prior to this please go through to this which is about how to create log analytics workspace.




Pre-requisite

The following must be present for this solution:
1.     You should have Log analytics workspace already configured in your Azure subscription.

Log analytics workspace

Once you are done with creation of LAW, go to that and find an option logs on t eleft side of the panel as you can see in an image LA.jpg below marked as RED


There I’ve executed a query which is describes about list the number of computers sending logs, each hour. For that purpose I selected a table named HeartBeat which contains a potential information about the virtual machine connected to Log analytics workspace aka LAW


Go to Data -> Windows Performance Counter -> Add the selected performance counter
And click on that. As soon as you click all those counter will be enable and will start sending telemetry to log analytics workspace on which you can query and get virtual machine performace information. Refer enable-counter.jpg




Once performance counter got enabled , it starts sending those information to Log Analytics workspace.

NOTE: If you don’t get any records while you execute query on PERF table than restart MMA agent persists on virtual machine or disconnect/connect from virtual machine option visible in Log Analytics Workspace.

You can easily see the performance of a virtual machine connected to Log analytics workspace aka LAW. For that select PERF table .


Another set of query is for Usage and rendering it in piechart. You can render it in table , scatterchart and with few more option

// Usage by data types
// Chart the amount of logs reported for each data type, today
Usage
| summarize count_per_type=count() by DataType
| sort by count_per_type desc
| render piechart

In an image below you should be able to understand how does it works in real use case.

KUSTO keywords in use

Refer an image below kusto-query-piechart.jpg below for the output in piechart.




NOTE:  Following query fetches information about "%committed bytes in use"  (in case of windows OS) for Linux base machine counter name will be "% Used Memory".
After executing the below query I get 3 rows as a result because If you remember I’ve enable performance counter for windows computer. Refer screen shot enable-counter.jpg



Perf
| where TimeGenerated > ago(30m)
| where  CounterName == "% Committed Bytes In Use"
| project TimeGenerated, CounterName, CounterValue, Computer 
| summarize UsedMemory = avg(CounterValue) by CounterName, bin(TimeGenerated, 10m), Computer
| where UsedMemory > 0
| render timechart

Refer an image result.jpg below

 

I hope it helps you a bit to understand how can we run KUSTO on LOG analytics workspace.


Tuesday, October 8, 2019

Create and Share Metrics Dashboard in Azure


Create and Share Metrics Dashboard in Azure

Image result for azure metrics icon

You can create & share Azure Portal dashboard to other users or group with having access to the same Azure Subscription. Azure allows you to create  your required dashboards such as metrics for azure service & Azure service health dashboard, or any other Azure services monitoring dashboard , so that we could keep track of what is happening in our services . you can share dashboard with other in case they need same. In this post let’s have a quick look at how we can share a dashboard and give necessary access to users.
Create Azure Portal Dashboard
To understand how can we create a new, private dashboard and assign a name. Follow these steps to get started:
1.    Sign in to the Azure portal.
2.    Select Dashboard from the upper section of the left sidebar. Your default view might already be set to dashboard.
3.    Select + New dashboard.


For my demo I have AppService which is up and running and here I’ll be creating a dashboard to monitor an AppService running status.

Kindly go to AppService and find “metrics” there as depicted in given below screenshot app-metrics




From the metric dropdown I have selected CPU runtime to see the CPU utilization of an application and click on pin to dashboard.
Once you click on “Pin to dashboard”  there will be an another option “select another dashboard” to pin it. As shown in below screen shot select-another-dashboard.


 Once you click on that a new window will appear on the right , fill the required details to create new dashboard within the subscription , you can choose another subscription as per your need and click apply. After few seconds dashboard will have created and a link will be there at bottom of screen to jump directly to dashboard
Refer a screen shot depicted below : create-new-dashboard.





After clicking on Monitor AppService , it will open the dashboard ,where you should be able to see the CPU metrics board, point to notice is it has shared already once you create that, you will be able to see the Unshare button on top of the screen.  as shown in image below : unshare-dashboard


The same way you can create few more metrics into existing dashboard.
You can also see all dashboard from the search as well by typing shared dashboard ,it will show you each shared dashboard within subscription.
Refer- shared-dashboard



I wish it will help you to create Shared Dashboard, in coming Article will explain you how can we place RBAC policy on dashboard.


Saturday, August 3, 2019



Azure App Insights – Write Test case for AppService Availability





To check you AppService availability is potential when your application is in production and being use by plenty of end users. To write test case in .Net, Java or in other programming language is possible using Nunit ,Junit ,Jasmine and others.
I was astonished with this testing feature, So thought to explore something about it. Yeahh That’s true so lets write Test case in Azure .Trust me it gonna be fun.
I’m utilizing .Net Core based application along with Azure Cosmos DB.



Prerequisites : You should have basic understanding of .Net Core .
Application Insights should be configured for an application like WebApp/AppService
Once you are done, You can should see few resources created within Azure portal as shown in image rg-in-azure



Once you have published an application ,Click on Application Insights (e.g. CosmosDBInsights).After clicking on this it opens AppInsights refer an image shown below application-insights


IN the left pane you should be able to see Availability option till date 3Aug 2019 ,Click on that
After clicking of availability you will see the following screen in order to create you Test to verify an availability of the specific endpoint. Refer image add-test




After clicking on AddTest , A new window will appear on the right side to fill the all necessary details like


  1. TestName,
  2. Test Type
  3.  Specify the URL to test in that,
  4.  Parse dependent request which states “When enabled, the test requests images, scripts, style files, and other files that are part of the web page under test. The recorded response time includes the time taken to get these files. The test fails if all these resources cannot be successfully downloaded within the timeout for the whole test. If this option is not enabled, the test only requests the file at the URL you specified” . Reference portal.azure.com.
  5. . Enable retries for availability test failures
  6.  Test Frequency : The frequency at which this test will be executed periodically.
  7.  Test Location : Choose your test location after keeping thought about users .
  8.  Success Criteria Which requires Http status code returned to equal the value like 200, 400,4040, 500 etc.
  9.  Alerts : There are default alerts configured though classis preview still exists.

You can refer below some screen shots for reference what should you fill in those properties.
Refer image Test-case-details


Once you save it and after the certain time you will see , Test case has started executing and you should be able to see the details in Availability section in form of line chart or Scatter chart. If you expand the arrow button shows below the chart you will find location details about website availability .Kindy refer an image showing below: availability-of-ping-url






This helps you definitely if you want to test specific endpoint availability.

Tuesday, July 30, 2019

ComosDB - MongoAPI - Document does not contain shard key
This issue comes in picture when we forget to put value for Shard Key while inserting values in document. It means once we have declared Shard key for document it should be part of model which is inserting. Kindly refer an images below:
ShardKey of CosmosDB collection
ShardKey in CosmosDB collection's document :

ShardKey in CosmosDB within collection

I Hope it will help you to resolve your problem.
#CosmosDB #Azure



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 :)