Giter Site home page Giter Site logo

microsoftdocs / azure-docs-powershell Goto Github PK

View Code? Open in Web Editor NEW
228.0 42.0 383.0 116.18 MB

Repository used to store Azure PowerShell cmdlet content published on docs.ms.com reference site.

License: Creative Commons Attribution 4.0 International

PowerShell 75.00% Dockerfile 25.00%
hacktoberfest

azure-docs-powershell's Introduction

Azure PowerShell documentation

This repository contains the official product documentation for Azure PowerShell, published on learn.microsoft.com.

Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct.

Public contributions

We welcome public contributions to the Azure PowerShell documentation. There are two types of documentation hosted in this repository, with different workflows:

  • To submit a change for conceptual documentation (content in the docs-conceptual directory), make a pull request against this repository. Conceptual documentation is maintained for every supported version, so update all the affected versions.
  • To submit a change for current versions of reference documentation, submit a pull request against this repository. This only updates the online help available for current and previous versions.

NOTE: To submit a change for future versions of reference documentation, submit a pull request against azure/azure-powershell. The reference content for new versions of the Az PowerShell module is generated from the source code and is also used in the command-line help.

Please note that before we can accept your pull request you must sign our Contribution License Agreement. This is a one-time requirement.

azure-docs-powershell's People

Stargazers

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

Watchers

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

azure-docs-powershell's Issues

Login-AzureRmAccount : The term 'Connect-AzureRmAccount' is not recognized

Powershell installed via brew
and installed Azure Powershell per https://docs.microsoft.com/en-us/powershell/azure/install-azurermps-maclinux?view=azurermps-5.2.0

When I tried to login, I get the following error.

