Import-AzureRmRedisCache : Long running operation failed with status 'Conflict' - powershell

I'm getting a strange error with PowerShell AzureRM 4.4.0. When I run Import-AzureRmRedisCache -ResourceGroupName $rg -Name $rediscache -Files $sasKeyForBlob -Force It runs for about 1 minute and the throws up the below error. The files are only 35KiB! I've searched the web and I can't find any reference to Long running operation failed with status 'Conflict'.
The Error:
Import-AzureRmRedisCache : Long running operation failed with status 'Conflict'.
At line:1 char:1
+ Import-AzureRmRedisCache -ResourceGroupName $rg -Name $rediscache -F ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Import-AzureRmRedisCache], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.RedisCache.ImportAzureRedisCache

Related

Set-AzureRmVMDiskEncryptionExtension : Long running operation

While trying to encrypt a VM, I am getting the below error:
Set-AzureRmVMDiskEncryptionExtension : Long running operation failed
with status 'Failed'. ErrorCode: VMExtensionProvisioningError
ErrorMessage: VM has reported a failure when processing extension
'AzureDiskEncryptionForLinux'. Error message: "Enable failed.".
StartTime: 11/15/2017 11:12:30 AM EndTime: 11/15/2017 11:14:38 AM
OperationID: 004051ca-bf73-4a37-a145-5e0ac30bc30a Status: Failed At
line:1 char:1
+ Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $resourceGrou ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureRmVMDiskEncryptionExtension], ComputeCloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Extension.AzureDiskEncryption.SetAzureDiskEncryptionExtensionCommand
Please help me to resolve this issue.
I was also having the same issue. The reason was i was not changing the access policy of the key vault.
use this command to change the access policy first and then execute the command for encryption.
Set-AzureRmKeyVaultAccessPolicy -VaultName $KeyVaultName -ResourceGroupName $rgName -EnabledForDiskEncryption
and then check the policy with the following command
(Get-AzureRmKeyVault -VaultName $keyVaultName -ResourceGroupName $rgName).EnabledForDiskEncryption it should return true.

Invalid namespace in PowerShell working with FSRM

Trying PS command:
Set-FsrmFileGroup -Name "Anti-Ransomware File Groups" -IncludePattern #((Invoke-WebRequest -Uri "https://fsrm.experiant.ca/api/v1/combined" -UseBasicParsing).Content | ConvertFrom-Json | % {$_.filters})
Getting error:
New-FsrmFileGroup : Invalid namespace
At line:1 char:1
+ New-FsrmFileGroup -Name "Anti-Ransomware File Groups" -IncludePattern #((Invoke- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : MetadataError: (MSFT_FSRMFileGroup:Root/Microsoft/...T_FSRMFileGroup) [New-FsrmFileGroup], CimException
+ FullyQualifiedErrorId : HRESULT 0x8004100e,New-FsrmFileGroup
I also notice some errors in FSRM:
Firewall is off and I am domain admin running this as admin. SFC and a WMI repair came back as good. I am going based off a guide (https://fsrm.experiant.ca/). This has worked across a ton of other servers so I don't believe the commands to be improperly formatted.
Output of Get-WmiObject -Namespace 'Root/Microsoft/Windows/Fsrm' -List:
Get-WmiObject : Could not get objects from namespace Root/Microsoft/Windows/Fsrm.
Invalid namespace
At line:1 char:1
+ Get-WmiObject -Namespace 'Root/Microsoft/Windows/Fsrm' -List
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : INVALID_NAMESPACE_IDENTIFIER,Microsoft.PowerShell.Commands.G‌​etWmiObjectCommand

Try/Catch Add-DnsServerResourceRecordA in PowerShell

I want to catch the exception that occurs, when adding a DNS record with Add-DnsServerResourceRecordA in PowerShell with the switch -CreatePTR, but no reverse lookupzone exists.
But there is no error. If I provoke the error a simple menu pops up and informs me about the situation. But independent from the -ErrorAction switch the $error variable does not receive an error. What's my fault?
Thanks for your reply.
PS C:\Users\xyz>> Add-DnsServerResourceRecordA -Name "test-mwi4" -IPv4Address 1.1.1.1 -CreatePtr -ZoneName contoso.biz -ErrorAction Continue
Add-DnsServerResourceRecordA : Failed to create PTR record. Resource record test-mwi4 in zone mn-man.biz on server MNDEMUCDC010 is created successfully, but corresponding PTR record could not be created.
At line:1 char:1
+ Add-DnsServerResourceRecordA -Name "test-mwi4" -IPv4Address 1.1.1.1 -CreatePtr - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (test-mwi4:root/Microsoft/...ResourceRecordA) [Add-DnsServerResourceRecordA], CimException
+ FullyQualifiedErrorId : WIN32 9715,Add-DnsServerResourceRecordA
Thank you!
In order to use this command in try catch block use below code:
Try
{
Add-DnsServerResourceRecordA -Name "test-mwi4" -IPv4Address 1.1.1.1 -CreatePtr -ZoneName contoso.biz -ErrorAction Stop
}
Catch
{
Write-Host "Error while adding pointer record:`n$($Error[0].Exception.Message)"
}
$Error[0] returns:
$Error[0]
Add-DnsServerResourceRecordA : Failed to get the zone information for
contoso.biz on server HYDLPT487.
At line:3 char:5
+ Add-DnsServerResourceRecordA -Name "test-mwi4" -IPv4Address 1.1.1 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (test-mwi4:root/Microsoft/...Resou
rceRecordA) [Add-DnsServerResourceRecordA], CimException
+ FullyQualifiedErrorId : WIN32 1722,Add-DnsServerResourceRecordA

New-AzureRmResourceGroupDeployment

Quite strange, It was all working well, but suddenly I started getting this message for ARM Deployment. I have even completed 10 webapp deployment with the script before as part of testing:New-AzureRmResourceGroupDeployment
New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $TemplateFile).BaseName + '-' + ((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm')) `
-ResourceGroupName $ResourceGroupName `
-TemplateFile $TemplateFile `
-TemplateParameterFile $TemplateParameterFileAzureLocalLink `
-Force -Verbose
==============================Error Message is as below ================
New-AzureRmResourceGroupDeployment : 6:33:49 PM - "Template output evaluation skipped: at least one resource deployment operation failed. Please list deployment operations for
details. Please see https://aka.ms/arm-debug for usage details."
At D:\Azure\trial\runscript_localfiles_working_june6.ps1:116 char:25
+ New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.NewAzureResourceGroupDeploymentCommand
New-AzureRmResourceGroupDeployment : 'string' does not contain a definition for 'error'
At D:\Azure\trial\runscript_localfiles_working_june6.ps1:116 char:25
+ New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureRmResourceGroupDeployment], RuntimeBinderException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.NewAzureResourceGroupDeploymentCommand
Any suggestions as this is making me freak out! :(
Thanks in advance for the consideration

issue in running diagnostics in azure

I was trying to make a dummy diagnostics worker role using the following article
When i run the following command in step 4 :
(Get-AzureServiceAvailableExtension -ExtensionName 'PaaSDiagnostics' -ProviderNamespace 'Microsoft.Azure.Diagnostics').PublicConfigurationSchema | Out-File -Encoding utf8 -FilePath 'WadConfig.xsd'
I get the following error in azure powershell, we need the subscription in this command but not sure where.
Also, is there a place where I can find how to make a dummy diagnostics worker role.
VERBOSE: 3:32:14 PM - Begin Operation: Get-AzureServiceAvailableExtension
Get-AzureServiceAvailableExtension : No default subscription has been designated. Use Select-AzureSubscription
-Default <subscriptionName> to set the default subscription.
At line:1 char:2
+ (Get-AzureServiceAvailableExtension -ExtensionName 'PaaSDiagnostics' -ProviderNa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzureServiceAvailableExtension], ApplicationException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.GetAzureServiceAvailableExt
ensionCommand
VERBOSE: 3:32:14 PM - Completed Operation: Get-AzureServiceAvailableExtension
Out-File : Access to the path 'C:\WadConfig.xsd' is denied.
At line:1 char:148
+ ... rationSchema | Out-File -Encoding utf8 -FilePath 'WadConfig.xsd'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (:) [Out-File], UnauthorizedAccessException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
First add your credentials using:
add-azureaccount
Next, select desired subscription (if you have more than one) using:
Select-AzureSubscription -SubscriptionId <id>
Finally, try again.