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 readonly DbContext dbContext; | |
private readonly SecretClient secretClient; | |
public MyController(DbContext dbContext, SecretClient secretClient) | |
{ |
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
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddControllers(); | |
var proxy = new WebProxy("http://proxyserver:8080", false); |
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
$daysToExpire = 30 | |
$SoonToBeExpiredList = @() | |
$AlreadyExpiredList = @() | |
# Connect to AzureAD | |
Write-Output "Connecting to AzureAD..." | |
$connection = Get-AutomationConnection -Name AzureRunAsConnection | |
Connect-AzureAD -TenantId $connection.TenantID -ApplicationId $connection.ApplicationID -CertificateThumbprint $connection.CertificateThumbprint |
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
$sp = Get-AzADServicePrincipal -DisplayName $myServiceprincipalName | |
Get-AzADSpCredential -ObjectId $sp.Id |
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
# Connect to Azure and position on the desired subscription | |
Connect-AzAccount | |
Get-AzSubscription -SubscriptionName "Microsoft Azure Sponsorship" | Set-AzContext | |
# Create a storage context | |
$context = New-AzStorageContext -StorageAccountName "staticwebsitestorage2" -StorageAccountKey "*****" | |
# Get a reference to the blob | |
$blob = Get-AzStorageBlob -Context $context -Container "images" -Blob "lighthouse.jfif" |
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
workflow Empty-Resource-Group | |
{ | |
param( | |
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()] | |
[string] | |
$ResourceGroupName, | |
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()] | |
[String] | |
$SubscriptionId | |
) |
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
<html> | |
<head> | |
<title>Simple video streaming service</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> | |
</head> | |
<body> | |
<h1>Simple video streaming service</h1> |
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
New-AzSqlDatabaseCopy -ResourceGroupName "RG_source" ` | |
-ServerName "serveursource.database.windows.net" ` | |
-DatabaseName "MaBD" ` | |
-CopyResourceGroupName "RG_destination" ` | |
-CopyServerName "serveurdestination.database.windows.net" ` | |
-CopyDatabaseName "MaBdClonee" |
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
# déclaration des variables | |
$SubscriptionId = "bd......3c" | |
$Location = "canadacentral" | |
clear-host | |
# connexion à Azure et positionnement sur la bonne souscription | |
Connect-AzureRmAccount | |
Set-AzureRmContext -Subscription $SubscriptionId |
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
# désinstaller les modules AzureRm | |
Uninstall-AzureRm | |
# installer le module Az.Sql | |
Install-Module -Name Az.Sql -Force |
NewerOlder