ansible / ansible.builtin / v2.9.17 / module / azure_rm_webapp Manage Web App instances | "added in version" 2.7 of ansible.builtin" Authors: Yunge Zhu (@yungezz) preview | supported by communityansible.builtin.azure_rm_webapp (v2.9.17) — module
pip
Install with pip install ansible==2.9.17
Create, update and delete instance of Web App.
- name: Create a windows web app with non-exist app service plan azure_rm_webapp: resource_group: myResourceGroup name: myWinWebapp plan: resource_group: myAppServicePlan_rg name: myAppServicePlan is_linux: false sku: S1
- name: Create a docker web app with some app settings, with docker image azure_rm_webapp: resource_group: myResourceGroup name: myDockerWebapp plan: resource_group: myAppServicePlan_rg name: myAppServicePlan is_linux: true sku: S1 number_of_workers: 2 app_settings: testkey: testvalue testkey2: testvalue2 container_settings: name: ansible/ansible:ubuntu1404
- name: Create a docker web app with private acr registry azure_rm_webapp: resource_group: myResourceGroup name: myDockerWebapp plan: myAppServicePlan app_settings: testkey: testvalue container_settings: name: ansible/ubuntu1404 registry_server_url: myregistry.io registry_server_user: user registry_server_password: pass
- name: Create a linux web app with Node 6.6 framework azure_rm_webapp: resource_group: myResourceGroup name: myLinuxWebapp plan: resource_group: myAppServicePlan_rg name: myAppServicePlan app_settings: testkey: testvalue frameworks: - name: "node" version: "6.6"
- name: Create a windows web app with node, php azure_rm_webapp: resource_group: myResourceGroup name: myWinWebapp plan: resource_group: myAppServicePlan_rg name: myAppServicePlan app_settings: testkey: testvalue frameworks: - name: "node" version: 6.6 - name: "php" version: "7.0"
- name: Create a stage deployment slot for an existing web app azure_rm_webapp: resource_group: myResourceGroup name: myWebapp/slots/stage plan: resource_group: myAppServicePlan_rg name: myAppServicePlan app_settings: testkey:testvalue
- name: Create a linux web app with java framework azure_rm_webapp: resource_group: myResourceGroup name: myLinuxWebapp plan: resource_group: myAppServicePlan_rg name: myAppServicePlan app_settings: testkey: testvalue frameworks: - name: "java" version: "8" settings: java_container: "Tomcat" java_container_version: "8.5"
name: description: - Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. required: true plan: description: - App service plan. Required for creation. - Can be name of existing app service plan in same resource group as web app. - Can be the resource ID of an existing app service plan. For example /subscriptions/<subs_id>/resourceGroups/<resource_group>/providers/Microsoft.Web/serverFarms/<plan_name>. - Can be a dict containing five parameters, defined below. - C(name), name of app service plan. - C(resource_group), resource group of the app service plan. - C(sku), SKU of app service plan, allowed values listed on U(https://azure.microsoft.com/en-us/pricing/details/app-service/linux/). - C(is_linux), whether or not the app service plan is Linux. defaults to C(False). - C(number_of_workers), number of workers for app service plan. tags: description: - Dictionary of string:string pairs to assign as metadata to the object. - Metadata tags on the object will be updated with any provided values. - To remove tags set append_tags option to false. type: dict state: choices: - absent - present default: present description: - State of the Web App. - Use C(present) to create or update a Web App and C(absent) to delete it. secret: description: - Azure client secret. Use when authenticating with a Service Principal. type: str tenant: description: - Azure tenant ID. Use when authenticating with a Service Principal. type: str ad_user: description: - Active Directory username. Use when authenticating with an Active Directory user rather than service principal. type: str profile: description: - Security profile found in ~/.azure/credentials file. type: str location: description: - Resource location. If not set, location from the resource group will be used as default. password: description: - Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. type: str scm_type: description: - Repository type of deployment source, for example C(LocalGit), C(GitHub). - List of supported values maintained at U(https://docs.microsoft.com/en-us/rest/api/appservice/webapps/createorupdate#scmtype). app_state: choices: - started - stopped - restarted default: started description: - Start/Stop/Restart the web app. type: str client_id: description: - Azure client ID. Use when authenticating with a Service Principal. type: str frameworks: description: - Set of run time framework settings. Each setting is a dictionary. - See U(https://docs.microsoft.com/en-us/azure/app-service/app-service-web-overview) for more info. suboptions: name: choices: - java - net_framework - php - python - ruby - dotnetcore - node description: - Name of the framework. - Supported framework list for Windows web app and Linux web app is different. - Windows web apps support C(java), C(net_framework), C(php), C(python), and C(node) from June 2018. - Windows web apps support multiple framework at the same time. - Linux web apps support C(java), C(ruby), C(php), C(dotnetcore), and C(node) from June 2018. - Linux web apps support only one framework. - Java framework is mutually exclusive with others. settings: description: - List of settings of the framework. suboptions: java_container: description: - Name of Java container. - Supported only when I(frameworks=java). Sample values C(Tomcat), C(Jetty). java_container_version: description: - Version of Java container. - Supported only when I(frameworks=java). - Sample values for C(Tomcat), C(8.0), C(8.5), C(9.0). For C(Jetty,), C(9.1), C(9.3). version: description: - Version of the framework. For Linux web app supported value, see U(https://aka.ms/linux-stacks) for more info. - C(net_framework) supported value sample, C(v4.0) for .NET 4.6 and C(v3.0) for .NET 3.5. - C(php) supported value sample, C(5.5), C(5.6), C(7.0). - C(python) supported value sample, C(5.5), C(5.6), C(7.0). - C(node) supported value sample, C(6.6), C(6.9). - C(dotnetcore) supported value sample, C(1.0), C(1.1), C(1.2). - C(ruby) supported value sample, C(2.3). - C(java) supported value sample, C(1.9) for Windows web app. C(1.8) for Linux web app. https_only: description: - Configures web site to accept only https requests. type: bool api_profile: default: latest description: - Selects an API profile to use when communicating with Azure services. Default value of C(latest) is appropriate for public clouds; future values will allow use with Azure Stack. type: str version_added: 0.0.1 version_added_collection: azure.azcollection append_tags: default: true description: - Use to control if tags field is canonical or just appends to existing tags. - When canonical, any tags not found in the tags parameter will be removed from the object's metadata. type: bool auth_source: choices: - auto - cli - credential_file - env - msi default: auto description: - Controls the source of the credentials to use for authentication. - Can also be set via the C(ANSIBLE_AZURE_AUTH_SOURCE) environment variable. - When set to C(auto) (the default) the precedence is module parameters -> C(env) -> C(credential_file) -> C(cli). - When set to C(env), the credentials will be read from the environment variables - When set to C(credential_file), it will read the profile from C(~/.azure/credentials). - When set to C(cli), the credentials will be sources from the Azure CLI profile. C(subscription_id) or the environment variable C(AZURE_SUBSCRIPTION_ID) can be used to identify the subscription ID if more than one is present otherwise the default az cli subscription is used. - When set to C(msi), the host machine must be an azure resource with an enabled MSI extension. C(subscription_id) or the environment variable C(AZURE_SUBSCRIPTION_ID) can be used to identify the subscription ID if the resource is granted access to more than one subscription, otherwise the first subscription is chosen. - The C(msi) was added in Ansible 2.6. type: str version_added: 0.0.1 version_added_collection: azure.azcollection app_settings: description: - Configure web app application settings. Suboptions are in key value pair format. startup_file: description: - The web's startup file. - Used only for Linux web apps. resource_group: description: - Name of the resource group to which the resource belongs. required: true ttl_in_seconds: description: - Time to live in seconds for web app default domain name. subscription_id: description: - Your Azure subscription Id. type: str dns_registration: description: - Whether or not the web app hostname is registered with DNS on creation. Set to C(false) to register. type: bool cloud_environment: default: AzureCloud description: - For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, C(AzureChinaCloud), C(AzureUSGovernment)), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the C(AZURE_CLOUD_ENVIRONMENT) environment variable. type: str version_added: 0.0.1 version_added_collection: azure.azcollection deployment_source: description: - Deployment source for git. suboptions: branch: description: - The branch name of the repository. url: description: - Repository url of deployment source. adfs_authority_url: description: - Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. type: str version_added: 0.0.1 version_added_collection: azure.azcollection container_settings: description: - Web app container settings. suboptions: name: description: - Name of container, for example C(imagename:tag). registry_server_password: description: - The container registry server password. registry_server_url: description: - Container registry server URL, for example C(mydockerregistry.io). registry_server_user: description: - The container registry server user name. purge_app_settings: description: - Purge any existing application settings. Replace web app application settings with app_settings. type: bool cert_validation_mode: choices: - ignore - validate description: - Controls the certificate validation behavior for Azure endpoints. By default, all modules will validate the server certificate, but when an HTTPS proxy is in use, or against Azure Stack, it may be necessary to disable this behavior by passing C(ignore). Can also be set via credential file profile or the C(AZURE_CERT_VALIDATION) environment variable. type: str version_added: 0.0.1 version_added_collection: azure.azcollection client_affinity_enabled: default: true description: - Whether or not to send session affinity cookies, which route client requests in the same session to the same instance. type: bool skip_custom_domain_verification: description: - Whether or not to skip verification of custom (non *.azurewebsites.net) domains associated with web app. Set to C(true) to skip. type: bool
azure_webapp: description: - ID of current web app. returned: always sample: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp type: str