ASQ.psd1
@{ # Script module or binary module file associated with this manifest. RootModule = 'ASQ.psm1' # Version number of this module. ModuleVersion = '0.1.5' # Supported PSEditions # CompatiblePSEditions = @() # ID used to uniquely identify this module GUID = '530ab7be-d3df-4881-8187-3eee9e4a9c36' # Author of this module Author = 'Baki Onur Okutucu - MVP' # Company or vendor of this module CompanyName = 'Clouderz' # Copyright statement for this module Copyright = '(c) Baki Onur Okutucu - MVP. All rights reserved.' # Description of the functionality provided by this module Description = @' ASQ (Azure Smart Queries) PowerShell Module This module provides the ability to generate reports out of Azure using a natural language via OpenAI within PowerShell Overview The ASQ (Azure Smart Queries) PowerShell Module is an automation tool designed to: - Deploy a pre-configured lab environment with required Azure resources. - Enable natural language queries against Azure services without requiring users to write Kusto Query Language (KQL). - By leveraging Azure OpenAI, this module translates user input into valid queries, executes them against Azure resources, and retrieves structured results, making it easier to generate reports and insights. Features - Automated Lab Deployment: Sets up an Azure Function App and an App Service Plan with required configurations. - Natural Language Queries: Allows users to query Azure resources using everyday language. - Azure OpenAI Integration: Converts natural language into structured queries for execution. - Pre-configured HTTP Trigger Function: A serverless function handles queries and interacts with Azure services. - Simplified Report Generation: Retrieves relevant data without writing complex queries. Dependencies & Prerequisites - Before using the query functionality, users must deploy the required lab environment. The module depends on: Azure OpenAI Service - Required for processing natural language input into valid KQL queries. - Existing OpenAI Service on Azure. - An active OpenAI deployment within an Azure subscription is required. User-Assigned Managed Identity - A user-assigned managed identity must have: - Reader or Log Analytics Reader role for querying logs. - Contributor access for deploying resources. - Azure OpenAI API access for processing queries. - App Service Plan & Azure Function The module automatically provisions: A Resource Group named AzureSmartQueriesXXXXXXX An App Service Plan An Azure Function App A pre-configured HTTP trigger function Installation: To install the ASQ module from PowerShell Gallery, run: Install-Module -Name ASQ Deployment of Lab Environment: Before running queries, users must first deploy the required Azure infrastructure using the following command: Invoke-ASQSetup This command will: ✔ Setup Azure Context, asking you to specify the names of UAMI and Azure OpenAI Instance and then connect to an Azure subscription interactively. It will store the context in a config file in \TEMP\ASQ\ folder ✔ Provision an App Service Plan ✔ Deploy an Azure Function App ✔ Configure a pre-set HTTP trigger function Once the deployment is complete, users can begin sending natural language queries using one of the following methods. Usage Example: Option 1 ASQ -query 'List all virtual networks across the tenant with their names and locations' Option 2 Azure function details will be displayed once the deployment is complete. You can also get the URI whenever you want by running Get-ASQUri cmdlet. Users can execute queries like: irm "FUNCTIONURI" -body '@{"query":"List all network security groups across the tenant with their names and locations"}' As long as you have the URI, you can obviously use it from anywhere like bash, vscode, terminal etc. Note: Once the deployment is finished, give the function app a couple of minutes to download and install dependencies such as required PowerShell modules '@ # Minimum version of the PowerShell engine required by this module PowerShellVersion = '7.1' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module # RequiredModules = @() # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = '*' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = '*' # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = '*' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = @("PowerShell", "GPT", "Azure", "OpenAI", "Agent", "Assistant", "AI") # A URL to the license for this module. # LicenseUri = '' # A URL to the main website for this project. # ProjectUri = '' # A URL to an icon representing this module. # IconUri = '' # ReleaseNotes of this module ReleaseNotes = 'Bug fixes and improvements including connecting to Azure and selecting the right subscription and storing the context for future use.' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' } |