Login-AzureRmAccount : The term 'Connect-AzureRmAccount' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • Login-AzureRmAccount
  • CategoryInfo : ObjectNotFound: (Connect-AzureRmAccount:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException

Should Azure.Commands.*.Models classes be documented?

Hello!

I've noticed in the documentation that there are no links to the datatypes of any of the Model classes used to pass data or configuration to the Azure endpoints. After a quick inspection of the repository and that of the azure-powershell module, it seems like there is no documentation for these specific Powershell classes.

I think having model class reference documentation that is linked from the command documentation would be a valuable addition to the documentation. I know you can view the SDK model classes or the REST API schema in other documentation but that is an extra complication for users of the Powershell module to mentally map those structures to the Powershell equivalent.

Is this a change that would be welcome? Is there tooling available to the community to the generate the desired page templates from the Powershell module source files?

Checking which versions are installed

It would be helpful to include an example of how to check the version(s) that is/are installed, e.g.
Import-Module AzureRM
Get-Module -Name AzureRM


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Guidance on uninstalling older versions of Azure RM PS

"If you have an earlier version of the Azure PowerShell modules installed from the PowerShell Gallery and would like to update to the latest version, Update-Module installs the new version side-by-side with the old version. It does not remove the old version."
Ref: https://github.com/Azure/azure-powershell

My issue is that I have two versions installed side by side on my machine and I only want to maintain/keep latest version of it. So Can we have any proper documentation to uninstall the older versions (without effecting any other applications installed on my machine like VS Code or Visual studio).


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Save-AzureRmVMImage.md needs more detailed description of "-Path" parameter

In the doc of Save-AzureRMVMImage has following description of "-Path" parameter, which is very confusing:
Save-AzureRmVMImage.md

-Path
Specifies the path of the VHD.

Question is: what is the "path" of VHD? local path to save VHD copy locally?

But in the source code file, it has following help message:
SaveAzureVMImageCommand.cs

        [Parameter(
           Position = 5,
           ValueFromPipelineByPropertyName = true,
           HelpMessage = "**The file path in which the template of the captured image is stored**")]
        [ValidateNotNullOrEmpty]
        public string Path { get; set; }

The message in source code is totally different from the description message in the doc. Please make sure how on earth the "-Path" parameter is used.

New-AzureRmVirtualNetworkGateway.md

The changes that I made to the "New-AzureRmVirtualNetworkGateway" document are visible but I am not listed as a contributor - can you please advise?

No documentation or details on how to gather required information

I am trying to create recovery plans for roughly 300 servers using PowerShell. The plans are incredibly simple, literally the same as walking through the wizard. The problem I am having is finding out how to gather the variables that PS asks for.

For example. PrimaryFabric, I am hosting my servers internally and replicating to Azure. I have no idea how to find this value and I am finding nothing when looking on google or youtube. When I gathered the information on my existing failover plans they don't include this information.

How can I get the information I need to utilize PS for this purpose?

Connect-AzureRmAccount Cmdlet using Service Principal with Credential is throwing a error

Hi,
Am using Service Principal account along with ApplicationID, TenantID and Password to connect to my account by am getting an error as below

Cmd Used :
Connect-AzureRmAccount -ServicePrincipal -ApplicationId "appid" -Credential "pwd" -TenantId "tenantId"

Error :
Connect-AzureRmAccount : Cannot bind parameter 'Credential'. Cannot convert the "********" value of type "System.String" to type "System.Management.Automation.PSCredential".
At line:1 char:109

  • ... " -Credential "*******" -Tenant ...
  •                                                ~~~~~~~~~~~~~~
    
  • CategoryInfo : InvalidArgument: (:) [Connect-AzureRmAccount], ParameterBindingException
  • FullyQualifiedErrorId :CannotConvertArgumentNoMessage,Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand

Connect-AzureRmAccount Does Not Exist

I see this message when using the "Connect-AzureRmAccount": "The term 'Connect-AzureRmAccount' is not recognized as the name of a cmdlet, function, script file, or operable program." Check Issue #552: #552


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Get-AzureRmIoTHubConnectionString returns inaccurate Connection String syntax

When running the Get-AzureRmIoTHubConnectionString using standard parameters, all Connection Strings that are returned are showing the key/value pair for the Shared Access Key Name are displaying it as ShareAccessKeyName instead of SharedAccessKeyName.

This behavior is occuring in the Modules for Azure 4.1.0 and AzureRm.IoTHub 2.1.0, but not in modules Azure 4.0.2 and AzureRm.IoTHub 2.0.1 as shown below:

screenshot001

screenshot006

create azure ad application and change / set manifest and permissions

Hi,

I'm trying to automate the creation of the Azure AD Application for the project I'm working at this moment using "New-AzureRmADApplication". However, I could not find a way to change settings of the manifest (e.g "oauth2AllowImplicitFlow": true).

Also, I would like to find a way to specify the permissions for this application. Is there a way to achieve that using powershell?

What are credentials for a service principal?

What do you mean by 'service principal user ID and password', is it referring to the keys? I tried it and does not work.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Issue Get Azure VM status same commands but different status

The commands :
$vms = Get-AzureVM ( here have some information of Azure VM , the status of VM is : StoppedDeallocated )

But while foreach it

Foreach ($vm in $vms) {

// here I am printing the $vm with Vm status ( it displays stopped )
}
Issue Get Azure VM status same commands but different status

image

New-AzureRmWebAppSSLBinding failing with "Certificate was not found" on upload

I'm trying to upload a new SSL certificate and change the WebApp SSL binding using command:
New-AzureRmWebAppSSLBinding -ResourceGroupName (rgName) -WebAppName (waName) -Name (domain) -SslState SniEnabled -CertificateFilePath (pfxPath) -CertificatePassword (pfxPwd)

Unfortunately, this command is giving me error:
New-AzureRmWebAppSSLBinding : Certificate XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX was not found.
The listed thumbprint matches from the PFX file.

If I upload the file through the portal (using same login), the original command now works to attach the certificate.
So it seems like the upload isn't happening, and instead it's trying to attach by thumbprint.

Using v6.0.1 of AzureRM module.

Error when using the -Storagecontext parameter when running Set-AzureRmVMDiagnosticsExtension in Azure PowerShell 4

Code:

$Storagekey = (Get-AzureRmStorageAccountKey -ResourceGroupName $diagresourcegroupname -Name $diagstorageaccountname).Value[0]
$Storagecontext = New-AzureStorageContext -StorageAccountName $diagstorageaccountname -StorageAccountKey $Storagekey
$tempfile = "$env:temp\diagnosticsconfig.xml"
    
Set-AzureRmVMDiagnosticsExtension -ResourceGroupName $ResourceGroupName -VMName $VMName -StorageContext $Storagecontext -DiagnosticsConfigurationPath $tempfile

Returns:

Set-AzureRmVMDiagnosticsExtension : Cannot bind parameter 'StorageContext'. Cannot convert the "Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext" value of 
type "Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext" to type "Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext".
At line:5 char:109
+ ... urceGroupName -VMName $VMName -StorageContext $Storagecontext -Diagno ...
+                                                   ~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-AzureRmVMDiagnosticsExtension], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Azure.Commands.Compute.SetAzureRmVMDiagnosticsExtensionCommand

