- For the Azure Storage account, you can list all the storage containers that it includes more info
- For any Azure Storage container, you can list all the blobs in the container more info
- The key for this api is the “prefix” and “delimiter” parameters, these allow you to break up a single list of all the objects in the container into logical folders and process each folder independently.
This file contains hidden or 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
** Code Sample | |
** NOTE: you need AD IAM permissions for this to work | |
namespace DemoSCID | |
{ | |
internal class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
var sasUri = await GetSAS(); | |
var blockBlobClient = new BlockBlobClient(sasUri, null); |
This file contains hidden or 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
# ---------------------------------------------------------------------------------- | |
# MIT License | |
# from https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python-legacy | |
# Copyright(c) Microsoft Corporation. All rights reserved. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
using Azure.Storage.Blobs; | |
using System; | |
using System.Collections.Concurrent; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ListSpeedTest | |
{ |
This file contains hidden or 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
# Variables | |
SUB="your azure subscription guid" | |
RG="the resource group your storage account is in" | |
STORAGEACCT="the short name of your storage account" | |
# Resource strings to the account and to the blob service | |
RESOURCE="/subscriptions/$SUB/resourceGroups/$RG/providers/Microsoft.Storage/storageAccounts/$STORAGEACCT" | |
BLOBRESOURCE="/subscriptions/$SUB/resourceGroups/$RG/providers/Microsoft.Storage/storageAccounts/$STORAGEACCT/blobServices/default" |
This file contains hidden or 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
# Object Replication Demo | |
# 0. Setup some variables and create the resource group | |
# - in this sample we are using the same container name for source and destination this is not required | |
# - in this sample we are using the same region for source and destination this is not required | |
# - in this sample we are using the same durability (i.e. LRS) for source and destination this is not required | |
RG="sweisfelortest" | |
LOCATION="westus" | |
SRCACCT="sweisfelsrc$RANDOM" |
This file contains hidden or 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
#1) Create VM | |
#2) Create Storage account | |
#3) Register an application with Azure AD and create a service principal | |
# https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#register-an-application-with-azure-ad-and-create-a-service-principal | |
#4) create a client secret or upload certificate for your service principal to use | |
# https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#authentication-two-options |
This file contains hidden or 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
# Get metrics for all storage accounts in an azure sub | |
## Fill in the shared variables | |
$sub = "" # Azure Subscription GUID | |
## The script | |
$metrics = @() | |
az login |
This file contains hidden or 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
## List all Application Insights Web Tests in a given resource group | |
## including test name and URL | |
# Variables | |
$TenantId = "" # Enter Tenant Id. | |
$ClientId = "" # Enter Client Id. | |
$ClientSecret = "" # Enter Client Secret. | |
$Resource = "https://management.core.windows.net/" | |
$SubscriptionId = "" # Enter Subscription Id. | |
$RG = "" # Enter Resource Group to look in. |
This file contains hidden or 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
## Monitor Azure Storage | |
### https://aka.ms/azuremonitor/storage-metrics | |
## Azure Monitor Metrics Overview | |
### https://docs.microsoft.com/en-us/azure/azure-monitor/platform/data-platform-metrics | |
## Azure Storage monitoring data reference | |
### https://docs.microsoft.com/en-us/azure/storage/common/monitor-storage-reference | |
## Azure Monitoring REST API walkthrough |
NewerOlder