This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger: | |
- main | |
name: Deploy Bicep files | |
variables: | |
vmImageName: 'ubuntu-latest' | |
azureServiceConnection: 'myServiceConnection' | |
resourceGroupName: 'Bicep' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push] | |
name: Azure ARM | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout code | |
- uses: actions/checkout@main | |
# Log into Azure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Output "Verifying required Resource Providers Features are registered" | |
$featureName='EnableOIDCIssuerPreview' | |
$aksfeature = az feature list --query "[?contains(name, '$featureName')]" -o json | |
Write-Output "-- $featureName" | |
$feature = $aksfeature | Convertfrom-Json | |
$feature.properties.state | |
if ($feature.properties.state -ne 'Registered') { | |
Write-Output $feature | |
Write-Error "$featureName NOT registered" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
features=($(az feature list -o table | grep 'AKS-AzureDefender\|OIDC' | xargs -L1 bash -c 'echo $0' | cut -d '/' -f2)) | |
for feature in "${features[@]}"; do | |
j=$(az feature show --name ${feature} --namespace 'microsoft.ContainerService' | jq) | |
echo $j | jq | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
feature=`az feature list -o json | jq -c 'map(select(.name | contains("OIDC")))' | jq -r '.[].name'` | |
echo "$feature" | |
namespace=`echo $feature | cut -d'/' -f1` | |
name=`echo $feature | cut -d'/' -f2` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# export MSYS_NO_PATHCONV=1 | |
# Replace <subscription_id> with your Subscription ID. | |
# You can replace the <service-principal-name> with a custom name for your environment or omit the parameter entirely. | |
# If you omit the parameter, the service principal name is generated based on the current date and time. | |
# FOR AN OWNER ROLE: | |
# az ad sp create-for-rbac --scopes "/subscriptions/<subscription_id>" --role "Owner" --name <service_principal_name> | |
# FOR A CONTRIBUTOR ROLE: | |
az ad sp create-for-rbac --name <service_principal_name> --role Contributor --scopes /subscriptions/<subscription_id> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// var addressSpace = [ | |
// '10.1.0.0/16' | |
// ] | |
var subnets = [ | |
{ | |
name: 'api' | |
subnetPrefix: '10.1.66.0/24' | |
} | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy-toy-website | |
on: [workflow_dispatch] | |
jobs: | |
say-hello: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Say hello | |
run: echo "Hello, World!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param | |
( | |
[Parameter (Mandatory=$true)] | |
[string]$AKSResourceGroup, | |
[Parameter (Mandatory=$true)] | |
[string]$AKSName, | |
[Parameter (Mandatory=$true)] | |
[string]$subscriptionID, | |
[Parameter (Mandatory=$true,HelpMessage="start or stop")] | |
[string]$Action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach ($module in (Get-Module -ListAvailable Az*).Name |Get-Unique) { | |
if ((Get-Module -ListAvailable $module).Count -gt 1) { | |
$Latest_Version = (Get-Module -ListAvailable $module | select Version | Sort-Object Version)[-1] | |
write-host "The latest $module version is $Latest_Version" | |
Get-Module -ListAvailable $module | Where-Object {$_.Version -ne $Latest_Version.Version} | foreach {Uninstall-Module -Name $_.Name -RequiredVersion $_.Version -verbose} | |
} | |
else { | |
Write-Output "Only one module version exists for the $module" | |
} | |
} |
OlderNewer