Sunday, November 14, 2021

steps for integration accounts with azure logic apps and enterprise integration pack ?

 1. Create an integration account in the azure portal 

you can define custom metadata for artifacts in integration accounts and get that metadata during runtime for your logic app to use.

For example, you can provide metadata for artifacts such as partners , agreements, schemas & maps

- all store metadata using key-value pairs.


2. link the logic app to the integration account

A logic app thats linked to the integration account and artifact metadata you want to use.


3. Add partners, schemas, certificates, maps & agreements.


4. Create a custom connector for the logic app.


which secure function is used by Function app ?

 User claims 

Azure AD uses JSON based tokens ( JWTs ) that contain claims.


How a web app delegated sign-in to Azure AD and obtains a token ?

User authentication happens via the browser. The OpenID protocol uses standard HTTP protocol messages.


how to use the Integration Service Environment in Azure ?

 we can access to Vnet from Azure Logic Apps by using Integration service environments ( ISEs ).

( scenario, when to use it , sometimes your logic apps and integration accounts need access to secured resources , such as virtual machines ( VMs ) and other systems or services, that are inside an Azure virtual network.

To setup this access, you can create an ISE , where you can run your logic apps and create your integration accounts.

reference 

https://docs.microsoft.com/en-us/azure/logic-apps/connect-virtual-network-vnet-isolated-environment-overview


advanced linux operations

1)  a_prefixes.csv | grep ,dev, | egrep ^100 | grep /2 | sed 's/,.*//' >  a_prefix.txt

2)  for I in $(cat b_prefixes.txt); do  grep -s $I a_prefix.txt || echo $I ; done > delete_prefix.txt | wc -l

3)  for I in $(cat b_prefixes.txt); do  grep -s $I a_prefix.txt && echo $I ; done > delete_prefixes.txt

4)  od -c b_prefixes.txt

5) grep -q 100.**.**.0/22 b_prefixes.txt

6) for I in $(cat b_prefixes.txt); do  grep -q $I a_prefix.txt || echo $I ; done > delete_prefixes.txt


Friday, November 12, 2021

examples of powershell & azure

 >  connection 

Connect-AzAccount

>  Get info 

Get-AzVirtualNetwork

> assign to a variable 

$vnet_list = Get-AzVirtualNetwork

> test

$vnet_list

>  create an empty variable

$prefix_list=new-object collections.arraylist

>  test

$prefix_list

$prefix_list.count

$vnet_list[0]

$vnet_list[0].AddressSpace


>  filter specific ipaddress

$prefix_list_10=$prefix_list | where-object{$_ -like "10.*/2*"}


>  test 

$prefix_list_100

$prefix_list_100.count


> write to file 

$prefix_list_10 | out-file cloud_prefixes.txt -encoding ascii











Friday, October 22, 2021

how to patch the VMSS ?

 step1 

Connect-AzAccount

step2


$Credential = Get-Credential Connect-AzAccount -Credential $Credential

step3

$Credential = Get-Credential Connect-AzAccount -Credential $Credential -Tenant 'xxxx-xxxx-xxxx-xxxx' -ServicePrincipal

step4

https://github.com/microsoft/OMS-Agent-for-Linux/blob/master/tools/OMIcheck/omi_check.sh

check the version 

and 

upgrade the version

https://github.com/microsoft/OMS-Agent-for-Linux/blob/master/tools/OMIcheck/omi_upgrade.sh


how to connect to the VMSS and upgrade the version ?

$VmssList = Get-AzVmss

# Change the filter to get whatever VMSS you are interested in

$Vmss = $VmssList | Where-Object {$_.Name -like "aks-agentpool-000000000*"}

# This will return a LIST of VMs in the VMSS

$VmssVmList = @(Get-AzVmssVm -ResourceGroupName $Vmss.ResourceGroupName -VMScaleSetName $Vmss.Name)

# Iterate through the list, change the index 0 to 1,2,3 depending on the count
Invoke-AzVmssVMRunCommand `
-ResourceGroupName $Vmss.ResourceGroupName -VMScaleSetName $Vmss.Name `
-CommandId "RunShellScript" -ScriptPath omi_check.sh -InstanceId $VmssVmList[0].InstanceId


Invoke-AzVmssVMRunCommand `

-ResourceGroupName $Vmss.ResourceGroupName -VMScaleSetName $Vmss.Name `

-CommandId "RunShellScript" -ScriptPath omi_upgrade.sh -InstanceId $VmssVmList[0].InstanceId


Invoke-AzVmssVMRunCommand `

-ResourceGroupName $Vmss.ResourceGroupName -VMScaleSetName $Vmss.Name `

-CommandId "RunShellScript" -ScriptPath omi_check.sh -InstanceId $VmssVmList[0].InstanceId