This used to work with Azure PowerShell 3.
Work-around is to not use the Storagecontext, but use the StorageAccountname and Storageaccountkey parameters instead.

I am guessing this has to do with the Microsoft.WindowsAzure class change from Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext to "Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext

New-AzureRmAvailabilitySet cmdlet

Hi,
I was using New-AzureRmAvailabilitySet cmdlets to create a new Availability Set. The Sku default value appears to be set to “Managed” which translates to “Aligned” upon execution. However, I am aware that there is a Classic “Sku” as well which is unmanaged. There isn’t a lot of information available in MS documentations to specify what the exact difference between managed and unmanaged is. I am assuming this has something to do with managed disks and unmanaged disks. Which value should I use if I need to use "unmanaged" disks. "unmanaged" parameter does not get accepted and neither does "Classic". I checked CLI to create a new availability set and there seems to be a parameter "unmanaged". Also the same can be done via the portal.

Could you let me know if “Aligned” is the default for the “Sku” parameter using PowerShell or is it possible to replace “managed” with say “unmanaged” or “Classic” during the execution?
image

Thanks,
Loy

New-AzureRmADServicePrincipal - Another object with the same value for property servicePrincipalNames already exists

When executing the New-AzureRmADServicePrincipal cmd:

$application = Get-AzureRmADApplication -DisplayName myApplicationRegistrationDisplayName
Add-Type -AssemblyName System.Web
$password = [System.Web.Security.Membership]::GeneratePassword(16,3)
$securePassword = ConvertTo-SecureString -Force -AsPlainText -String $password
New-AzureRmADServicePrincipal -ApplicationId $application.ApplicationId -Password $securePassword

I'm getting the following error message:

New-AzureRmADServicePrincipal : Another object with the same value for property servicePrincipalNames already exists.
At line:1 char:1
 New-AzureRmADServicePrincipal -ApplicationId $application.Application ...

    CategoryInfo          : InvalidOperation: (:) [New-AzureRmADServicePrincipal], Exception
    FullyQualifiedErrorId : Microsoft.Azure.Commands.ActiveDirectory.NewAzureADServicePrincipalCommand

To get the applicationId value for the parameter, I registered an application in AzureAd and then retrieved it using the Get-AzureRmADApplication cmd.

Not sure where I'm going wrong.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

New-AzureRmADApplication

New ad application using powershell and certificate authentication not working

$certificateFilePath = "D:\cert\ADTestVaultApplication.cer"
$certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$certificate.Import($certificateFilePath)
$rawCertificateData = $certificate.GetRawCertData()
$credential = [System.Convert]::ToBase64String($rawCertificateData)
$startDate= [System.DateTime]::Now
$endDate = $startDate.AddYears(1)
$adApplication = New-AzureRmADApplication -DisplayName "CerFDSFtAdApplication" -HomePage "http://www.test.com" -IdentifierUris "http://www.test.com" -CertValue $credential -StartDate $startDate -EndDate $endDate

Docs link 404

This page on service principals links at the top to create a service principal in the portal. It points to a dead link:

https://docs.microsoft.com/en-us/powershell/azure/resource-group-create-service-principal-portal?view=azurermps-4.3.1

Should probably be:

https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal

I notice in this markdown file 404'd doc gets referenced a relative path, /azure/azure-resource-manager/resource-group-create-service-principal-portal, but the powershell docs sit under https://docs.microsoft.com/en-us/powershell, so the relative URL has an extra "/powershell" that shouldn't be there.

New-AzureRmAppServicePlan : Method not found:

Hi,
On Azure Automation, I've the following error:

`New-AzureRmAppServicePlan : Method not found: 'Newtonsoft.Json.Serialization.IAttributeProvider
Newtonsoft.Json.Serialization.JsonProperty.get_AttributeProvider()'.
At line:23 char:1

  • New-AzureRmAppServicePlan -Name $webappname -Location $location -Reso ...
  •   + CategoryInfo          : CloseError: (:) [New-AzureRmAppServicePlan], MissingMethodException
      + FullyQualifiedErrorId : Microsoft.Azure.Commands.WebApps.Cmdlets.AppServicePlans.NewAzureAppServicePlanCmdlet
    

`
It's working fine on my computer.
PowerShell module is 4.2.2.

Any idea?
Thanks.
FLorent

Missing documentation on an equivalent in REST API for Move-AzureReservedIP cmdlet

