Skip to content

Instantly share code, notes, and snippets.

View your-azure-coach's full-sized avatar

Your Azure Coach your-azure-coach

View GitHub Profile
@your-azure-coach
your-azure-coach / aad-apply-role-assignments.ps1
Last active January 31, 2021 22:05
Scripting Azure AD application role assignments for users and applications
param (
[string] $TenantId,
[string] $ConfigFilePath
)
$ErrorActionPreference = "Stop"
Write-Host Start Azure AD role assignment script
Write-Host "-Tenant Id:" $TenantId -ForegroundColor Gray
Write-Host "-Config File Path:" $ConfigFilePath -ForegroundColor Gray
@your-azure-coach
your-azure-coach / apim-validate-global-policy-enforcement.ps1
Last active June 7, 2022 17:58
Azure API Management - Global Policy Enforcement
[CmdletBinding()]
param (
$ApimName,
$ApimResourceGroup
)
function Is-ValidPolicy {
[CmdletBinding()]
param([string] $PolicyString)
@your-azure-coach
your-azure-coach / BlobStorage.cs
Last active July 10, 2023 14:06
Managed Identity code snippets
using Azure.Storage.Blobs; //v12.4.3
var blobClient = new BlobClient(
new Uri($”https://{_storageAccountName}.blob.core.windows.net/{_blobContainerName}/msi-{Guid.NewGuid()}.txt”),
credential
);
var testFileStream = File.OpenRead(_testFilePath);
await blobClient.UploadAsync(testFileStream, true);
testFileStream.Close();