// *** 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.appservice;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.appservice.AppServiceArgs;
import com.pulumi.azure.appservice.inputs.AppServiceState;
import com.pulumi.azure.appservice.outputs.AppServiceAuthSettings;
import com.pulumi.azure.appservice.outputs.AppServiceBackup;
import com.pulumi.azure.appservice.outputs.AppServiceConnectionString;
import com.pulumi.azure.appservice.outputs.AppServiceIdentity;
import com.pulumi.azure.appservice.outputs.AppServiceLogs;
import com.pulumi.azure.appservice.outputs.AppServiceSiteConfig;
import com.pulumi.azure.appservice.outputs.AppServiceSiteCredential;
import com.pulumi.azure.appservice.outputs.AppServiceSourceControl;
import com.pulumi.azure.appservice.outputs.AppServiceStorageAccount;
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 an App Service (within an App Service Plan).
 * 
 * !&gt; **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.appservice.LinuxWebApp` resources instead.
 * 
 * &gt; **Note:** When using Slots - the `app_settings`, `connection_string` and `site_config` blocks on the `azure.appservice.AppService` resource will be overwritten when promoting a Slot using the `azure.appservice.ActiveSlot` resource.
 * 
 * ## Example Usage
 * 
 * This example provisions a Windows App Service.
 * ```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.appservice.Plan;
 * import com.pulumi.azure.appservice.PlanArgs;
 * import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
 * import com.pulumi.azure.appservice.AppService;
 * import com.pulumi.azure.appservice.AppServiceArgs;
 * import com.pulumi.azure.appservice.inputs.AppServiceSiteConfigArgs;
 * import com.pulumi.azure.appservice.inputs.AppServiceConnectionStringArgs;
 * 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());
 * 
 *         var examplePlan = new Plan(&#34;examplePlan&#34;, PlanArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .sku(PlanSkuArgs.builder()
 *                 .tier(&#34;Standard&#34;)
 *                 .size(&#34;S1&#34;)
 *                 .build())
 *             .build());
 * 
 *         var exampleAppService = new AppService(&#34;exampleAppService&#34;, AppServiceArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .appServicePlanId(examplePlan.id())
 *             .siteConfig(AppServiceSiteConfigArgs.builder()
 *                 .dotnetFrameworkVersion(&#34;v4.0&#34;)
 *                 .scmType(&#34;LocalGit&#34;)
 *                 .build())
 *             .appSettings(Map.of(&#34;SOME_KEY&#34;, &#34;some-value&#34;))
 *             .connectionStrings(AppServiceConnectionStringArgs.builder()
 *                 .name(&#34;Database&#34;)
 *                 .type(&#34;SQLServer&#34;)
 *                 .value(&#34;Server=some-server.mydomain.com;Integrated Security=SSPI&#34;)
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * App Services can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:appservice/appService:AppService instance1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/instance1
 * ```
 * 
 */
@ResourceType(type="azure:appservice/appService:AppService")
public class AppService extends com.pulumi.resources.CustomResource {
    /**
     * The ID of the App Service Plan within which to create this App Service.
     * 
     */
    @Export(name="appServicePlanId", refs={String.class}, tree="[0]")
    private Output<String> appServicePlanId;

    /**
     * @return The ID of the App Service Plan within which to create this App Service.
     * 
     */
    public Output<String> appServicePlanId() {
        return this.appServicePlanId;
    }
    /**
     * A key-value pair of App Settings.
     * 
     */
    @Export(name="appSettings", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output<Map<String,String>> appSettings;

    /**
     * @return A key-value pair of App Settings.
     * 
     */
    public Output<Map<String,String>> appSettings() {
        return this.appSettings;
    }
    /**
     * A `auth_settings` block as defined below.
     * 
     */
    @Export(name="authSettings", refs={AppServiceAuthSettings.class}, tree="[0]")
    private Output<AppServiceAuthSettings> authSettings;

    /**
     * @return A `auth_settings` block as defined below.
     * 
     */
    public Output<AppServiceAuthSettings> authSettings() {
        return this.authSettings;
    }
    /**
     * A `backup` block as defined below.
     * 
     */
    @Export(name="backup", refs={AppServiceBackup.class}, tree="[0]")
    private Output</* @Nullable */ AppServiceBackup> backup;

    /**
     * @return A `backup` block as defined below.
     * 
     */
    public Output<Optional<AppServiceBackup>> backup() {
        return Codegen.optional(this.backup);
    }
    /**
     * Should the App Service send session affinity cookies, which route client requests in the same session to the same instance?
     * 
     */
    @Export(name="clientAffinityEnabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> clientAffinityEnabled;

    /**
     * @return Should the App Service send session affinity cookies, which route client requests in the same session to the same instance?
     * 
     */
    public Output<Optional<Boolean>> clientAffinityEnabled() {
        return Codegen.optional(this.clientAffinityEnabled);
    }
    /**
     * Does the App Service require client certificates for incoming requests? Defaults to `false`.
     * 
     */
    @Export(name="clientCertEnabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> clientCertEnabled;

    /**
     * @return Does the App Service require client certificates for incoming requests? Defaults to `false`.
     * 
     */
    public Output<Optional<Boolean>> clientCertEnabled() {
        return Codegen.optional(this.clientCertEnabled);
    }
    /**
     * Mode of client certificates for this App Service. Possible values are `Required`, `Optional` and `OptionalInteractiveUser`. If this parameter is set, `client_cert_enabled` must be set to `true`, otherwise this parameter is ignored.
     * 
     */
    @Export(name="clientCertMode", refs={String.class}, tree="[0]")
    private Output<String> clientCertMode;

    /**
     * @return Mode of client certificates for this App Service. Possible values are `Required`, `Optional` and `OptionalInteractiveUser`. If this parameter is set, `client_cert_enabled` must be set to `true`, otherwise this parameter is ignored.
     * 
     */
    public Output<String> clientCertMode() {
        return this.clientCertMode;
    }
    /**
     * One or more `connection_string` blocks as defined below.
     * 
     */
    @Export(name="connectionStrings", refs={List.class,AppServiceConnectionString.class}, tree="[0,1]")
    private Output<List<AppServiceConnectionString>> connectionStrings;

    /**
     * @return One or more `connection_string` blocks as defined below.
     * 
     */
    public Output<List<AppServiceConnectionString>> connectionStrings() {
        return this.connectionStrings;
    }
    /**
     * An identifier used by App Service to perform domain ownership verification via DNS TXT record.
     * 
     */
    @Export(name="customDomainVerificationId", refs={String.class}, tree="[0]")
    private Output<String> customDomainVerificationId;

    /**
     * @return An identifier used by App Service to perform domain ownership verification via DNS TXT record.
     * 
     */
    public Output<String> customDomainVerificationId() {
        return this.customDomainVerificationId;
    }
    /**
     * The Default Hostname associated with the App Service - such as `mysite.azurewebsites.net`
     * 
     */
    @Export(name="defaultSiteHostname", refs={String.class}, tree="[0]")
    private Output<String> defaultSiteHostname;

    /**
     * @return The Default Hostname associated with the App Service - such as `mysite.azurewebsites.net`
     * 
     */
    public Output<String> defaultSiteHostname() {
        return this.defaultSiteHostname;
    }
    /**
     * Is the App Service Enabled? Defaults to `true`.
     * 
     */
    @Export(name="enabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> enabled;

    /**
     * @return Is the App Service Enabled? Defaults to `true`.
     * 
     */
    public Output<Optional<Boolean>> enabled() {
        return Codegen.optional(this.enabled);
    }
    /**
     * Can the App Service only be accessed via HTTPS? Defaults to `false`.
     * 
     */
    @Export(name="httpsOnly", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> httpsOnly;

    /**
     * @return Can the App Service only be accessed via HTTPS? Defaults to `false`.
     * 
     */
    public Output<Optional<Boolean>> httpsOnly() {
        return Codegen.optional(this.httpsOnly);
    }
    /**
     * An `identity` block as defined below.
     * 
     */
    @Export(name="identity", refs={AppServiceIdentity.class}, tree="[0]")
    private Output</* @Nullable */ AppServiceIdentity> identity;

    /**
     * @return An `identity` block as defined below.
     * 
     */
    public Output<Optional<AppServiceIdentity>> identity() {
        return Codegen.optional(this.identity);
    }
    /**
     * The User Assigned Identity Id used for looking up KeyVault secrets. The identity must be assigned to the application. [For more information see - Access vaults with a user-assigned identity](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references#access-vaults-with-a-user-assigned-identity)
     * 
     */
    @Export(name="keyVaultReferenceIdentityId", refs={String.class}, tree="[0]")
    private Output<String> keyVaultReferenceIdentityId;

    /**
     * @return The User Assigned Identity Id used for looking up KeyVault secrets. The identity must be assigned to the application. [For more information see - Access vaults with a user-assigned identity](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references#access-vaults-with-a-user-assigned-identity)
     * 
     */
    public Output<String> keyVaultReferenceIdentityId() {
        return this.keyVaultReferenceIdentityId;
    }
    /**
     * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="location", refs={String.class}, tree="[0]")
    private Output<String> location;

    /**
     * @return Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * A `logs` block as defined below.
     * 
     */
    @Export(name="logs", refs={AppServiceLogs.class}, tree="[0]")
    private Output<AppServiceLogs> logs;

    /**
     * @return A `logs` block as defined below.
     * 
     */
    public Output<AppServiceLogs> logs() {
        return this.logs;
    }
    /**
     * Specifies the name of the App Service. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return Specifies the name of the App Service. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * A list of outbound IP addresses - such as `[&#34;52.23.25.3&#34;, &#34;52.143.43.12&#34;]`
     * 
     */
    @Export(name="outboundIpAddressLists", refs={List.class,String.class}, tree="[0,1]")
    private Output<List<String>> outboundIpAddressLists;

    /**
     * @return A list of outbound IP addresses - such as `[&#34;52.23.25.3&#34;, &#34;52.143.43.12&#34;]`
     * 
     */
    public Output<List<String>> outboundIpAddressLists() {
        return this.outboundIpAddressLists;
    }
    /**
     * A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12`
     * 
     */
    @Export(name="outboundIpAddresses", refs={String.class}, tree="[0]")
    private Output<String> outboundIpAddresses;

    /**
     * @return A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12`
     * 
     */
    public Output<String> outboundIpAddresses() {
        return this.outboundIpAddresses;
    }
    /**
     * A list of outbound IP addresses - such as `[&#34;52.23.25.3&#34;, &#34;52.143.43.12&#34;, &#34;52.143.43.17&#34;]` - not all of which are necessarily in use. Superset of `outbound_ip_address_list`.
     * 
     */
    @Export(name="possibleOutboundIpAddressLists", refs={List.class,String.class}, tree="[0,1]")
    private Output<List<String>> possibleOutboundIpAddressLists;

    /**
     * @return A list of outbound IP addresses - such as `[&#34;52.23.25.3&#34;, &#34;52.143.43.12&#34;, &#34;52.143.43.17&#34;]` - not all of which are necessarily in use. Superset of `outbound_ip_address_list`.
     * 
     */
    public Output<List<String>> possibleOutboundIpAddressLists() {
        return this.possibleOutboundIpAddressLists;
    }
    /**
     * A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12,52.143.43.17` - not all of which are necessarily in use. Superset of `outbound_ip_addresses`.
     * 
     */
    @Export(name="possibleOutboundIpAddresses", refs={String.class}, tree="[0]")
    private Output<String> possibleOutboundIpAddresses;

    /**
     * @return A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12,52.143.43.17` - not all of which are necessarily in use. Superset of `outbound_ip_addresses`.
     * 
     */
    public Output<String> possibleOutboundIpAddresses() {
        return this.possibleOutboundIpAddresses;
    }
    /**
     * The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output<String> resourceGroupName;

    /**
     * @return The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * A `site_config` block as defined below.
     * 
     */
    @Export(name="siteConfig", refs={AppServiceSiteConfig.class}, tree="[0]")
    private Output<AppServiceSiteConfig> siteConfig;

    /**
     * @return A `site_config` block as defined below.
     * 
     */
    public Output<AppServiceSiteConfig> siteConfig() {
        return this.siteConfig;
    }
    /**
     * A `site_credential` block as defined below, which contains the site-level credentials used to publish to this App Service.
     * 
     */
    @Export(name="siteCredentials", refs={List.class,AppServiceSiteCredential.class}, tree="[0,1]")
    private Output<List<AppServiceSiteCredential>> siteCredentials;

    /**
     * @return A `site_credential` block as defined below, which contains the site-level credentials used to publish to this App Service.
     * 
     */
    public Output<List<AppServiceSiteCredential>> siteCredentials() {
        return this.siteCredentials;
    }
    /**
     * A Source Control block as defined below
     * 
     */
    @Export(name="sourceControl", refs={AppServiceSourceControl.class}, tree="[0]")
    private Output<AppServiceSourceControl> sourceControl;

    /**
     * @return A Source Control block as defined below
     * 
     */
    public Output<AppServiceSourceControl> sourceControl() {
        return this.sourceControl;
    }
    /**
     * One or more `storage_account` blocks as defined below.
     * 
     */
    @Export(name="storageAccounts", refs={List.class,AppServiceStorageAccount.class}, tree="[0,1]")
    private Output<List<AppServiceStorageAccount>> storageAccounts;

    /**
     * @return One or more `storage_account` blocks as defined below.
     * 
     */
    public Output<List<AppServiceStorageAccount>> storageAccounts() {
        return this.storageAccounts;
    }
    /**
     * A mapping of tags to assign to the resource.
     * 
     */
    @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output</* @Nullable */ Map<String,String>> tags;

    /**
     * @return A mapping of tags to assign to the resource.
     * 
     */
    public Output<Optional<Map<String,String>>> tags() {
        return Codegen.optional(this.tags);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public AppService(String name) {
        this(name, AppServiceArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public AppService(String name, AppServiceArgs 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 AppService(String name, AppServiceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:appservice/appService:AppService", name, args == null ? AppServiceArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private AppService(String name, Output<String> id, @Nullable AppServiceState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:appservice/appService:AppService", 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())
            .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 AppService get(String name, Output<String> id, @Nullable AppServiceState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new AppService(name, id, state, options);
    }
}