Customer wants to automate the migration of Classic environments to ARM, part of which includes migrating a few public IP addresses from Classic to ARM.
We see that there's documentation for Move-AzureReservedIP PowerShell cmdlet at https://docs.microsoft.com/en-us/powershell/module/azure/move-azurereservedip?view=azuresmps-4.0.0, but we could not find any documentation on the equivalent in the REST API. We had to Debug Move-AzureReservedIP cmdlet to confirm REST API,
https://management.core.windows.net/3a0ecc28-a2ef-4d17-ac52-01f0c4884841/services/networking/reservedips/testmoveip/migration?comp=prepare

Can we document above REST API?

Add-AzureRmMetricAlertRule: Should parameter 'description' be mandatory?

Add-AzureRmMetricAlertRule parameter Description is mandatory but creating an alert (classic) within the azure portal is not mandatory.

This means in the scenario of copying an existing rule where there is no description (i.e. it was created without a description within the portal) fails parameter validation for the cmdlet given the properties are mapped.

GET THE RULE

$rule = Get-AzureRmAlertRule -ResourceGroupName $RG

RE ADD THE RULE

    Add-AzureRmMetricAlertRule `
        -ResourceGroupName $RG `
        -TargetResourceId $rule.Condition.DataSource.ResourceUri `
        -Location $rule.Location `
        -Name $rule.AlertRuleResourceName `
        -Description $rule.Description ` <-- This is null, causing validation to fail
        -MetricName $rule.Condition.DataSource.MetricName `
        -Operator $rule.Condition.OperatorProperty `
        -Threshold $rule.Condition.Threshold `
        -WindowSize $rule.Condition.WindowSize `
        -TimeAggregationOperator $rule.Condition.TimeAggregation 

Updating

Under the heading "Install or update the Azure PowerShell module", re the command "Install-Module -Name AzureRM -AllowClobber", the note says "This command will update any existing installation of Azure PowerShell on your system".
However, running that command on my system at an administrator prompt says "WARNING: Version '5.1.1' of module 'AzureRM' is already installed at 'C:\Program Files\WindowsPowerShell\Modules\AzureRM\5.1.1'. To install version '6.3.0', run Install-Module and add the -Force parameter, this command will install version '6.3.0' in side-by-side with version '5.1.1'.".
So, the information provided by this page is wrong. What is the correct procedure to update? I don't want side-by-side.
Please understand that getting documentation like this right is important.
When a new version is released, one of the first questions people have is "How should I update?"
Really, such documentation should be viewed as a key part of the release itself.
To not do so is very frustrating for users and it just seems like, let's throw the software out there and people can figure the rest out for themselves...


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

DefaultProfile (AzureRmContext) is not working

Passing in context using the AzureRmContext (DefaultProfile) optional variable does not work for Set-AzureRmResource. This works for other *-AzureRmResource commands (eg get-azurermresource). I am running AzureRM.Resources version 5.4.0.

I am calling the cmdlet via a powershell job which needs authentication/tenant details provided by the context object as described here: https://docs.microsoft.com/en-us/powershell/azure/context-persistence?view=azurermps-5.4.0

As I mentioned, this works for other *-AzureRmResource commands and the documentation suggested it accepts the AzureRMContext parameter

thanks

Add-AzureKeyVaultManagedStorageAccount active key explanation

Can somebody explain the active key functionality in Add-AzureKeyVaultManagedStorageAccount . If i set regenerationPeriod as 1 day and active key as key1. Then which key will be changed after regenerationPeriod and what happens to the other key value. Would it be invalidated? Can i use other key in PowerBI or storage explorer to access the storage account ?

What is the meaning of This auto regeneration process will continue between 'key1' and 'key2' with a gap of 90 days ?

I asked more questions about this in SO. No response yet. Please answer those questions as well. SO Link https://stackoverflow.com/questions/47776434/azure-managed-storage-account-keys

Checking which versions are installed

It would be helpful to include an example of how to check the version(s) that is/are installed, e.g.
Import-Module AzureRM
Get-Module -Name AzureRM


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

how to solve this?

PS E:\infrastructure_samples> Get-AzureRmRecoveryServicesBackupProtectionPolicy
Get-AzureRmRecoveryServicesBackupProtectionPolicy : Could not load file or assembly 'Microsoft.Azure.Commands.RecoveryServices.Backup.ServiceClientAdapter, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
At line:1 char:1

  • Get-AzureRmRecoveryServicesBackupProtectionPolicy
  •   + CategoryInfo          : NotSpecified: (:) [Get-AzureRmReco...rotectionPolicy], FileNotFoundException
      + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.GetAzureRmRecoveryServicesBackupProtectionPolicy
    

