The Azure cloud module is used to control access to Microsoft Azure
Warning
This cloud provider will be removed from Salt in version 3007 due to the deprecation of the "Classic" API for Azure. Please migrate to Azure Resource Manager by March 1, 2023
Microsoft Azure SDK for Python >= 1.0.2
python-requests, for Python < 2.7.9
Required provider parameters:
apikey
certificate_path
subscription_id
backend
A Management Certificate (.pem and .crt files) must be created and the .pem file placed on the same machine that salt-cloud is run from. Information on creating the pem file to use, and uploading the associated cer file can be found at:
http://www.windowsazure.com/en-us/develop/python/how-to-guides/service-management/
For users with Python < 2.7.9, backend
must currently be set to requests
.
Example /etc/salt/cloud.providers
or
/etc/salt/cloud.providers.d/azure.conf
configuration:
my-azure-config:
driver: azure
subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617
certificate_path: /etc/salt/azure.pem
management_host: management.core.windows.net
New in version 2015.8.0.
Add an input endpoint to the deployment. Please note that there may be a delay before the changes show up.
CLI Example:
salt-cloud -f add_input_endpoint my-azure service=myservice \
deployment=mydeployment role=myrole name=HTTP local_port=80 \
port=80 protocol=tcp enable_direct_server_return=False \
timeout_for_tcp_idle_connection=4
New in version 2015.8.0.
Add a new management certificate
CLI Example:
salt-cloud -f add_management_certificate my-azure public_key='...PUBKEY...' \
thumbprint=0123456789ABCDEF data='...CERT_DATA...'
New in version 2015.8.0.
Add a new service certificate
CLI Example:
salt-cloud -f add_service_certificate my-azure name=my_service_certificate \
data='...CERT_DATA...' certificate_format=sha1 password=verybadpass
List available images for Azure
List available locations for Azure
Return a list of sizes from Azure
New in version 2015.8.0.
Cleans up all disks associated with the account, which are not attached. * CAUTION * This is a destructive function with no undo button, and no "Are you sure?" confirmation!
CLI Examples:
salt-cloud -f cleanup_unattached_disks my-azure name=my_disk
salt-cloud -f cleanup_unattached_disks my-azure name=my_disk delete_vhd=True
Create a single VM from a data dict
New in version 2015.8.0.
Create a new affinity group
CLI Example:
salt-cloud -f create_affinity_group my-azure name=my_affinity_group
Create and attach volumes to created node
New in version 2015.8.0.
Create a new hosted service
CLI Example:
salt-cloud -f create_service my-azure name=my_service label=my_service location='West US'
New in version 2015.8.0.
Create a new storage account
CLI Example:
salt-cloud -f create_storage my-azure name=my_storage label=my_storage location='West US'
New in version 2015.8.0.
Create a storage container
CLI Example:
salt-cloud -f create_storage_container my-azure name=mycontainer
Name of container to create.
Optional. A dict with name_value pairs to associate with the container as metadata. Example:{'Category':'test'}
Optional. Possible values include: container, blob
Specify whether to throw an exception when the container exists.
New in version 2015.8.0.
Delete a specific affinity group associated with the account
CLI Examples:
salt-cloud -f delete_affinity_group my-azure name=my_affinity_group
New in version 2015.8.0.
Delete a specific disk associated with the account
CLI Examples:
salt-cloud -f delete_disk my-azure name=my_disk
salt-cloud -f delete_disk my-azure name=my_disk delete_vhd=True
New in version 2015.8.0.
Delete an input endpoint from the deployment. Please note that there may be a delay before the changes show up.
CLI Example:
salt-cloud -f delete_input_endpoint my-azure service=myservice \
deployment=mydeployment role=myrole name=HTTP
New in version 2015.8.0.
Delete a specific certificate associated with the management
CLI Examples:
salt-cloud -f delete_management_certificate my-azure name=my_management_certificate \
thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
New in version 2015.8.0.
Delete a specific service associated with the account
CLI Examples:
salt-cloud -f delete_service my-azure name=my_service
New in version 2015.8.0.
Delete a specific certificate associated with the service
CLI Examples:
salt-cloud -f delete_service_certificate my-azure name=my_service_certificate \
thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
New in version 2015.8.0.
Delete a specific storage account
CLI Examples:
salt-cloud -f delete_storage my-azure name=my_storage
New in version 2015.8.0.
Delete a container associated with the storage account
CLI Example:
salt-cloud -f delete_storage_container my-azure name=mycontainer
Name of container to create.
Specify whether to throw an exception when the container exists.
If specified, delete_storage_container only succeeds if the container's lease is active and matches this ID.
Destroy a VM
CLI Examples:
salt-cloud -d myminion
salt-cloud -a destroy myminion service_name=myservice
New in version 2015.8.0.
Show an affinity group associated with the account
CLI Example:
salt-cloud -f show_affinity_group my-azure service=myservice \
deployment=mydeployment name=SSH
New in version 2015.8.0.
Download a blob
CLI Example:
salt-cloud -f get_blob my-azure container=base name=top.sls local_path=/srv/salt/top.sls
salt-cloud -f get_blob my-azure container=base name=content.txt return_content=True
Name of existing container.
Name of existing blob.
The path on the local machine to download the blob to. Either this or return_content must be specified.
Whether or not to return the content directly from the blob. If specified, must be True or False. Either this or the local_path must be specified.
Optional. The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve.
Required if the blob has an active lease.
callback for progress with signature function(current, total) where current is the number of bytes transferred so far, and total is the size of the blob.
Maximum number of parallel connections to use when the blob size exceeds 64MB. Set to 1 to download the blob chunks sequentially. Set to 2 or more to download the blob chunks in parallel. This uses more system resources but will download faster.
Number of times to retry download of blob chunk if an error occurs.
Sleep time in secs between retries.
New in version 2015.8.0.
Returns all user-defined metadata, standard HTTP properties, and system properties for the blob.
CLI Example:
salt-cloud -f show_blob_properties my-azure container=mycontainer blob=myblob
Name of existing container.
Name of existing blob.
Required if the blob has an active lease.
New in version 2015.8.0.
Show a blob's service properties
CLI Example:
salt-cloud -f show_blob_service_properties my-azure
Return the first configured instance.
Return a conn object for the passed VM data
Warn if dependencies aren't met.
New in version 2015.8.0.
Return information about a deployment
CLI Example:
salt-cloud -f show_deployment my-azure name=my_deployment
New in version 2015.8.0.
Return information about a disk
CLI Example:
salt-cloud -f show_disk my-azure name=my_disk
New in version 2015.8.0.
Show an input endpoint associated with the deployment
CLI Example:
salt-cloud -f show_input_endpoint my-azure service=myservice \
deployment=mydeployment name=SSH
New in version 2015.8.0.
Return information about a management_certificate
CLI Example:
salt-cloud -f get_management_certificate my-azure name=my_management_certificate \
thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
New in version 2015.8.0.
Get Operation Status, based on a request ID
CLI Example:
salt-cloud -f get_operation_status my-azure id=0123456789abcdef0123456789abcdef
New in version 2015.8.0.
Return information about a service certificate
CLI Example:
salt-cloud -f show_service_certificate my-azure name=my_service_certificate \
thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
New in version 2015.8.0.
List storage service properties
CLI Example:
salt-cloud -f show_storage my-azure name=my_storage
New in version 2015.8.0.
Return a storage_conn object for the storage account
New in version 2015.8.0.
Show a container associated with the storage account
CLI Example:
salt-cloud -f show_storage_container my-azure name=myservice
Name of container to show.
New in version 2015.8.0.
Show a storage container's acl
CLI Example:
salt-cloud -f show_storage_container_acl my-azure name=myservice
Name of existing container.
If specified, show_storage_container_acl only succeeds if the container's lease is active and matches this ID.
New in version 2015.8.0.
Show a storage container's metadata
CLI Example:
salt-cloud -f show_storage_container_metadata my-azure name=myservice
Name of container to show.
If specified, show_storage_container_metadata only succeeds if the container's lease is active and matches this ID.
New in version 2015.8.0.
Show storage account keys
CLI Example:
salt-cloud -f show_storage_keys my-azure name=my_storage
New in version 2015.8.0.
Lease a container associated with the storage account
CLI Example:
salt-cloud -f lease_storage_container my-azure name=mycontainer
Name of container to create.
Required. Possible values: acquire|renew|release|break|change
Required if the container has an active lease.
Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or change. For backwards compatibility, the default is 60, and the value is only used on an acquire operation.
Optional. For a break operation, this is the proposed duration of seconds that the lease should continue before it is broken, between 0 and 60 seconds. This break period is only used if it is shorter than the time remaining on the lease. If longer, the time remaining on the lease is used. A new lease will not be available before the break period has expired, but the lease may be held for longer than the break period. If this header does not appear with a break operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks immediately.
Optional for acquire, required for change. Proposed lease ID, in a GUID string format.
New in version 2015.8.0.
List input endpoints associated with the deployment
CLI Example:
salt-cloud -f list_affinity_groups my-azure
New in version 2015.8.0.
List blobs associated with the container
CLI Example:
salt-cloud -f list_blobs my-azure container=mycontainer
The name of the storage container
Optional. Filters the results to return only blobs whose names begin with the specified prefix.
Optional. A string value that identifies the portion of the list to be returned with the next list operation. The operation returns a marker value within the response body if the list returned was not complete. The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to the client.
Optional. Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specify maxresults or specifies a value greater than 5,000, the server will return up to 5,000 items. Setting maxresults to a value less than or equal to zero results in error response code 400 (Bad Request).
Optional. Specifies one or more datasets to include in the response. To specify more than one of these options on the URI, you must separate each option with a comma. Valid values are:
Specifies that snapshots should be included in the enumeration. Snapshots are listed from oldest to newest in the response.
Specifies that blob metadata be returned in the response.
Specifies that blobs for which blocks have been uploaded, but which have not been committed using Put Block List (REST API), be included in the response.
Version 2012-02-12 and newer. Specifies that metadata related to any current or previous Copy Blob operation should be included in the response.
Optional. When the request includes this parameter, the operation returns a BlobPrefix element in the response body that acts as a placeholder for all blobs whose names begin with the same substring up to the appearance of the delimiter character. The delimiter may be a single character or a string.
New in version 2015.8.0.
List disks associated with the account
CLI Example:
salt-cloud -f list_disks my-azure
List VMs on this Azure account, with full information
New in version 2015.8.0.
List input endpoints associated with the deployment
CLI Example:
salt-cloud -f list_input_endpoints my-azure service=myservice deployment=mydeployment
New in version 2015.8.0.
List management certificates associated with the subscription
CLI Example:
salt-cloud -f list_management_certificates my-azure name=my_management
List VMs on this Azure account
List VMs on this Azure account, with full information
Return a list of the VMs that are on the provider, with select fields
New in version 2015.8.0.
List certificates associated with the service
CLI Example:
salt-cloud -f list_service_certificates my-azure name=my_service
New in version 2015.8.0.
List hosted services associated with the account
CLI Example:
salt-cloud -f list_services my-azure
New in version 2015.8.0.
List storage accounts associated with the account
CLI Example:
salt-cloud -f list_storage my-azure
New in version 2015.8.0.
List containers associated with the storage account
CLI Example:
salt-cloud -f list_storage_containers my-azure
List VMs on this Azure account, with full information
New in version 2015.8.0.
List input endpoints associated with the deployment
CLI Example:
salt-cloud -f list_virtual_networks my-azure service=myservice deployment=mydeployment
New in version 2015.8.0.
Creates the URL to access a blob
CLI Example:
salt-cloud -f make_blob_url my-azure container=mycontainer blob=myblob
Name of the container.
Name of the blob.
Name of the storage account. If not specified, derives the host base from the provider configuration.
Protocol to use: 'http' or 'https'. If not specified, derives the host base from the provider configuration.
Live host base URL. If not specified, derives the host base from the provider configuration.
New in version 2015.8.0.
Upload a blob
CLI Examples:
salt-cloud -f put_blob my-azure container=base name=top.sls blob_path=/srv/salt/top.sls
salt-cloud -f put_blob my-azure container=base name=content.txt blob_content='Some content'
Name of existing container.
Name of existing blob.
The path on the local machine of the file to upload as a blob. Either this or blob_content must be specified.
The actual content to be uploaded as a blob. Either this or blob_path must me specified.
Optional. The Blob service stores this value but does not use or modify it.
Optional. Specifies the natural languages used by this resource.
Optional. An MD5 hash of the blob content. This hash is used to verify the integrity of the blob during transport. When this header is specified, the storage service checks the hash that has arrived with the one that was sent. If the two hashes do not match, the operation will fail with error code 400 (Bad Request).
Optional. Set the blob's content type.
Optional. Set the blob's content encoding.
Optional. Set the blob's content language.
Optional. Set the blob's MD5 hash.
Optional. Sets the blob's cache control.
A dict containing name, value for metadata.
Required if the blob has an active lease.
Perform a query directly against the Azure REST API
New in version 2015.8.0.
Regenerate storage account keys. Requires a key_type ("primary" or "secondary") to be specified.
CLI Example:
salt-cloud -f regenerate_storage_keys my-azure name=my_storage key_type=primary
Return the script deployment object
New in version 2015.8.0.
Set a blob's properties
CLI Example:
salt-cloud -f set_blob_properties my-azure
Name of existing container.
Name of existing blob.
Optional. Modifies the cache control string for the blob.
Optional. Sets the blob's content type.
Optional. Sets the blob's MD5 hash.
Optional. Sets the blob's content encoding.
Optional. Sets the blob's content language.
Required if the blob has an active lease.
Optional. Sets the blob's Content-Disposition header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified.
New in version 2015.8.0.
Sets the properties of a storage account's Blob service, including Windows Azure Storage Analytics. You can also use this operation to set the default request version for all incoming requests that do not have a version specified.
CLI Example:
salt-cloud -f set_blob_service_properties my-azure
a StorageServiceProperties object.
Optional. The timeout parameter is expressed in seconds.
New in version 2015.8.0.
Set a storage container's acl
CLI Example:
salt-cloud -f set_storage_container my-azure name=mycontainer
Name of existing container.
SignedIdentifers instance
Optional. Possible values include: container, blob
If specified, set_storage_container_acl only succeeds if the container's lease is active and matches this ID.
New in version 2015.8.0.
Set a storage container's metadata
CLI Example:
salt-cloud -f set_storage_container my-azure name=mycontainer \
x_ms_meta_name_values='{"my_name": "my_value"}'
Name of existing container.
A dict containing name, value for metadata. Example: {'category':'test'}
If specified, set_storage_container_metadata only succeeds if the container's lease is active and matches this ID.
New in version 2015.8.0.
Show an affinity group associated with the account
CLI Example:
salt-cloud -f show_affinity_group my-azure service=myservice \
deployment=mydeployment name=SSH
New in version 2015.8.0.
Returns all user-defined metadata, standard HTTP properties, and system properties for the blob.
CLI Example:
salt-cloud -f show_blob_properties my-azure container=mycontainer blob=myblob
Name of existing container.
Name of existing blob.
Required if the blob has an active lease.
New in version 2015.8.0.
Show a blob's service properties
CLI Example:
salt-cloud -f show_blob_service_properties my-azure
New in version 2015.8.0.
Return information about a deployment
CLI Example:
salt-cloud -f show_deployment my-azure name=my_deployment
New in version 2015.8.0.
Return information about a disk
CLI Example:
salt-cloud -f show_disk my-azure name=my_disk
New in version 2015.8.0.
Show an input endpoint associated with the deployment
CLI Example:
salt-cloud -f show_input_endpoint my-azure service=myservice \
deployment=mydeployment name=SSH
Show the details from the provider concerning an instance
New in version 2015.8.0.
Return information about a management_certificate
CLI Example:
salt-cloud -f get_management_certificate my-azure name=my_management_certificate \
thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
New in version 2015.8.0.
List hosted service properties
CLI Example:
salt-cloud -f show_service my-azure name=my_service
New in version 2015.8.0.
Return information about a service certificate
CLI Example:
salt-cloud -f show_service_certificate my-azure name=my_service_certificate \
thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
New in version 2015.8.0.
List storage service properties
CLI Example:
salt-cloud -f show_storage my-azure name=my_storage
New in version 2015.8.0.
Show a container associated with the storage account
CLI Example:
salt-cloud -f show_storage_container my-azure name=myservice
Name of container to show.
New in version 2015.8.0.
Show a storage container's acl
CLI Example:
salt-cloud -f show_storage_container_acl my-azure name=myservice
Name of existing container.
If specified, show_storage_container_acl only succeeds if the container's lease is active and matches this ID.
New in version 2015.8.0.
Show a storage container's metadata
CLI Example:
salt-cloud -f show_storage_container_metadata my-azure name=myservice
Name of container to show.
If specified, show_storage_container_metadata only succeeds if the container's lease is active and matches this ID.
New in version 2015.8.0.
Show storage account keys
CLI Example:
salt-cloud -f show_storage_keys my-azure name=my_storage
New in version 2015.8.0.
Update an affinity group's properties
CLI Example:
salt-cloud -f update_affinity_group my-azure name=my_group label=my_group
New in version 2015.8.0.
Update a disk's properties
CLI Example:
salt-cloud -f update_disk my-azure name=my_disk label=my_disk
salt-cloud -f update_disk my-azure name=my_disk new_name=another_disk
New in version 2015.8.0.
Update an input endpoint associated with the deployment. Please note that there may be a delay before the changes show up.
CLI Example:
salt-cloud -f update_input_endpoint my-azure service=myservice \
deployment=mydeployment role=myrole name=HTTP local_port=80 \
port=80 protocol=tcp enable_direct_server_return=False \
timeout_for_tcp_idle_connection=4
New in version 2015.8.0.
Update a storage account's properties
CLI Example:
salt-cloud -f update_storage my-azure name=my_storage label=my_storage