Skip to main content

Posts

Showing posts from January, 2023
Azure Cloud shell - Switching to powershell from bash vice versa without losing session Hi All! Azure portal has a nice feature called Cloud Shell for scripting purposes to manage and administered via command Lines. Cloud Shell has both powershell and bash terminal. when we want to work with linux related, we can use Bash. Azure CLI commands work in both powershell and bash but most of the people prefers Bash. In a screen of azure portal / cloudshell, we can work with only one terminal at a time. For example, if you are already working on powershell and if you change to bash terminal, you will loss the upto the level of completed commands. There is one way to switch terminals without losing your work as below
Set colors in Linux (PuttY) Terminal Hi All! PuttY is one among the mostly used terminal for Linux and it has foreground white and background black by default. By using the below command, we can change the foreground color. I have tried the below in Redhat Linux. you people can try on different distributions as well. Let's meet in next post. 😊
'0' is false and '1' is true typically but it is different in Linux Hi All I'm happy to hear and get a request from one of my regular blog watcher that he asked me to post Linux related stuffs regularly. I'll try my level best. In most of the programming Languages and scripting languages numeric 0 refers false and 1 refers true but in linux it is different slightly / opposite in a scenario. Come Let's see that in following illustration. we're going to use the following test This command/utility is used to test some conditions. Here we're going to use it for checking file exists or not $? It returns the output of last run above command As per the below execution, If file exists output is 0 otherwise 1 (i.e 0=true and 1=false) we learnt a small different thing. will meet in next post.
Should I need access policy on azure keyvault even though I'm owner of keyvault? Hi All In this article, we are going to see how important of having access policy in azure key vault. Azure KeyVaukt is a service offered by azure to have data protection. Instead of storing password, certificates and or other secrets in code behind we can keep them in key vault and access them through key vault securely. Ok. I'm a owner of an azure subscription. you people know well, child level resources inherit access level from parent resource in azure. So, here If I'm owner of a subscription then I'm owner of this key vault what I'm going to create as well. Let's imagine that I created a key vault without access policy on my name. Can I see / create keys and/or secrets and/or certificates? because I'm an owner of this resource. right? Answer is No because keyvault's components (keys, secrets, certificates) do not consider role based access level
Azure conainer's Block sizes comparison among different types of blobs Hi All All of the azure people come across and using storage accounts. Especially blobs. Storage account offers blob, file, table and queues but blob uses by many people. This article is all about the block sizes of those blobs. Azure storage account blob container has 3 types of below blobs Block Mostly useful for text and binary data Page Mostly useful for disks Append Mostly useful for like block blobs but are optimized for append Please look into the below image. Here block sizes are not limited to the uploading size of blobs i.e. If I choose block blob size is 64 KB and uploads 2 MB txt file, upload will not be failed beacause blocks may be splitted into 64 KB chunks and grouped of 2 MB file size together. (i.e 64KB * 32 blocks = 2 MB file size)
Does Microsoft support for Azure access customer data? Hi All Some of us may have a question that whether Microsoft access my (customer) data. Answer is No and Yes. How a single question has 2 answers? Typically MS support team does not access customer data at all but in some senarios MS support team requires access data with customer consent. customer can either approve or reject that request. Here Customer Lockbox for Microsoft Azure comes into picture. It provides an interface for customers to review and approve / reject customer data access requests from the MS engineer / support team. Lockbox also acts as a common unique place to track the status and history of the access request. For more details: https://learn.microsoft.com/en-us/azure/security/fundamentals/customer-lockbox-overview
Azure KQL - project vs project-away As how development and deployment important, monitoring is also an important thing. so that we can ensure everything works as expected and solve some issues before it makes our services / resources become outage. Azure has dedicated service for monitoring called "Monitor" which acts as a Log store. Log Analytics is one of a service which reads logs from azure monitor like-SQL query format which is called here as KQL (Kusto Query Language). This will help us to prepare a chart with required data in monitoring. This article is not going to talk about deep on Log analytics whereas we are going to have a glimpse of selecting columns / result in following 2 ways. project - Have only the required columns in the KQL project-away - Have only the unwanted columns in the KQL This will help us in a scenario like we have 30 columns and we need 20 columns. Instead of specifying 20 required column names, we can specify 10
Why should I know if condition in bash especially for Devops? Hi All! Today we're going to see and learn if / elseif condition in bash. Everybody have a thought why if condition is main important to learn than other statements in bash. Let's see why It is always good to have knowledge on powershell, python and especially bash as a Devops guy. Nowadays most of the organization prefers Infrastucture as Code (Iac) with DRY (Donot Repeat Yourself) mostly. i.e. single/same YAML code file should be applicable for their multiple environments. Consider an example that an organization has Dev, QA and Production environments. They need same infra to be deployed on all the environments after the verification from Dev then QA then finally Production. So here, Infrastucture is not going to change, only the environment gets changed (i.e. subscription, resourcegroup, resourcename ...etc,). so we should have a single YAML file based on condition. But, why learning Ba
Dynamic Membership Group creation in Azure AD Hi All! we are going to see the creation of dynamic membership (user) group in Azure AD. There are 2 types of group type as below. Security Microsoft 365 There are 3 types of membership types below. Assigned Dynamic user Dynamic Device Consider a scenario that I need an azure AD group where the members need not to be there permanently based on some condition(s). (i.e. Adding & deleting an user should be done automatically). How can we achieve it? we can achieve it via Dynamic user and let's start. Please look into the below image. As per the below image, Sales group is creating with a condition as "Add user(s) to this group whose usage location is from East US2". If usage location of a user gets changed, user will be removed from this group automatically. There are multiple conditions available in azure for Dynamic user and Dynamic Device. pick the one which fits for you. we will
Upgrade azure container registry's (ACR) SKU via azure CLI ACR - Azure Container Registry is azure based container registry/repository to pull and push containerized images. Tools like azure powershell, CLI are sometimes faster than azure portal to perform some operations. In this post, we are going to upgrade azure container registry's sku from standard to premium. you people may ask me why should it get changed and let it be, I hear. The reason behind it is, I would like to restrict ACR from all IP(s) except some selective IP(s) but Standard SKU acr is not supported this feature. so that we need to upgrade it. you can prefer either cloudshell or local powershell, bash based on your convenient. If you choose cloudshell, you may not need to install most of the powershell or bash related modules explicitly and need not to login explictly like az login and/or Connect-AzAccount but you need to have cloud resources like azure file share one time created for an
Create, switch and delete a local git branch using git commands When developers and/or cloud engineers work with coding/Iac, they need to keep their code permanently to save from loss. Github and Azure Devops are typically use by many people. Git is a version control system can be used in both github and azure devops with exception that Devops's git project can be used git but team foundation server natively not supported by git. As most of us know TFS is centralized i.e. If I check-in/commit, it directly afftects branches in TFS whereas git is a decentralized i.e. stage/commit only sits in local system repository until it pushes to the remote repository i.e. devops or github As a best practise, we can have more than branch to work with and avoid directly work on main/master branch. Once tested done, we can make pull request to merge the child branch with main branch In this post we will learn / refresh to create, switch and delete a branch locally using git commands f
What IP address I can not get it from Azure subnet CIDR to azure resource(s)? What? Will I not be able to get some IP(s) from subnet? How many IP(s) I am not able to get and what are they and why? Azure Virtual Network is one of the main service from azure to create private network in cloud. subnet is the main part of Vnet for segregation. while creating a subnet we have to define CIDR. If I create /24 mask subnet, I should get 256 IP(s) but why am I not getting 256 fully for my resources. I can get only 251 IP(s) because azure reserves 5 IPs from every subnet. consider I'm creating a subnet called DMZ with subnet/cidr range as 10.1.2.0/24 and I'm going to get IP(s) from 10.1.2.4, 10.1.2.5, 10.1.2.6.......10.1.2.254 and please look into the below table for the reason and IP why they are not able to assign to user created azure resources. IP Purpose 10.1.2.0 Network address 10.1.2.1 Reserved by Azure for the defau
Find and Replace text at a file in Linux using "sed" When working with linux terminal, there are more than one way to find and replace a text using vi, nano and sed. In this post, we will see simple example for Find and Replace using "sed" aka "stream editor". please look into the below image and share your comments, welcome.
What would be the first step for github codespace pipeline to run? As most organizations use Azure Devops, now they are paying attention on Github codespace as well. It is glowing nowadays. Github codespace uses YAML which is similar to Devops YAML, with codespace nature. As a developer starts with simple "Hello World" program in his/her new learning technology, devops engineers start with a very simple CI pipeline at the first time. Azure Devops require Basic or visual studio access level to see "Repos" where we have our code repository and by choosing it on CI pieline, we can run CI/CD pipeline. (stakeholder access level is not sufficient to see Repos), codespace require something to be setup initially to run pipeline. What is it? Your repository or project should be enabled with "Allow Actions for workflow" Below image will show you the steps and place where you need to setup in your github account / repository for codespace pipe
Write and append data into a file in Linux Hi guys! we already started and learnt some linux commands and as I mentioned earlier, in this article we are going to see / refresh about writing and appending data into a file in Linux. We're going to see the below commands usage in Linux. touch - To create a file cat - To read a file ls - list the current directory files > - To write data into a file >> - To append data into a file Please look into the below image.
Recover the deleted secrets from azure key vault Azure Key Vault is one of the important services from azure to used to store keys, secrets for data protection Consider a scenario that you stored an application secret in the key vault where the app secret expiry is 1 year. Your tech lead / manager asks you to have the max year as possible. Azure portal lets us to have 2 year maximum whereas through powershell you can create more than 2 years too. Unfortunately, Azure keyvault does not allow us to modify/update the secret value. so the only way is to delete that secret and create a new secret with same name. Some of the time we face challenges like getting error as conflicting while create a secret with the name of deleted as soon as deleted the old one. Newbie will get panic and anxiety because new secret is not able to created and also how and where to recover the delete one. we need not worry to recover the deleted one. Please look into the below image to see how a
create and read a file in Linux As a cloud and Devops engineers, we need to know to work with Linux is always helpful to handle some critical situations. There are multiple ways to create and read a file in Linux. In this article we're going to learn about touch command. Let's work with followings in this article pwd - To show present working directory touch - To create an empty file ls - To list the files from the current directory echo - To display message as well as write into a file. '>' - write into a file. '>>' - append it to a file cat - To read content of file we'll see writing and appending into a file in my upcoming post.
Difference between failed() vs succeededorFailed() in Devops YAML Every organizations embrace Devops culture for CI & CD. Nowadays, everybody prefers YAML which is IaC (Infrastructure as Code) instead of classic UI editor. YAML consists main components as stages, jobs, steps, tasks.... etc., Based on the requirement, Devops engineers need to apply conditions on pipline between tasks or jobs or stages. what is condition? when I want to run a task or job based on some condition like only when my preferred another job failed or succeeded. Here I job1 and job2. I need to run job2 only if job1 fails. Let's see the difference between failed() and succeededorFailed() through the below image.
Find Global user details of Git from DOS/powershell We might confiure git repository some days back and due to some other deviated tasks, we might not use the repo for long time. When we want to make changes on those repository and check-in, we would like to know the global settings of the git repository. consider an example/scenaio that we might created an azure function app using python 3 months back and it is working fine. Later, we moved to networking or Infra related tasks. So, we might not touch the function app, since it is running well so far. Now we would like to know what is in my global configuration because we would have our organization mail id and customer domain mail id. Devops can have either or both of the account. The below image shows you how to find the git global user name and mail confiured in the local machine.
Clear Run history from Azure Logic App In Azure cloud Logic App is one of the main services in development. we may be using Logic app for testing from the development background. After it works as expected, we can use the same, but it has the previous history at that time of testing. How can we delete those history? Is there any option we have in Azure portal? As of now, azure portal does not have a feature to delete history. There may be option(s) to do that via Azure CLI, powershell etc., This article talks about how we can accomplish the same thing using REST API. Go to the below URL and pass the required values. https://learn.microsoft.com/en-us/rest/api/logic/workflow-runs/delete?tabs=HTTP&tryIt=true&source=docs#code-try-0