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
############################################## | |
## Set your region and the location of the public IP json file | |
## | |
$myRegion = "AzureCloud.JapanEast" | |
$IPListJsonFile = "C:\sandbox\ServiceTags_Public_20201012.json" | |
## Service List for Azure Backup per NSG tags documented | |
## NOTE : Any of these services can loadbalance to endpoints from other regions. Will need testing. | |
$serviceList= ("AzureBackup","Storage","AzureActiveDirectory") |
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
### | |
## DISCLAIMER : This is a sample and is provided as is with no warranties express or implied. | |
## | |
## Instructions :- | |
## 1.Launch cloudshell and set the subscription context using | |
## Set-AzContext -SubscriptionID <yoursubscription> | |
## 2.Click "Raw" on this github gist and copy everything after the line "##StartCopy" | |
## 3.Execute this script in the cloud shell to register the routine. | |
## 4.Execute it as Get-NonCoolBlobs -RGName MyResourceGroup -Name MyStorageAccount | |
### |
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
##### | |
## Save out file as say BlobPC.ps1 | |
## Edit for necessary changes | |
## Execute in a sub process by calling powershell.exe .\BlobPC.ps1 | |
## | |
## NOTE: If you do not use a sub process the class will stay in the application domain and cause failures on rerun | |
## | |
$StorageAccountName = "mystorageaccount" | |
$StorageAccountRG = "myresourcegroupname" |
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
### | |
## DISCLAIMER : This is a sample and is provided as is with no warranties express or implied. | |
## | |
## Instructions :- | |
## 1.Launch cloudshell and set the subscription context using | |
## Set-AzContext -SubscriptionID <yoursubscription> | |
## 2.Click "Raw" on this github gist and copy everything after the line "##StartCopy" | |
## 3.Execute this script in the cloud shell to register the routine. | |
## 4.Execute it as Get-CoolBlobs -RGName MyResourceGroup -Name MyStorageAccount | |
### |
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
### | |
## DISCLAIMER : This is a sample and is provided as is with no warranties express or implied. | |
## | |
### | |
[CmdletBinding(DefaultParametersetName="SharedKey")] | |
param( | |
[Parameter(Mandatory=$true, HelpMessage="Storage Account Name")] | |
[String] $storage_account_name, |
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
## Customer specific data | |
$storageaccountname = "ajtstsa" | |
$sastoken = "?sv=2018-03-28&ss=b&srt=sco&sp=rwdlac&se=2019-04-30T22:33:54Z&st=2019-04-29T14:33:54Z&spr=https,http&sig=yXWcUTBsLPp%2B8ab6IRLzgwQJsfsBp3h3yk4WKiD4%2Fig%3D" | |
$container = "sasaccesstest" | |
$blobname = "mytestblob.txt" | |
## Construct required variables" | |
$containeruri="https://$storageaccountname.blob.core.windows.net/$container$sastoken&restype=container" | |
$bloburi="https://$storageaccountname.blob.core.windows.net/$container/$blobname$sastoken" | |
$blobdata = "Test blob data" |
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
### | |
## DISCLAIMER : This is a sample and is provided as is with no warranties express or implied. | |
## | |
### | |
[CmdletBinding(DefaultParametersetName="SharedKey")] | |
param( | |
[Parameter(Mandatory=$true, HelpMessage="Storage Account Name")] | |
[String] $storage_account_name, |
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
### | |
## DISCLAIMER : This is a sample and is provided as is with no warranties express or implied. | |
## | |
## The RemoveSoftDeletedBlobs switch will cause changes to the storage account. Please ensure you test and | |
## understand all implications before running this against critical data. | |
## | |
### | |
[CmdletBinding(DefaultParametersetName="SharedKey")] | |
param( |
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 PrintServiceStats | |
{ | |
Param( | |
[Parameter (Mandatory=$True,Position=1)] [string] $storageAccountName, | |
[Parameter (Mandatory=$True,Position=2)] [string] $accountSASToken, | |
[Parameter (Mandatory=$True,Position=3)] [string] $service | |
) | |
$accountSASParam = $accountSASToken.Replace("?","") | |
$statsURI = "https://$storageAccountName-secondary.$service.core.windows.net/?restype=service&comp=stats&$accountSASParam" | |
$resp = Invoke-WebRequest -Method Get -Uri $statsURI |
NewerOlder