public AzureStorageConnectionString(TokenCredentialProvider tokenCredentialProvider, ISystemClock clock) { _tokenCredentialProvider = tokenCredentialProvider; _clock = clock; }
public AzureKeyVault(TokenCredentialProvider tokenCredentialProvider) { _tokenCredentialProvider = tokenCredentialProvider; }
public AzureKeyVault(IReadOnlyDictionary <string, string> parameters, TokenCredentialProvider tokenCredentialProvider) : base(parameters) { _tokenCredentialProvider = tokenCredentialProvider; ReadRequiredParameter("subscription", ref _subscription); ReadRequiredParameter("name", ref _vaultName); }
public AzureStorageKey(TokenCredentialProvider tokenCredentialProvider, ISystemClock clock) { _tokenCredentialProvider = tokenCredentialProvider; _clock = clock; }
public TestCommand(IConsole console, TokenCredentialProvider tokenProvider) { _console = console; _tokenProvider = tokenProvider; }
public ServiceBusConnectionString(TokenCredentialProvider tokenCredentialProvider, ISystemClock clock) { _tokenCredentialProvider = tokenCredentialProvider; _clock = clock; }
public EventHubConnectionString(TokenCredentialProvider tokenCredentialProvider, ISystemClock clock) { _tokenCredentialProvider = tokenCredentialProvider; _clock = clock; }
public static async Task <string> RotateStorageAccountKey(string subscriptionId, string accountName, RotationContext context, TokenCredentialProvider tokenCredentialProvider, CancellationToken cancellationToken) { StorageManagementClient client = await CreateManagementClient(subscriptionId, tokenCredentialProvider, cancellationToken); StorageAccount account = await FindAccount(accountName, client, cancellationToken); if (account == null) { throw new ArgumentException($"Storage account '{accountName}' in subscription '{subscriptionId}' not found."); } string currentKey = context.GetValue("currentKey", "key1"); ResourceId id = ResourceId.FromString(account.Id); StorageAccountListKeysResult keys; string keyToReturn; switch (currentKey) { case "key1": keys = await client.StorageAccounts.RegenerateKeyAsync(id.ResourceGroupName, id.Name, "key2", cancellationToken : cancellationToken); keyToReturn = "key2"; break; case "key2": keys = await client.StorageAccounts.RegenerateKeyAsync(id.ResourceGroupName, id.Name, "key1", cancellationToken : cancellationToken); keyToReturn = "key1"; break; default: throw new InvalidOperationException($"Unexpected 'currentKey' value '{currentKey}'."); } StorageAccountKey key = keys.Keys.FirstOrDefault(k => k.KeyName == keyToReturn) ?? throw new InvalidOperationException($"Key {keyToReturn} not found."); context.SetValue("currentKey", keyToReturn); return(key.Value); }
public AzureStorageConnectionString(IReadOnlyDictionary <string, string> parameters, TokenCredentialProvider tokenCredentialProvider) : base(parameters) { _tokenCredentialProvider = tokenCredentialProvider; ReadRequiredParameter("subscription", ref _subscription); ReadRequiredParameter("account", ref _accountName); }