Skip to content

Instantly share code, notes, and snippets.

View SibeeshVenu's full-sized avatar
🙂
Learning and Sharing

Sibeesh Venu SibeeshVenu

🙂
Learning and Sharing
View GitHub Profile
@SibeeshVenu
SibeeshVenu / notify_teams.py
Created October 1, 2022 12:56
Send message to Microsoft Teams channel
import asyncio
import pymsteams
loop = asyncio.get_event_loop()
def notify_to_teams(message: str, web_hook_url: str, web_hook_name: str):
'''This function will notify the message in the Teams channel'''
my_teams_message = pymsteams.async_connectorcard(web_hook_url)
my_teams_message.title(web_hook_name)
@SibeeshVenu
SibeeshVenu / keyvault_helper.py
Last active October 1, 2022 14:11
Python function to get the secret from Azure Key Vault
from azure.identity import DefaultAzureCredential
from azure.keyvault.secrets import SecretClient
import logging
logging.basicConfig(level=logging.INFO)
def get_key_vault_secret(key_vault_name: str, secret_name: str):
try:
# Authenticate and securely retrieve azure credentials
key_vault_uri = f'https://{key_vault_name}.vault.azure.net'
@SibeeshVenu
SibeeshVenu / Get_All_Blob_Metadata.ps1
Created May 20, 2022 15:58
PowerShell function to get the metadata of all the blobs inside the Azure storage container!
# Set the Execution policy for the current session
# Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope Process
$containerName = ''
$subscriptionid = ''
$storageAccName = ''
Function GetAllBlobMetadata
{
# Connect to your Azure subscription
trigger:
branches:
include:
- master
variables:
solution: "**/*.sln"
buildPlatform: "x86"
buildConfiguration: "Release"
trigger:
branches:
include:
- dev
variables:
solution: "**/*.sln"
buildPlatform: "x86"
buildConfiguration: "Release"
parameters:
- name: azureSubscription
type: string
- name: webAppName
type: string
- name: sourceBranchTrigger
type: string
stages:
- stage: build_stage
{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "text": "Reminder to edit the On-Call details!",
"spacing": "Medium",
"horizontalAlignment": "Center",
            "size": "Large",
{
"count": 1,
"value": [
{
"teamMember": {
"displayName": "Sibeesh Venu",
"url": "",
"_links": {
"avatar": {
"href": ""
var tag = new tblTag { tagName = "jQuery", tagDescription = "This tag is all about jQuery" };
HttpResponseMessage res = await cons.PostAsJsonAsync("api/tblTags", tag);
static async Task MyAPIPost(HttpClient cons)
{
using (cons)
{
var tag = new tblTag { tagName = "jQuery", tagDescription = "This tag is all about jQuery" };
HttpResponseMessage res = await cons.PostAsJsonAsync("api/tblTags", tag);
res.EnsureSuccessStatusCode();
if (res.IsSuccessStatusCode)
{
Console.WriteLine("\n");