{"id":20156252,"url":"https://github.com/dsccommunity/xazure","last_synced_at":"2025-09-21T06:46:11.792Z","repository":{"id":30468216,"uuid":"34022201","full_name":"dsccommunity/xAzure","owner":"dsccommunity","description":null,"archived":false,"fork":false,"pushed_at":"2019-05-08T23:24:18.000Z","size":72,"stargazers_count":7,"open_issues_count":4,"forks_count":15,"subscribers_count":25,"default_branch":"dev","last_synced_at":"2025-09-21T06:46:11.630Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsccommunity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-15T22:42:11.000Z","updated_at":"2024-09-01T23:08:15.000Z","dependencies_parsed_at":"2022-09-07T21:11:18.925Z","dependency_job_id":null,"html_url":"https://github.com/dsccommunity/xAzure","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dsccommunity/xAzure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FxAzure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FxAzure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FxAzure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FxAzure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsccommunity","download_url":"https://codeload.github.com/dsccommunity/xAzure/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FxAzure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276204831,"owners_count":25602738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T23:38:10.708Z","updated_at":"2025-09-21T06:46:11.746Z","avatar_url":"https://github.com/dsccommunity.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build status](https://ci.appveyor.com/api/projects/status/bx86bb6vuf6l3lwp/branch/master?svg=true)](https://ci.appveyor.com/project/PowerShell/xazure/branch/master)\r\n\r\n# xAzure\r\n\r\nThe **xAzure** module is a set of DSC resources that provide a method of depoying virtual machines in Microsoft Azure by applying a configuration to your local machine.\r\nThis is primarily intended to enable testing how a new virtual machine can be used to evaluate a scenario or application without consuming resources from the local machine.\r\n\r\n\r\n This module includes 6 DSC resources that automate provisioning of resources in Microsoft Azure.\r\n\r\n*   **xAzureAffinityGroup** defines the relationship between compute and storage\r\n*   **xAzureQuickVM** simple resource for creating VMs with limited options\r\n*   **xAzureService** creates a cloud service for the VMs\r\n*   **xAzureStorageAccount** creates the online storage account where the blobs for the test environment will reside\r\n*   **xAzureSubscription** sets the current Azure subscription context\r\n*   **xAzureVM** creates a virtual machine in Azure including access to VM Guest extensions\r\n*   **xAzureVMDscConfiguration** packages and uploads a DSC Configuration for the DSC Extension\r\n*   **xAzureVMDscExtension** uses the DSC Extension to apply a configuration within a VM\r\n*   **xAzureSqlDatabase** creates Azure SQL Database\r\n*   **xAzureSqlDatabaseServerFirewallRule** creates Azure SQL Database Server Firewall Rule\r\n\r\n**All of the resources in the DSC Resource Kit are provided AS IS, and are not supported through any Microsoft standard support program or service.\r\nThe \"\"x\" in xAzure stands for experimental**, which means that these resources will be **fix forward** and monitored by the module owner(s).\r\n\r\nPlease leave comments, feature requests, and bug reports in the Issues tab for this module.\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n\r\nIf you would like to modify **xAzure** module, feel free.\r\nWhen modifying, please update the module name, resource friendly name, and MOF class name (instructions below).\r\nAs specified in the license, you may copy or modify this resource as long as they are used on the Windows Platform.\r\n\r\nFor more information about Windows PowerShell Desired State Configuration, check out the blog posts on the [PowerShell Blog](http://blogs.msdn.com/b/powershell/) ([this](http://blogs.msdn.com/b/powershell/archive/2013/11/01/configuration-in-a-devops-world-windows-powershell-desired-state-configuration.aspx) is a good starting point).\r\nThere are also great community resources, such as [PowerShell.org](http://powershell.org/wp/tag/dsc/), or [PowerShell Magazine](http://www.powershellmagazine.com/tag/dsc/).\r\nFor more information on the DSC Resource Kit, check out [this blog post](http://go.microsoft.com/fwlink/?LinkID=389546).\r\n\r\n## Installation\r\n\r\nTo install **xAzure** module\r\n\r\n*   If you are using WMF4 / PowerShell Version 4: Unzip the content under `$env:ProgramFiles\\WindowsPowerShell\\Modules` folder\r\n*   If you are using WMF5 Preview: From an elevated PowerShell session run `Install-Module xAzure`\r\n\r\nTo confirm installation:\r\n\r\n*   Run **Get-DSCResource** to see that **xAzureAffinityGroup**, **xAzureQuickVM**, **xAzureVM**, and **xAzureVMDscExtension** are among the DSC Resources listed\r\n\r\n## Requirements\r\n\r\nThis module requires the latest version of PowerShell (v4.0, which ships in Windows 8.1 or Windows Server 2012R2).\r\nTo easily use PowerShell 4.0 on older operating systems, [install WMF](http://www.microsoft.com/en-us/download/details.aspx?id=40855).\r\nPlease read the installation instructions that are present on both the download page and the release notes for WMF 4.0.\r\n\r\n In addition, this module works based on the following assumptions:\r\n*   You have access to an Azure account.\r\nThis could be a trial account, a paid subscription, or Azure credit from an MSDN subscription.\r\n*   You have installed the Windows Azure PowerShell cmdlets package from [WebPI](http://www.microsoft.com/web/downloads/platform.aspx)\r\n*   You have downloaded your Publish Settings file (.publishsettings) using Get-AzurePublishSettingsFile and have copied to the working directory set in the Create and SetupSubscription example scripts.\r\n*   Open `.publishsettings` in Notepad and copy the name of the subscription to the Clipboard.\r\n*   Open the `.\\Create.ps1` script in the ExampleConfigScripts folder and update the name of your subscription and the location of your .publishsettings file in the xAzureSubscription section.\r\n\r\n## Resources\r\n\r\n### xAzureAffinityGroup\r\n\r\n*   **Name**: Specifies a name for the new affinity group that is unique to the subscription.\r\n*   **Ensure**: Specifies whether the Azure Affinity Group should be present or absent.\r\n*   **Location**: Specifies the geographical location of the data center where the affinity group will be created.\r\nThis must match a value from the Name property of objects returned by Get-AzureLocation.\r\n*   **Description**: Specifies a description for the affinity group.\r\nThe description may be up to 1024 characters in length.\r\n*   **Label**: Specifies a label for the affinity group.\r\nThe label may be up to 100 characters in length.\r\n\r\n### xAzureQuickVM\r\n\r\n*   **Name**: Specifies the name of the virtual machine.\r\n*   **Ensure**: Specifies whether the Azure VM should be present or absent.\r\n*   **ImageName**: Specifies the name of the operating system image to use to create the operating system disk.\r\n*   **ServiceName**: Specifies the new or existing service name.\r\n*   **Linux**: Creates a Linux virtual machine.\r\n*   **LinuxUser**: Specifies the Linux administrative account name to create.\r\n*   **Windows**: Creates a Windows virtual machine.\r\n*   **AdminUsername**: Specifies the name for the administrative account to create.\r\n*   **Password**: Specifies the password for the administrative account.\r\n*   **InstanceSize**: Specifies the size of the instance.\r\nFor a list of virtual machine sizes, see http://msdn.microsoft.com/library/azure/dn197896.aspx\r\n\r\n### xAzureService\r\n\r\n*   **ServiceName**: Specifies a name for the new cloud service that is unique to the subscription.\r\n*   **Ensure**: Specifies whether the Azure VM should be present or absent.\r\n*   **Description**: Specifies the Azure Affinity Group for the service\r\n*   **AffinityGroup**: Specifies a description for the service.\r\n*   **Label**: Specifies a label for the service.\r\n\r\n### xAzureSqlDatabase\r\n\r\n*   **Name**: Name of the database\r\n*   **MaximumSizeInGB**: Maximum size of the database in GB\r\n*   **Collation**: Collation of the database\r\n*   **Edition**: Edition of the database\r\n*   **ServerCredential**: Credential to the database server\r\n*   **ServerName**: Name of the database server\r\n*   **AzureSubscriptionName**: Specifies the name of the Azure subscription that should be set to Current\r\n*   **AzurePublishSettingsFile**: Specifies the location of the Publish Settings file for the Azure Subscription\r\n*   **Ensure**: Ensure that database is present or absent\r\n\r\n### xAzureSqlDatabaseServerFirewallRule\r\n\r\n*   **RuleName**: Name of the firewall rule\r\n*   **ServerName**: Name of the database server for which firewall rule should be created\r\n*   **StartIPAddress**: Start IP address of the firewall rule\r\n*   **EndIPAddress**: End IP address of the firewall rule\r\n*   **AzureSubscriptionName**: Specifies the name of the Azure subscription that should be set to Current\r\n*   **AzurePublishSettingsFile**: Specifies the location of the Publish Settings file for the Azure Subscription\r\n*   **Ensure**: Ensure that firewall rule is present or absent\r\n\r\n### xAzureStorageAccount\r\n\r\n*   **StorageAccountName**: Specifies a name for the storage account.\r\nThe storage account name must be unique to Windows Azure and must be between 3 and 24 characters in length and use lowercase letters and numbers only.\r\n*   **Ensure**: Specifies whether the Azure Storage Account should be present or absent.\r\n*   **AffinityGroup**: Specifies the name of an existing affinity group in the current subscription.\r\nYou can specify either a Location or an AffinityGroup parameter, but not both.\r\n*   **Container**: Specifies a name for the Container that should be created in the Azure Storage Account.\r\n*   **Folder**: Specifies a local folder.\r\nAll files in the root of the folder will be uploaded to the new container.\r\n*   **Label**: Specifies a label for the storage account.\r\nThe label may be up to 100 characters in length.\r\n\r\n### xAzureSubscription\r\n\r\n*   **Ensure**: Specifies whether the subscription should be present or absent.\r\n*   **AzureSubscriptionName**: Specifies the name of the Azure subscription that should be set to Current.\r\n*   **AzurePublishSettingsFile**: Specifies the location of the Publish Settings file for the Azure Subscription.\r\n\r\n### xAzureVM\r\n\r\n*   **Name**: Specifies the name of the virtual machine.\r\n*   **Ensure**: Specifies whether the Azure VM should be present or absent.\r\n*   **ImageName**: Specifies the name of the operating system image to use to create the operating system disk.\r\n*   **ServiceName**: Specifies the new or existing service name.\r\n*   **StorageAccountName**: Specifies the name of the storage account for the VM.\r\n*   **InstanceSize**: Specifies the size of the instance.\r\nFor a list of virtual machine sizes, see http://msdn.microsoft.com/library/azure/dn197896.aspx\r\n*   **Linux**: Creates a Linux virtual machine.\r\n*   **Windows**: Creates a Windows virtual machine.\r\n*   **Credential**: Specifies the credentials for the administrator account.\r\n*   **ExtensionContainerName**: The name of the Container in Azure Blob storage where the script files will reside.\r\nCase sensitive\r\n*   **ExtensionFileList**: List of files in Azure Blob container that should be copied in to the VM.\r\nCase sensitive.\r\n*   **ExtensionScriptName**: Name of one of the files in the container that will be exectued at startup.\r\nCase sensitive.\r\n\r\n### xAzureVMDscConfiguration\r\n\r\n*   **StorageAccountName**: Specifies the name of the storage account for the VM.\r\n*   **Ensure**: Specifies whether the Azure VM should be present or absent.\r\n*   **ContainerName**: Specifies the name of the Container in the Azure Storage Account.\r\n*   **ConfigurationPath**: Specifies location of the Dsc Configuration document.\r\n*   **AzureSubscriptionName**: Specifies the name of the Azure subscription that should be set to Current.\r\n*   **AzurePublishSettingsFile**: Specifies the location of the Publish Settings file for the Azure Subscription.\r\n*   **BlobURI**: Absolute Uri of the Blob.\r\n\r\n### xAzureVMDscExtension\r\n\r\n*   **VmName**: Specifies name of the VM.\r\nThis is used together with ServiceName to construct a persistent vm object.\r\n*   **ServiceName**: Specifies name of the Service where the VM is deployed.\r\n*   **ConfigurationArchive**: The name of the configuration package .zip file that was previously uploaded by Publish-AzureVMDscConfiguration.\r\nThis parameter must specify only the name of the file, without any path.\r\n*   **StorageAccountName**: Specifies the name of the Storage Account used to create the Storage Context.\r\nThe Azure Storage Context provides the security settings used to access the configuration script.\r\nThis context should provide read access to the container specified by ContainerName.\r\n*   **ConfigurationArgument**: A hashtable specifying the arguments to the configuration function.\r\nThe keys correspond to the parameter names and the values to the parameter values.\r\n*   **ConfigurationDataPath**: The path to a .psd1 file that specifies the data for the configuration function.\r\n*   **Configuration**: SName of the configuration script or module that will be invoked by the DSC Extension.\r\n*   **ContainerName**: Name of the Azure Storage Container where the ConfigurationArchive is located.\r\n*   **Force**: By default xAzureVMDscExtension will not overwrite any existing blobs.\r\nUse -Force to overwrite them.\r\n*   **ReferenceName**: The Extension Reference Name\r\n*   **StorageEndpointSuffix**: The DNS endpoint suffix for all storage services, e.g.\r\ncore.windows.net.\r\n*   **Version**: The specific version of the DSC Extension to use.\r\nIf not given, it will default to 1.*\r\n*   **TimeStamp**: Returns the timestamp of the last DSC Extension execution.\r\n*   **Code**: Returns the message code for the latest oepration by the DSC Extension.\r\n*   **Message**: Returns the formatted message string for the latest operation by the DSC Extension.\r\n*   **Status**: Returns the state of the DSC Extension from Azure.\r\n\r\n## Versions\r\n\r\n### Unreleased\r\n\r\n* Update appveyor.yml to use the default template.\r\n* Added default template files .codecov.yml, .gitattributes, and .gitignore, and\r\n  .vscode folder.\r\n\r\n### 0.2.0.0\r\n\r\n* Fixed file encodings\r\n\r\n### 0.1.3\r\n\r\n*   Introduce **xAzureDSCExtension**, **xAzureVMDscConfiguration**\r\n*   Minor bug fix in **xAzureStorageAccount** to make Folder no longer a mandatory propert\r\n\r\n### 0.1.2\r\n\r\n Release with the following resources\r\n*   **xAzureSqlDatabase** creates Azure SQL Database\r\n*   **xAzureSqlDatabaseServerFirewallRule** creates Azure SQL Database Server Firewall Rule\r\n\r\n### 0.1.0\r\n\r\n Initial release with the following resources\r\n*   **xAzureAffinityGroup** defines the relationship between compute and storage\r\n*   **xAzureQuickVM** simple resource for creating VMs with limited options\r\n*   **xAzureService** creates a cloud service for the VMs\r\n*   **xAzureStorageAccount** creates the online storage account where the blobs for the test environment will reside\r\n*   **xAzureSubscription** sets the current Azure subscription context\r\n*   **xAzureVM**creates a virtual machine in Azure including access to VM Guest extensions\r\n\r\n## Examples\r\n\r\nThe 'Examples' folder within the payload includes example configurations for common work streams:\r\n\r\n*   **LCMApplyOnly** - Set the local DSC configuration to only apply configurations and not monitor or re-apply automatically\r\n*   **Create** - Create environment including virtual machine\r\n*   **Create_SqlDatabase** - Create Azure SQL Database\r\n*   **Create_FirwallRule** - Create Azure SQL Database Server Firewall Rule\r\n*   **Destroy** - Destroy everything created in by the Create script\r\n*   **Remove** - Remove just the VM's and their VHD files from the test environment but leave the Affinity Group, Storage Account, and Cloud Service (quick re-provision scenario)\r\n*   **SetupSubscription** - Setup the Azure subscription (remember that DSC is running as Local System)\r\n*   **Status** - Retrieve information about a VM and optionally download the .rdp file, install the certificate, and create a reference PS remote file\r\n\r\n**Understanding the INSTANCE ID: **\r\n Instance ID - The Create script uses the last 10 places of the .NET time format named 'Ticks' to create a unique identifer for the accounts.\r\nThis is required because storage and service names must be globally unique - not just for your account - across all Azure customers.\r\nThe last step of the Create script is to return this number to the pipeline (along with the DSC output).\r\n\r\n You can capture the Instance ID by copying and pasting it from the PowerShell window, by copying and pasting it from the Azure website by opening the Cloud Service and selecting it from the title text, or you can automatically capture it from the pipeline using a variable.\r\n\r\n```powershell\r\n$test = .\\Create.ps1 # In this example, the Instance ID would be returned as $test[1]\r\n.\\Status.ps1 $test[1] -ConnectionFiles * In this example, the status of the VM is checked using the pipeline value.\r\n```\r\n\r\n**Note on credentials: **\r\n When running the `.\\Create.ps1` script, there is an immediate prompt for credentials.\r\nThe value collected here will be used to create the account inside the VM that is added to the local administrators group.\r\n\r\n **Note** - the password will be stored in clear text inside the MOF file in the example, however the resource has been designed to work with encrypted credentials.\r\nFor more information see: http://blogs.msdn.com/b/powershell/archive/2014/01/31/want-to-secure-credentials-in-windows-powershell-desired-state-configuration.aspx\r\n\r\n**Understanding HOW TO TEST JEA:**\r\n As a side benefit of this solution it is possible to test PowerShell Just Enough Administration.\r\nWithin the ScriptExtensionFiles folder you will find a script named InstallJEA.ps1\\.\r\nThis delivers prerequisites for testing including downloads of the xJEA resource and WMF5, installing them both, and enabling remote access.\r\nYou have the option to remove comment blocks that would also execute steps inside the VM to configure JEA.\r\nThis provides flexibility to either test JEA on your own or have the script build out an endpoint automatically.\r\n\r\n## Contributing\r\nPlease check out common DSC Resources [contributing guidelines](https://github.com/PowerShell/DscResource.Kit/blob/master/CONTRIBUTING.md).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsccommunity%2Fxazure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsccommunity%2Fxazure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsccommunity%2Fxazure/lists"}