Skip to content

Instantly share code, notes, and snippets.

pipeline {
agent any
// Parameters for deployment and QA options
parameters {
booleanParam(name: 'DEPLOY_DEV', defaultValue: true, description: 'Deploy to Dev environment')
booleanParam(name: 'DEPLOY_SIT', defaultValue: true, description: 'Deploy to SIT environment')
booleanParam(name: 'DEPLOY_UAT', defaultValue: false, description: 'Deploy to UAT environment')
booleanParam(name: 'DEPLOY_PERF', defaultValue: false, description: 'Deploy to Performance environment')
pipeline {
agent any
stages {
stage('Update Git Branch') {
steps {
script {
// Define your job and parameters
def JENKINS_URL = 'http://your_jenkins_server'
def JOB_NAME = 'your_job_name'
provider "azurerm" {
features {}
}
resource "azurerm_user_assigned_identity" "example" {
name = "example-identity"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
}
# Azure provider configuration
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.70.0"
}
}
}
@glitchv0
glitchv0 / zscaler
Last active February 12, 2025 20:22
TOKEN=$(curl -s -H "Metadata: true" "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://vault.azure.net" | jq -r '.access_token')
curl -s -H "Authorization: Bearer $TOKEN" "https://<your-keyvault-name>.vault.azure.net/secrets/<your-secret-name>?api-version=7.2"
# For System-Assigned Identity
TOKEN=$(curl 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://vault.azure.net' -H Metadata:true -s | grep '"access_token":' | cut -d '"' -f 4)
# For User-Assigned Identity
name: Notify Teams on New Release via Graph API using az login
on:
release:
types: [published]
jobs:
notify-teams:
runs-on: ubuntu-latest
<policies>
<inbound>
</inbound>
<backend>
</backend>
<outbound>
<set-header name="Set-Cookie" exists-action="override">
<value>@{
var setCookieHeaders = context.Response.Headers["Set-Cookie"];
if (setCookieHeaders == null || !setCookieHeaders.Any())