// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.datafactory;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.datafactory.LinkedServiceAzureBlobStorageArgs;
import com.pulumi.azure.datafactory.inputs.LinkedServiceAzureBlobStorageState;
import com.pulumi.azure.datafactory.outputs.LinkedServiceAzureBlobStorageKeyVaultSasToken;
import com.pulumi.azure.datafactory.outputs.LinkedServiceAzureBlobStorageServicePrincipalLinkedKeyVaultKey;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Linked Service (connection) between an Azure Blob Storage Account and Azure Data Factory.
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.storage.StorageFunctions;
 * import com.pulumi.azure.storage.inputs.GetAccountArgs;
 * import com.pulumi.azure.datafactory.Factory;
 * import com.pulumi.azure.datafactory.FactoryArgs;
 * import com.pulumi.azure.datafactory.LinkedServiceAzureBlobStorage;
 * import com.pulumi.azure.datafactory.LinkedServiceAzureBlobStorageArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var exampleResourceGroup = new ResourceGroup(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         final var exampleAccount = StorageFunctions.getAccount(GetAccountArgs.builder()
 *             .name(&#34;storageaccountname&#34;)
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .build());
 * 
 *         var exampleFactory = new Factory(&#34;exampleFactory&#34;, FactoryArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .build());
 * 
 *         var exampleLinkedServiceAzureBlobStorage = new LinkedServiceAzureBlobStorage(&#34;exampleLinkedServiceAzureBlobStorage&#34;, LinkedServiceAzureBlobStorageArgs.builder()        
 *             .dataFactoryId(exampleFactory.id())
 *             .connectionString(exampleAccount.applyValue(getAccountResult -&gt; getAccountResult).applyValue(exampleAccount -&gt; exampleAccount.applyValue(getAccountResult -&gt; getAccountResult.primaryConnectionString())))
 *             .build());
 * 
 *     }
 * }
 * ```
 * ### With SAS URI And SAS Token
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.core.CoreFunctions;
 * import com.pulumi.azure.datafactory.Factory;
 * import com.pulumi.azure.datafactory.FactoryArgs;
 * import com.pulumi.azure.keyvault.KeyVault;
 * import com.pulumi.azure.keyvault.KeyVaultArgs;
 * import com.pulumi.azure.datafactory.LinkedServiceKeyVault;
 * import com.pulumi.azure.datafactory.LinkedServiceKeyVaultArgs;
 * import com.pulumi.azure.datafactory.LinkedServiceAzureBlobStorage;
 * import com.pulumi.azure.datafactory.LinkedServiceAzureBlobStorageArgs;
 * import com.pulumi.azure.datafactory.inputs.LinkedServiceAzureBlobStorageKeyVaultSasTokenArgs;
 * import com.pulumi.azure.datafactory.inputs.LinkedServiceAzureBlobStorageServicePrincipalLinkedKeyVaultKeyArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var example = new ResourceGroup(&#34;example&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         final var current = CoreFunctions.getClientConfig();
 * 
 *         var testFactory = new Factory(&#34;testFactory&#34;, FactoryArgs.builder()        
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 * 
 *         var testKeyVault = new KeyVault(&#34;testKeyVault&#34;, KeyVaultArgs.builder()        
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .tenantId(current.applyValue(getClientConfigResult -&gt; getClientConfigResult.tenantId()))
 *             .skuName(&#34;standard&#34;)
 *             .build());
 * 
 *         var testLinkedServiceKeyVault = new LinkedServiceKeyVault(&#34;testLinkedServiceKeyVault&#34;, LinkedServiceKeyVaultArgs.builder()        
 *             .dataFactoryId(testFactory.id())
 *             .keyVaultId(testKeyVault.id())
 *             .build());
 * 
 *         var testLinkedServiceAzureBlobStorage = new LinkedServiceAzureBlobStorage(&#34;testLinkedServiceAzureBlobStorage&#34;, LinkedServiceAzureBlobStorageArgs.builder()        
 *             .dataFactoryId(testFactory.id())
 *             .sasUri(&#34;https://example.blob.core.windows.net&#34;)
 *             .keyVaultSasToken(LinkedServiceAzureBlobStorageKeyVaultSasTokenArgs.builder()
 *                 .linkedServiceName(testLinkedServiceKeyVault.name())
 *                 .secretName(&#34;secret&#34;)
 *                 .build())
 *             .build());
 * 
 *         var testDatafactory_linkedServiceAzureBlobStorageLinkedServiceAzureBlobStorage = new LinkedServiceAzureBlobStorage(&#34;testDatafactory/linkedServiceAzureBlobStorageLinkedServiceAzureBlobStorage&#34;, LinkedServiceAzureBlobStorageArgs.builder()        
 *             .dataFactoryId(testFactory.id())
 *             .serviceEndpoint(&#34;https://example.blob.core.windows.net&#34;)
 *             .servicePrincipalId(&#34;00000000-0000-0000-0000-000000000000&#34;)
 *             .tenantId(&#34;00000000-0000-0000-0000-000000000000&#34;)
 *             .servicePrincipalLinkedKeyVaultKey(LinkedServiceAzureBlobStorageServicePrincipalLinkedKeyVaultKeyArgs.builder()
 *                 .linkedServiceName(testLinkedServiceKeyVault.name())
 *                 .secretName(&#34;secret&#34;)
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Data Factory Linked Service&#39;s can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:datafactory/linkedServiceAzureBlobStorage:LinkedServiceAzureBlobStorage example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DataFactory/factories/example/linkedservices/example
 * ```
 * 
 */
@ResourceType(type="azure:datafactory/linkedServiceAzureBlobStorage:LinkedServiceAzureBlobStorage")
public class LinkedServiceAzureBlobStorage extends com.pulumi.resources.CustomResource {
    /**
     * A map of additional properties to associate with the Data Factory Linked Service.
     * 
     * The following supported arguments are specific to Azure Blob Storage Linked Service:
     * 
     */
    @Export(name="additionalProperties", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output</* @Nullable */ Map<String,String>> additionalProperties;

    /**
     * @return A map of additional properties to associate with the Data Factory Linked Service.
     * 
     * The following supported arguments are specific to Azure Blob Storage Linked Service:
     * 
     */
    public Output<Optional<Map<String,String>>> additionalProperties() {
        return Codegen.optional(this.additionalProperties);
    }
    /**
     * List of tags that can be used for describing the Data Factory Linked Service.
     * 
     */
    @Export(name="annotations", refs={List.class,String.class}, tree="[0,1]")
    private Output</* @Nullable */ List<String>> annotations;

    /**
     * @return List of tags that can be used for describing the Data Factory Linked Service.
     * 
     */
    public Output<Optional<List<String>>> annotations() {
        return Codegen.optional(this.annotations);
    }
    /**
     * The connection string. Conflicts with `connection_string_insecure`, `sas_uri` and `service_endpoint`.
     * 
     */
    @Export(name="connectionString", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> connectionString;

    /**
     * @return The connection string. Conflicts with `connection_string_insecure`, `sas_uri` and `service_endpoint`.
     * 
     */
    public Output<Optional<String>> connectionString() {
        return Codegen.optional(this.connectionString);
    }
    /**
     * The connection string sent insecurely. Conflicts with `connection_string`, `sas_uri` and `service_endpoint`.
     * 
     * &gt; **Note:** `connection_string` uses the Azure [SecureString](https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.management.datafactory.models.securestring) to encrypt the contents within the REST payload sent to Azure whilst the `connection_string_insecure` is sent as a regular string. Both properties are still sent using SSL/HTTPS. At this time the portal will not decrypt Secure Strings so the `connection_string` property in the portal will show as `******` whilst `connection_string_insecure` will be viewable in the portal.
     * 
     */
    @Export(name="connectionStringInsecure", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> connectionStringInsecure;

    /**
     * @return The connection string sent insecurely. Conflicts with `connection_string`, `sas_uri` and `service_endpoint`.
     * 
     * &gt; **Note:** `connection_string` uses the Azure [SecureString](https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.management.datafactory.models.securestring) to encrypt the contents within the REST payload sent to Azure whilst the `connection_string_insecure` is sent as a regular string. Both properties are still sent using SSL/HTTPS. At this time the portal will not decrypt Secure Strings so the `connection_string` property in the portal will show as `******` whilst `connection_string_insecure` will be viewable in the portal.
     * 
     */
    public Output<Optional<String>> connectionStringInsecure() {
        return Codegen.optional(this.connectionStringInsecure);
    }
    /**
     * The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource.
     * 
     */
    @Export(name="dataFactoryId", refs={String.class}, tree="[0]")
    private Output<String> dataFactoryId;

    /**
     * @return The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource.
     * 
     */
    public Output<String> dataFactoryId() {
        return this.dataFactoryId;
    }
    /**
     * The description for the Data Factory Linked Service.
     * 
     */
    @Export(name="description", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> description;

    /**
     * @return The description for the Data Factory Linked Service.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * The integration runtime reference to associate with the Data Factory Linked Service.
     * 
     */
    @Export(name="integrationRuntimeName", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> integrationRuntimeName;

    /**
     * @return The integration runtime reference to associate with the Data Factory Linked Service.
     * 
     */
    public Output<Optional<String>> integrationRuntimeName() {
        return Codegen.optional(this.integrationRuntimeName);
    }
    /**
     * A `key_vault_sas_token` block as defined below. Use this argument to store SAS Token in an existing Key Vault. It needs an existing Key Vault Data Factory Linked Service. A `sas_uri` is required.
     * 
     */
    @Export(name="keyVaultSasToken", refs={LinkedServiceAzureBlobStorageKeyVaultSasToken.class}, tree="[0]")
    private Output</* @Nullable */ LinkedServiceAzureBlobStorageKeyVaultSasToken> keyVaultSasToken;

    /**
     * @return A `key_vault_sas_token` block as defined below. Use this argument to store SAS Token in an existing Key Vault. It needs an existing Key Vault Data Factory Linked Service. A `sas_uri` is required.
     * 
     */
    public Output<Optional<LinkedServiceAzureBlobStorageKeyVaultSasToken>> keyVaultSasToken() {
        return Codegen.optional(this.keyVaultSasToken);
    }
    /**
     * Specifies the name of the Data Factory Linked Service. Changing this forces a new resource to be created. Must be unique within a data factory. See the [Microsoft documentation](https://docs.microsoft.com/azure/data-factory/naming-rules) for all restrictions.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return Specifies the name of the Data Factory Linked Service. Changing this forces a new resource to be created. Must be unique within a data factory. See the [Microsoft documentation](https://docs.microsoft.com/azure/data-factory/naming-rules) for all restrictions.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * A map of parameters to associate with the Data Factory Linked Service.
     * 
     */
    @Export(name="parameters", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output</* @Nullable */ Map<String,String>> parameters;

    /**
     * @return A map of parameters to associate with the Data Factory Linked Service.
     * 
     */
    public Output<Optional<Map<String,String>>> parameters() {
        return Codegen.optional(this.parameters);
    }
    /**
     * The SAS URI. Conflicts with `connection_string_insecure`, `connection_string` and `service_endpoint`.
     * 
     */
    @Export(name="sasUri", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> sasUri;

    /**
     * @return The SAS URI. Conflicts with `connection_string_insecure`, `connection_string` and `service_endpoint`.
     * 
     */
    public Output<Optional<String>> sasUri() {
        return Codegen.optional(this.sasUri);
    }
    /**
     * The Service Endpoint. Conflicts with `connection_string`, `connection_string_insecure` and `sas_uri`.
     * 
     */
    @Export(name="serviceEndpoint", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> serviceEndpoint;

    /**
     * @return The Service Endpoint. Conflicts with `connection_string`, `connection_string_insecure` and `sas_uri`.
     * 
     */
    public Output<Optional<String>> serviceEndpoint() {
        return Codegen.optional(this.serviceEndpoint);
    }
    /**
     * The service principal id in which to authenticate against the Azure Blob Storage account.
     * 
     */
    @Export(name="servicePrincipalId", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> servicePrincipalId;

    /**
     * @return The service principal id in which to authenticate against the Azure Blob Storage account.
     * 
     */
    public Output<Optional<String>> servicePrincipalId() {
        return Codegen.optional(this.servicePrincipalId);
    }
    /**
     * The service principal key in which to authenticate against the AAzure Blob Storage account.
     * 
     */
    @Export(name="servicePrincipalKey", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> servicePrincipalKey;

    /**
     * @return The service principal key in which to authenticate against the AAzure Blob Storage account.
     * 
     */
    public Output<Optional<String>> servicePrincipalKey() {
        return Codegen.optional(this.servicePrincipalKey);
    }
    /**
     * A `service_principal_linked_key_vault_key` block as defined below. Use this argument to store Service Principal key in an existing Key Vault. It needs an existing Key Vault Data Factory Linked Service.
     * 
     */
    @Export(name="servicePrincipalLinkedKeyVaultKey", refs={LinkedServiceAzureBlobStorageServicePrincipalLinkedKeyVaultKey.class}, tree="[0]")
    private Output</* @Nullable */ LinkedServiceAzureBlobStorageServicePrincipalLinkedKeyVaultKey> servicePrincipalLinkedKeyVaultKey;

    /**
     * @return A `service_principal_linked_key_vault_key` block as defined below. Use this argument to store Service Principal key in an existing Key Vault. It needs an existing Key Vault Data Factory Linked Service.
     * 
     */
    public Output<Optional<LinkedServiceAzureBlobStorageServicePrincipalLinkedKeyVaultKey>> servicePrincipalLinkedKeyVaultKey() {
        return Codegen.optional(this.servicePrincipalLinkedKeyVaultKey);
    }
    /**
     * Specify the kind of the storage account. Allowed values are `Storage`, `StorageV2`, `BlobStorage` and `BlockBlobStorage`.
     * 
     */
    @Export(name="storageKind", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> storageKind;

    /**
     * @return Specify the kind of the storage account. Allowed values are `Storage`, `StorageV2`, `BlobStorage` and `BlockBlobStorage`.
     * 
     */
    public Output<Optional<String>> storageKind() {
        return Codegen.optional(this.storageKind);
    }
    /**
     * The tenant id or name in which to authenticate against the Azure Blob Storage account.
     * 
     */
    @Export(name="tenantId", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> tenantId;

    /**
     * @return The tenant id or name in which to authenticate against the Azure Blob Storage account.
     * 
     */
    public Output<Optional<String>> tenantId() {
        return Codegen.optional(this.tenantId);
    }
    /**
     * Whether to use the Data Factory&#39;s managed identity to authenticate against the Azure Blob Storage account. Incompatible with `service_principal_id` and `service_principal_key`.
     * 
     */
    @Export(name="useManagedIdentity", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> useManagedIdentity;

    /**
     * @return Whether to use the Data Factory&#39;s managed identity to authenticate against the Azure Blob Storage account. Incompatible with `service_principal_id` and `service_principal_key`.
     * 
     */
    public Output<Optional<Boolean>> useManagedIdentity() {
        return Codegen.optional(this.useManagedIdentity);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public LinkedServiceAzureBlobStorage(String name) {
        this(name, LinkedServiceAzureBlobStorageArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public LinkedServiceAzureBlobStorage(String name, LinkedServiceAzureBlobStorageArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public LinkedServiceAzureBlobStorage(String name, LinkedServiceAzureBlobStorageArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:datafactory/linkedServiceAzureBlobStorage:LinkedServiceAzureBlobStorage", name, args == null ? LinkedServiceAzureBlobStorageArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private LinkedServiceAzureBlobStorage(String name, Output<String> id, @Nullable LinkedServiceAzureBlobStorageState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:datafactory/linkedServiceAzureBlobStorage:LinkedServiceAzureBlobStorage", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .additionalSecretOutputs(List.of(
                "connectionString",
                "sasUri",
                "serviceEndpoint"
            ))
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static LinkedServiceAzureBlobStorage get(String name, Output<String> id, @Nullable LinkedServiceAzureBlobStorageState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new LinkedServiceAzureBlobStorage(name, id, state, options);
    }
}