Microsoft.Azure.Commands.Management.IotHub.Models.PSOperationsMonitoringProperties

What are examples of valid setting here?

We have a Stream Analytics job that receives input from the "Operations monitoring" Endpoint of an IOT Hub. This works only when the various "Monitoring categories" are set to something other than "None" --which is the default. The code in https://github.com/Azure/azure-powershell/blob/preview/src/ResourceManager/IotHub/Commands.IotHub/Models/PSOperationsMonitoringProperties.cs isn't very helpful.

Noting https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-operations-monitoring, do we supply a set of key/value pairs, such as:

{"DeviceIdentityOperations", "Verbose"},
{"DeviceTelemetry", "Verbose"},
{"C2DCommands", "Error"} ,
{"Connections", "Verbose"},
{"fileUpload", "Error"} ,
{"routes", "Verbose"}
...

How does one fully populate the 'Operations monitoring" Azure Portal blade of an IoT Hub via PowerShell?

Failure with get-AzureRmDiagnosticSetting for SA Job

I hope Stream analytic support diagnostic and Metric from powershell(I can manually enable using portal). However using script it’s failing with error.

get-AzureRmDiagnosticSetting : Object reference not set to an instance of an object.

Broken Links to Azure Cmdlets

I noticed in the build report of a recent PR, there were several warnings about invalid file links. as follows:

In Bad Link
azurermps-4.4.1/AzureRM.Compute/Add-AzureRmVMNetworkInterface.md Invalid file link to ~/azurermps-4.4.1/AzureRM.Compute/Get-AzureRmNetworkInterface.md
azurermps-4.4.1/AzureRM.Compute/Add-AzureRmVMSecret.md Invalid file link to ~/azurermps-4.4.1/AzureRM.Compute/Set-AzureKeyVaultSecret.md
azurermps-4.4.1/AzureRM.Compute/Add-AzureRmVmssSecret.md Invalid file link to ~/azurermps-4.4.1/AzureRM.Compute/Set-AzureKeyVaultSecret.md
azurermps-5.0.0/AzureRM.Compute/Add-AzureRmVMNetworkInterface.md Invalid file link to ~/azurermps-5.0.0/AzureRM.Compute/Get-AzureRmNetworkInterface.md
azurermps-5.0.0/AzureRM.Compute/Add-AzureRmVMSecret.md Invalid file link to ~/azurermps-5.0.0/AzureRM.Compute/Set-AzureKeyVaultSecret.md
azurermps-5.0.0/AzureRM.Compute/Add-AzureRmVmssSecret.md Invalid file link to ~/azurermps-5.0.0/AzureRM.Compute/Set-AzureKeyVaultSecret.md

I would have just fixed this, but I have some questions how to implement fixes.

In each of the source documents for which there are the warnings, the document contains a link to an MD file in azure/azure-docs-powershell, however, the file does not exist (hence the warning!).

Looking at the first example, for some reason, the Get-AzureRmNetworkInterface.md is not in the right place.

