New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-AzAutomationCredential can't read the password by calling GetNetworkCredential().Password #8486
Comments
@vrdmr Can you take a look at this issue? |
Is there going to be an update on this one? I just used the most recent release and this failure is still occurring. |
By design. Runbooks should retrieve passwords from a credential shared resource by using Get-AutomationCredential. |
I don't understand why this issue was closed. "This PowerShell command for Azure Automation will no longer be supported on 01/23/2020. The Azure Service Management model is deprecated for Azure Automation, and will be disabled on that date. Please use the commands which support the Azure Resource Management model in Az.Automation." |
Get-AutomationPsCredential is not the same as Get-AzureAutomationCredential. https://docs.microsoft.com/en-us/azure/automation/shared-resources/credentials#activities |
I think a lot of the confusion here comes from the fact that there are multiple cmdlets with very similar names. I am not finding a cmdlet called Get-AutomationCredential as Zachary is mentioning above, but I do see Get-AutomationPSCredential which is listed in the article that he linked to. Here is a really simple example that I put together that uses an Azure AD Service Principal as the identity to login with. I created the Service Principal in my Azure AD and assigned it a key to allow it to sign in. I then created a Credential resource inside my Automation Account and stored the Service Principal's app id and its key as a username and password. I also created a Variable resource to store my Azure AD Tenant ID. I am using Get-AutomationPSCredential and Get-AutomationVariable to pull these values into my PowerShell script and then using them to login to Azure. $pscred = Get-AutomationPSCredential -Name "AzureCredential" |
Yes, I should I have said Get-AutomationPSCredential , thanks! |
I still need password. Think about requiring a password in the connection string to connect to SQL Server database. |
Description
Script/Steps for Reproduction
The following script should get the password from an Automation Account but returns an error
Method invocation failed because [Microsoft.Azure.Commands.Automation.Model.CredentialInfo] does not contain a method named 'GetNetworkCredential'.
Note: Get-AzureRmAutomationCredential is working without any issues.
Module Version
Environment Data
Debug Output
Sensitive data removed:
The text was updated successfully, but these errors were encountered: