Thread
#general
    s

    sticky-exabyte-94099

    8 months ago
    In Azure Classic you have this KeyVault Uri but I can´t find one word/example what to replace it with in Azure Native
    Output.Format($"@Microsoft.KeyVault(SecretUri={KeyVault.VaultUri}secrets/{connectionStringSecret.Name}/{connectionStringSecret.Version}");
    I guess you would do it like this? But I get error (
    Cannot implicitly convert type 'Pulumi.Output<string>' to 'string'
    ) on setting the ResourceGroupName and VaultName... how do I solve that?
    h

    high-leather-15669

    8 months ago
    Here is what I had to do in python:
    key_vault_uri=key_vault.name.apply(lambda keyvaultname: f"https://{keyvaultname}.<http://vault.azure.net/|vault.azure.net/>")
    e

    echoing-dinner-19531

    8 months ago
    Use
    GetSecret.Invoke
    instead of
    InvokeAsync
    .
    Invoke
    can take
    Output<T>
    as input values.
    s

    sticky-exabyte-94099

    8 months ago
    Cool thanks. This works
    //Set secret
    var connectionStringSecret = new AzureNative.KeyVault.Secret("ConnectionString", new AzureNative.KeyVault.SecretArgs
    {
        Properties = new AzureNative.KeyVault.Inputs.SecretPropertiesArgs
        {
            Value = ConnectionStringWithPassword,
        },
        ResourceGroupName = ResourceGroup.Apply(t => t.Name),
        SecretName = "connectionString-secret",
        VaultName = KeyVault.Name,
    });
    
    var toUseNow = connectionStringSecret.Properties.Apply(t => t.SecretUri);
    
    // Get somewhere
    var connectionStringGetSecret = AzureNative.KeyVault.GetSecret.Invoke(new AzureNative.KeyVault.GetSecretInvokeArgs()
    {
        ResourceGroupName = ResourceGroup.Apply(t => t.Name),
        SecretName = "connectionString-secret",
        VaultName = KeyVault.Name
    });
    
    var secretUri = connectionStringGetSecret.Apply(t => t.Properties.SecretUri);