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
#Server side storage copy | |
$SourceStorageAccount = "SourceStorageAccount" | |
$SourceStorageKey = "xysrvAjcX5vVZ6XicUBaJlRRCoMHEuX3OYO0/zCyhoQxSrJtW9EeSt2BTbSrXOsvJgtcjP/xTXRRZvpEhkm9Yg==" | |
$DestStorageAccount = "DestStorageAccount" | |
$DestStorageKey = "Npb0KXlbW/BhTCuvN/3SSw3UhNlv66MTmQaoNmsj/aanfGJnqsHGxRcwABXXRH1E4MxLg4fh7S5QUHRCo5FuBQ==" | |
$SourceStorageContext = New-AzureStorageContext -StorageAccountName $SourceStorageAccount -StorageAccountKey $SourceStorageKey | |
$DestStorageContext = New-AzureStorageContext -StorageAccountName $DestStorageAccount -StorageAccountKey $DestStorageKey | |
$Containers = Get-AzureStorageContainer -Context $SourceStorageContext |
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 System; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.Azure.Storage; | |
using Microsoft.Azure.Storage.Blob; | |
using System.Net; | |
using System.Linq; | |
namespace azurefunction |
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 System; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.Azure.Storage; | |
using Microsoft.Azure.Storage.Blob; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace azurefunction |
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-AzureADToken -TenantId '{TenantId}' -ClientId '{ClientId}' -UserName '{UserName}' -Password '{Password}' |
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
curl --location --request POST "https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token" \ --form "grant_type=password" \ --form "client_id={clientId}" \ --form "client_secret={clientSecret}" \ --form "scope={scope}" \ --form "username={username}" \ --form "password={password}" |
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
# Install module | |
Install-Module -Name AzureAD -AllowClobber | |
# Sign in. Connect to Azure with a browser sign in token | |
Connect-AzureAD |
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
function Get-AzureADToken { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string] $TenantId | |
, [Parameter(Mandatory = $true)] | |
[string] $ClientId | |
, [Parameter(Mandatory = $true)] | |
[string] $UserName | |
, [Parameter(Mandatory = $true)] |
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
Install: |