Git Product home page Git Product logo

azureconnectedmachinedsc's Introduction

Azure Connected Machine module for Windows PowerShell DSC

This repository contains the module for Windows PowerShell Desired State Configuration to install and configure the Azure Connected Machine Agent.

This module is community supported, not an official Microsoft production/solution.

Contents

The files and folders in this repo include:

File/folder Description
examples Folder containing configuration examples
test Folder containing unit and integration tests
AzureConnectedMachineDsc.psd1 Module manifest
AzureConnectedMachineDsc.psm1 PowerShell module
CHANGELOG.md List of changes to the sample
CODE_OF_CONDUCT.md Code of conduct for project contribution
README.md This README file
LICENSE The license for the project

Resources included in this module

  • AzureConnectedMachineAgentDsc: Used to automate configuration of the Azure Connected Machine Agent including validation of the connection to Azure and the metadata such as the Resource Group and Tags information.
  • AzcmagentConfig: Used to configure settings on the Azure Connected Machine Agent.

Requirements

The minimum PowerShell version required is 5.1.

Setup

To manually install the module, download the source code and unzip the contents of the project directory to the $env:ProgramFiles\WindowsPowerShell\Modules folder.

To install from the PowerShell gallery using PowerShellGet (in PowerShell 5.0) run the following command:

Find-Module -Name AzureConnectedMachineDsc -Repository PSGallery | Install-Module

To confirm installation, run the below command and ensure you see the Azure Connected Machine DSC resoures available:

Get-DscResource -Module AzureConnectedMachineDsc

Examples

The resources in this module are intended to manage the Azure Connected Machine Agent configuration. A complete example is provided that also uses community resources to download and install the agent, and to verify the state of the agent service.

PowerShell script:

& .\examples\AzureConnectedMachineAgent.ps1

The Azure Connected Machine Agent supports connecting through an http proxy service. The proxy details are provided to the agent using envionment variables, which could also be managed by DSC using the ComputeManagementDsc module. For more information on the proxy details, see the documentation for Azure Connect Machine Agent.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

azureconnectedmachinedsc's People

Contributors

mgreenegit avatar microsoft-github-operations[bot] avatar microsoftopensource avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azureconnectedmachinedsc's Issues

Error when reconnecting arc agent

When reconnecting the arc agent through DSC (say because you've changed resource group for example) it currently throws the following error:

VERBOSE: [FOO01]:                            [[AzureConnectedMachineAgentDsc]ConnectToArc] Machine FOO01 is already onboarded. 
 Disconnecting, restarting service, and reconnecting.               Error: unknown flag: --resource-name
    + CategoryInfo          : NotSpecified: (Error: unknown flag: --resource-name:) [], CimException
    + FullyQualifiedErrorId : NativeCommandError
    + PSComputerName        : foo01

Usage:
  azcmagent disconnect [flags]
Flags:
     --access-token string               Access token
  -f, --force-local-only                  Delete local state only
  -p, --service-principal-secret string   Service Principal Secret
  -v, --verbose   Increase logging verbosity to show all logs
VERBOSE: [FOO01]:                            [[AzureConnectedMachineAgentDsc]ConnectToArc] Attempting to register machine.
The PowerShell DSC resource '[AzureConnectedMachineAgentDsc]ConnectToArc' with SourceInfo
functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : foo01

I suspect some arguments were removed from the azcmagent disconnect command and in any case there seems to be a simple fix for this which is remove the arguments that are no longer needed. If I've time I will submit a PR for this one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.