Looking at the web, the 4.4.1 online version of Get-AzureRmNetworkINterface (at https://docs.microsoft.com/en-us/powershell/module/azurerm.network/get-azurermnetworkinterface?view=azurermps-4.4.1), if I click on Edit it takes me to a different location in Github. It shows the relevant md file is at azure/azure-powershell/src/ResourceManager/Network/Commands.Network/help/Get-AzureRmNetworkInterface.md.

I am guessing that somewhere/somehow, the documentation for a few cmdlets was left under azure/azure-powershell/src, rather than azure/azure-docs-powershell. If that makes sense.

To fix this, I see two options:

  1. In the documents with warnings, change the reference to point to a web location for the relevant documentation (eg pointing directly to https://docs.microsoft.com/en-us/powershell/module/azurerm.network/get-azurermnetworkinterface?view=azurermps-4.4.1 rather than to an MD document on GitHub.

  2. Assuming this was just a few files not migrated correctly, then the fix seems to be to move the relevant MD files from azure/azure-powershell to azure/azure-docs-powershell so that the 6 documents no longer generate an error message as they now DO point to a valid file.

Happy to try to fix this if someone gives a steer about which approach to take.

Documentation: Connect-AzureRmAccount is Wrong?

Version: powershell_6.0.2-1.ubuntu.16.04_amd64.deb

After installing the AzureRm module, when I try to follow the documentation and connect to azure with the following:

> Connect-AzureRmAccount       

I get this error back:

Connect-AzureRmAccount : The term 'Connect-AzureRmAccount' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Connect-AzureRmAccount
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Connect-AzureRmAccount:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

However, if I use this:

>Login-AzureRmAccount

Then I get the expected device login message:

WARNING: To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code <redacted> to authenticate.

I'm not sure if the command is different on Ubuntu as it is from other flavors of linux or on windows, but either way the documentation needs to be updated to reflect the correct command for logging into Azure.

Is Import-Module AzureRM necessary?

Under "Sign In" the example states:

# Import the module into the PowerShell session
Import-Module AzureRM
# Connect to Azure with an interactive dialog for sign-in
Connect-AzureRmAccount

Is "Import-Module AzureRM" strictly necessary? It takes some time and the sign-in seems to work fine in a new PowerShell window (for me at least) without it. I believe I read (on a blog somewhere) that this can be skipped on more recent versions of PowerShell.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified while run 'Import-Module AzureRM'.

PS /Users/xsqian> Install-Module -Name AzureRM
PS /Users/xsqian> # Import the module into the PowerShell session
PS /Users/xsqian> Import-Module AzureRM
Import-Module : Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
At /usr/local/share/powershell/Modules/AzureRM.profile/5.3.1/AzureRM.Profile.psm1:12 char:1

  • Import-Module (Join-Path -Path $PSScriptRoot -ChildPath Microsoft.Azu ...
  • CategoryInfo : NotSpecified: (:) [Import-Module], FileNotFoundException
  • FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : Assembly with same name is already loaded
At /usr/local/share/powershell/Modules/AzureRM/6.4.0/AzureRM.psm1:16 char:1

  • Import-Module AzureRM.ApiManagement -RequiredVersion 6.1.1 -Global
  • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
  • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : Assembly with same name is already loaded
At /usr/local/share/powershell/Modules/AzureRM/6.4.0/AzureRM.psm1:20 char:1

  • Import-Module AzureRM.Batch -RequiredVersion 4.1.1 -Global
  • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
  • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : Assembly with same name is already loaded
At /usr/local/share/powershell/Modules/AzureRM/6.4.0/AzureRM.psm1:24 char:1

  • Import-Module AzureRM.Compute -RequiredVersion 5.2.0 -Global
  • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
  • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : Assembly with same name is already loaded
At /usr/local/share/powershell/Modules/AzureRM/6.4.0/AzureRM.psm1:28 char:1

  • Import-Module AzureRM.DataFactories -RequiredVersion 5.0.1 -Global
  • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
  • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : Assembly with same name is already loaded
At /usr/local/share/powershell/Modules/AzureRM/6.4.0/AzureRM.psm1:36 char:1

  • Import-Module AzureRM.HDInsight -RequiredVersion 4.1.4 -Global
  • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
  • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : Assembly with same name is already loaded
At /usr/local/share/powershell/Modules/AzureRM/6.4.0/AzureRM.psm1:39 char:1

  • Import-Module AzureRM.KeyVault -RequiredVersion 5.0.3 -Global
  • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
  • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : Assembly with same name is already loaded
At /usr/local/share/powershell/Modules/AzureRM/6.4.0/AzureRM.psm1:50 char:1

  • Import-Module AzureRM.RecoveryServices -RequiredVersion 4.1.4 -Global
  • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
  • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : Assembly with same name is already loaded
At /usr/local/share/powershell/Modules/AzureRM/6.4.0/AzureRM.psm1:51 char:1

  • Import-Module AzureRM.RecoveryServices.Backup -RequiredVersion 4.3.0 ...
  • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
  • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : Assembly with same name is already loaded
At /usr/local/share/powershell/Modules/AzureRM/6.4.0/AzureRM.psm1:52 char:1

  • Import-Module AzureRM.RecoveryServices.SiteRecovery -RequiredVersion ...
  • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
  • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : Assembly with same name is already loaded
At /usr/local/share/powershell/Modules/AzureRM/6.4.0/AzureRM.psm1:53 char:1

  • Import-Module AzureRM.RedisCache -RequiredVersion 5.0.1 -Global
  • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
  • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : Assembly with same name is already loaded
At /usr/local/share/powershell/Modules/AzureRM/6.4.0/AzureRM.psm1:59 char:1

  • Import-Module AzureRM.Sql -RequiredVersion 4.9.0 -Global
  • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
  • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : Assembly with same name is already loaded
At /usr/local/share/powershell/Modules/AzureRM/6.4.0/AzureRM.psm1:60 char:1

  • Import-Module AzureRM.Storage -RequiredVersion 5.0.0 -Global
  • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
  • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

PS /Users/xsqian> # Connect to Azure with an interactive dialog for sign-in
PS /Users/xsqian> Connect-AzureRmAccount
Connect-AzureRmAccount : The term 'Connect-AzureRmAccount' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • Connect-AzureRmAccount
  • CategoryInfo : ObjectNotFound: (Connect-AzureRmAccount:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException

PS /Users/xsqian>


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Creating Application Secrets

I was trying to make a secret from PowerShell for a SPN and saw the following: New-AzureRmADAppCredential : Exception of type 'System.Exception' was thrown.

Here is what I did to cause the bug and how to fix it:

  1. created SPN with certificate: New-AzureRmADApplication -DisplayName $adAppName -HomePage $adAppHomePage -IdentifierUris $adAppIdentifierUri -KeyCredentials $keyCredential

  2. created password from portal

  3. tried to create a new password from PowerShell: New-AzureRmADAppCredential -ObjectId 2222-3333-444 -Password 'wakatester'

  4. saw the following error: New-AzureRmADAppCredential : Exception of type 'System.Exception' was thrown.

  5. Debugged and saw the following: "value": "Update to existing credential with KeyId '677dddaaa-4rde-bgt5-853a-2e02bce4c2f1' is not allowed.". This was actually the keyid of the key made from the portal.

  6. to fix I deleted all secrets made from the portal

  7. went back to PowerShell and created new secrets no problem

Publish-AzureWebsiteProject does not work when *.zip is created via Compress-Archive

Hello,

I am working on build and deploy script. First I have to prepare deploy.zip package. To do that I was using Compress-Archive in my build script, but when I tried to use:

Publish-AzureWebsiteProject -Name ServiceName -Package "XXXXX\deploy.zip"

I got an Error:

Publish-AzureWebsiteProject : (xx.xx.xxxx,xx:xx) An error occurred when the request was processed on the remote computer.

Only 80% of files were deployed in Azure App Service. All static files were missing.
But when took that package -> uzip -> righ click -> send to -> Compressed folder
I was able to deploy all files. When I used 7za.exe in my build script all files were deployed.

Do you know what is the issue here?

New-AzureKeyVaultCertificateOrganizationDetails example shows parameters that do not exist

Example 1 on the New-AzureKeyVaultCertificateOrganizationDetails.md page shows the commandlet allowing you to set Name, Address1, City, State etc. Those properties don't exist in the commandlet. I wish they did, but they don't. If you run the example verbatim you will get an error about missing parameters.

https://github.com/Azure/azure-docs-powershell/blob/38f06bfa6d78bf80660e6da314839ff16e24d9f7/azurermps-6.0.0/AzureRM.KeyVault/New-AzureKeyVaultCertificateOrganizationDetails.md

New-AzureRMAutomationConnection documentation is out of date

Errors in example (Source: AzureRM.Automation (Version 3.4.0)):
The hashtable for the parameter -ConnectionFieldValues needs the following keys:

  • CertificateAssetName
  • SubscriptionID
  • SubscriptionName

So in example1, you need to add SubscriptionName and change AutomationCertificateName to CertificateAssetName, otherwise an error is generated, saying the AutomationAccount doesn't exist. Which is equally unhelpful.

It would also help if you added the allowed values for -ConnectionTypeName which are:

  • Azure
  • AzureClassicCertificate
  • AzureServicePrincipal

(An explanation of each of the above would be helpful too)

Referenced Document:

New-AzureRmNetworkSecurityGroup Invalid Address & Port Entries

Basic single or range entries work, but multiple entries can't be entered via the powershell commands.

For instance this would work;
$rule1 = New-AzureRmNetworkSecurityRuleConfig -Name rdp-rule -Description "Allow RDP"
-Access Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceAddressPrefix
Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 3389

but this command entering multiple destination or source PortRange's/AddressPrefix's won't:
$rule1 = New-AzureRmNetworkSecurityRuleConfig -Name rdp-rule -Description "Allow RDP"
-Access Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceAddressPrefix
Internet -SourcePortRange * -DestinationAddressPrefix "192.168.10.0/24,192.168.11.0/24" -DestinationPortRange "3389,22"

NSG's do cater for multiple entries, the powershell or command options to configure these don't.

How to install powershell v5.0 in MacOS or Linux?

To install Powershell for Azure Stack, PowerShell 5.0 is required. See MicrosoftDocs/azure-docs#11030.
Could you please document how to install powershell 5.0 in MacOS or Linux?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Error trying to re-run slices

I use one script to re-run all failed slices in my Data Factory, first of all I think that should be one way to this from the portal or the powershell, something like retry all errors, auto resolve errors, something like this.

Every time I used this was fine, all errors were retried and solved, but now I'm having an error that I can't solve, there's no resource about the message, so I have no way to solve it.

First of all, I have two Sets of databases im my datafactory, production and Development, in the first week of the year, IT restored the Development database in source, with the production database, when this happened we had some problems with the connection to the source database, the source is SQLServer and the destination is another SQLServer on Azure.

I solved the connection problem, but I can't re-run the slices, I have this error

 Set-AzureRmDataFactorySliceStatus : HTTP Status Code: PreconditionFailed
 Error Code: TableSliceOutOfRange
 Error Message: No pipeline produces Dataset 'AZ_XXXXXQAS' from 07/24/2017 10:00:00 to 07/24/2017 10:20:00. 
 - Try changing the slice time range to fall within the active period of a pipeline that produces the data. 
 - Try changing the active period of a pipeline that produces the data to cover the slice time range.
 Pipelines producing the Dataset include:
  Pipeline XXXXXQAS, Activity Activity-0-[dbo]_[v_XXX]->[dbo]_[XXXXX], ActivePeriod Start=10/27/2017 09:00:00, End=05/30/2030 02:00:00.
 Request Id: 69487c5d-bf37-43d7-a642-a239cb782dce
 Timestamp (Utc):01/09/2018 16:54:18
 At C:\XXXX\RunAllDataFactory.ps1:36 char:21
 + ...    $outcome=Set-AzureRmDataFactorySliceStatus -DataFactory $df -Datas ...
 +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : CloseError: (:) [Set-AzureRmDataFactorySliceStatus], CloudException
     + FullyQualifiedErrorId : Microsoft.Azure.Commands.DataFactories.SetAzureDataFactorySliceStatusCommand

Is there a way to change the slice? Or a way that I can refresh all datasets?

Set-AzureRmStorageAccount is wrong

The --force parameter's information is missing. It shows the info for the access tiers instead. It actually looks as if the information for the -Force parameter and a parameter name after that got accidentally removed.

Also, same thing for -Tag. The information is wrong, and the parameter Kind is missing. (It has the explanation for Kind right after the heading for -Tag.)

New-AzureRMVM Hangs when creating from AzureRMImage (created by Packer)

Azure RM Version:
5.6.0 AzureRM

Powershell Version:
PSVersion 5.1.16299.251
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.251
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Description:
When deploying New-AzureRMVM from an image configuration, the cmdlet hangs when the virtual machine has been created. It seems the cmdlet does not successfully check that the VM has been successfully created (even after 2 hours has passed). One must completely force close the powershell session to recover.

Followed the guide here for the packer image;
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/build-image-with-packer

Here's my commands to create my VM:

$image = Get-AzureRMImage -ImageName <image-name> -ResourceGroupName $rgName
$vmConfig = New-AzureRmVMConfig -VMName <vm-name> -VMSize Standard_F2s | Set-AzureRmVMOperatingSystem -Windows -ComputerName <vm-name> -Credential $cred | Set-AzureRmVMSourceImage -Id $image.Id | Add-AzureRmVMNetworkInterface -Id $nic.Id

New-AzureRmStorageAccount -ResourceGroupName $rgName -Name <diagaccount-name> -Location $location -SkuName Standard_LRS -Verbose
Set-AzureRmVMBootDiagnostics -VM $vmConfig -Enable -ResourceGroupName $rgName -StorageAccountName <diagaccount-name>
New-AzureRmVM -ResourceGroupName $rgName -Location $location -VM $vmConfig -LicenseType "Windows_Server"

I receive successful VM confirmation of VM creation but the powershell session is not interactive.

Workarounds:
If I use Azure CLI to create my vm from the image, I receive no such delay.

az vm create -g <resource-group> -n <vm-name> --image <image-name>

{
  "fqdns": "",
  "id": "/sub-id/resourceGroups/rg-name/providers/Microsoft.Compute/virtualMachines/vm-name",
  "location": "eastus",
  "macAddress": "omitted",
  "powerState": "VM running",
  "privateIpAddress": "omitted",
  "publicIpAddress": "omitted",
  "resourceGroup": "rg-name",
  "zones": ""
}

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.