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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"vaultName": { | |
"type": "string", | |
"metadata": { | |
"description": "Name of the Vault" | |
} | |
}, |
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
$StorageAccountKeys = Get-AzureRmStorageAccountKey -ResourceGroupName "" -Name "" | |
$StorageContext = New-AzureStorageContext -StorageAccountName "" -StorageAccountKey $StorageAccountKeys[0].Value | |
$StorageBlob = Get-AzureStorageBlob -Blob "" -Container "" -Context $StorageContext | |
$StorageBlob.ICloudBlob.Properties.IsServerEncrypted |
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
FROM ubuntu:latest AS build | |
# Environment variable | |
ENV DEBIAN_FRONTEND noninteractive | |
## PowerShell | |
# Update the list of products | |
RUN apt-get update |
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
function Invoke-AzureDevOpsRepositoriesClone { | |
[CmdletBinding()] | |
param ( | |
[Parameter()] | |
[string]$AccountName, | |
[Parameter()] | |
[string]$ProjectName, |
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
function Get-AzureRmStoragePublicAccess { | |
[CmdletBinding()] | |
param () | |
begin { | |
$subscriptions = Get-AzureRmSubscription | Out-GridView -Title "Microsoft Azure - Subscriptions" -PassThru | |
} | |
process { |
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
private static string GetEnvironment(string name) | |
{ | |
/// <summary> | |
/// Environment Variable retrieval from AppSettings or local.settings.json | |
/// </summary> | |
return Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process); | |
} |
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
private static async Task<string> GetSecret(string uri, string name) | |
{ | |
/// <summary> | |
/// Secret retrieval via Managed Service Identity (MSI). | |
/// Link: https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/overview | |
/// </summary> | |
AzureServiceTokenProvider provider = new AzureServiceTokenProvider(); | |
KeyVaultClient client = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(provider.KeyVaultTokenCallback)); | |
SecretBundle secret = await client.GetSecretAsync((uri + $"/Secrets/{name}")); | |
string value = secret.Value; |
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
function Get-AzureRmAccessToken { | |
<# | |
.SYNOPSIS | |
Get-AzureRmAccessToken will retrieve the Access Token from the current AzureRm context. | |
.DESCRIPTION | |
Provides the ability to retrieve the current authenticated Access Token within the AzureRm.Profile context. | |
Returns the Access Token to allow for interaction directly with Microsoft Azure REST API's. | |
.EXAMPLE | |
Get-AzureRmAccessToken |
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
function Get-AzureRmContext { | |
<# | |
.SYNOPSIS | |
Get-AzureRmContext will validate the current AzureRm session. | |
.DESCRIPTION | |
Validates that the current session is authenticated, if not then it will initiate Add-AzureRmAccount. | |
.EXAMPLE | |
Get-AzureRmContext | |
#> |
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
function Get-AzureRmAccessToken { | |
<# | |
.SYNOPSIS | |
Get-AzureRmAccessToken will retrieve an Access Token via Azure Active Directory. | |
.DESCRIPTION | |
Provides the ability to retrieve an Access Token from Azure Active Directory Application. | |
.EXAMPLE | |
Get-AzureRmAccessToken -TenantId $tenantId -ClientId $clientId -ClientSecret $clientSecret | |
.LINK |
OlderNewer