Giter VIP home page Giter VIP logo

azure-docs-powershell-samples's Introduction

page_type description languages products
sample
A collection of Azure PowerShell code samples used in Microsoft's official Azure PowerShell Documentation.
powershell
azure

Sample code for Azure PowerShell documentation

The sample code in this repo for Azure PowerShell documentation is being transitioned to a new repository.

All future contributions and updates to sample code for Azure PowerShell documentation should be directed to: github.com/Azure-Samples/azure-docs-powershell-samples.

All code in this repository is non-production samples used in Microsoft's official Azure PowerShell documentation and is designed to be used by our customers for learning and experimentation purposes.

Feedback

If you have any questions or comments, log an issue in the Azure-Samples/azure-docs-powershell-samples repo.

Contributing

New contributions to this repo are no longer accepted. Please submit new sample code contributions for Azure PowerShell documentation to the Azure-Samples/azure-docs-powershell-samples repo.

License

The MIT License applies to the code contained in this repo. For more information, see LICENSE.

Microsoft Open Source Code of Conduct

This repository 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.

azure-docs-powershell-samples's People

Contributors

allclark avatar anvar-ms avatar blackmist avatar carlrabeler avatar cephalin avatar dlepow avatar erickson-doug avatar fhryo-msft avatar iainfoulds avatar jasonwhowell avatar juliako avatar markjbrown avatar mashamsft avatar mikefrobbins avatar mmacy avatar musa-57 avatar neilpeterson avatar rahug1190 avatar ramankumarlive avatar roygara avatar rwike77 avatar shivamverma-ms avatar snehaamicrosoft avatar snehagunda avatar spelluru avatar sptramer avatar tamram avatar tfitzmac avatar vanmsft avatar vhorne avatar

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

azure-docs-powershell-samples's Issues

Network connection view is not loaded in PowerBI

Hello,

I tried to generate the CSV file as mentioned in the article and I used Azure PowerShell installed on PowerShell 7
$PSVersionTable

Name Value


PSVersion 7.3.6
PSEdition Core
GitCommitId 7.3.6
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Also I tried from Azure CloudShell
The CSV file gets generated.

I was able to load the date into PowerBI (Version: 2.119.870.0 64-bit).

The data is loaded and transformed, however I don't get any kind of visualization (only data in table format).

Can you please check.

PowerBI

Startup order ?

In asr_testmigration.ps1 and asr_migration.ps1, do the servers start in the same order that they are listed in the CSV file ?

AzMigrate-StartReplication.ps1 cannot find Availability Set if in different subscription than Azmigrate (Target sub)

The "AzMigrate-StartReplication.ps1" script was failing for me with the following error due to fact that the Availability Set I was trying to assign to some VMs I was initiating replication for was in a different subscription than the AzMigrate appliance/project - i.e. the TARGET sub that the VMs were to live:

20220308_141933[ERROR]-Get-AzAvailabilitySet : Resource group 'AS-RGNAME' could not be found.
ErrorCode: ResourceGroupNotFound
ErrorMessage: Resource group 'AS-RGNAME' could not be found.
ErrorTarget:
StatusCode: 404
ReasonPhrase: Not Found
OperationID : d15c666c-e04b-4742-ad45-58dc6e35d4f8
At C:\Users\PATH\Azure-Migrate\Agentless VMware automation\AzMigrate_StartReplication.ps1:232
char:26

  • ... $avSet = Get-AzAvailabilitySet -Name $availabilitysetName -Resourc ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : CloseError: (:) [Get-AzAvailabilitySet], ComputeCloudException
    • FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.GetAzureAvailabilitySetCommand

20220308_141933[ERROR]-Exception processing item
20220308_141933[ERROR]-Exception calling "Invoke" with "3" argument(s): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop:

After some research into what was going wrong, it seems that if the Availability Set you want any group of VMs to be assigned to upon initiating replication is in a different sub (i.e. the TARGET SUB) than the AzMigrate Sub (i.e. - AZMIGRATEPROJECT_SUBSCRIPTION_ID) - the AzMigrate-Start-Replication.ps1 script does not change context to the target sub and hence fails as it cannot find the Resource Group that the AS lives in so that it can grab the AS's resource ID.

I added these two lines to the "# Get the Availability Set" section of this script so that it will switch context to the appropriate sub and then be able to grab the AS's resource ID and then it ran properly:

Set-AzContext -Subscription $targetSubscriptionID
Set-AzContext -Subscription $azMigProjSubscriptionID

        else {
            #Get the availability set
            **Set-AzContext -Subscription $targetSubscriptionID**
            $avSet = Get-AzAvailabilitySet -Name $availabilitysetName -ResourceGroupName $targetResourceGroup
            if (-not $avSet){
                $processor.Logger.LogTrace("AVAILABILITY Set could not be retrieved for: '$($sourceMachineName)'")
                $reportItem.AdditionalInformation = "AVAILABILITY Set could not be retrieved for: '$($sourceMachineName)'"
                return
            }
            else {
                $params.Add("TargetAvailabilitySet", $avSet.Id)
                **Set-AzContext -Subscription $azMigProjSubscriptionID**
            }
        }

This could probably use some more in depth error checking or logic built around it as this may not ALWAYS be the case and the AS could live in the same sub as the AzMigrate project/appliance does. BUT, if the AS does NOT live in the same sub as the AzMigrate appliance/project - then this script will fail without it changing context to the proper Target sub to get the resource ID of the AS so it can assign the VMs to them upon initiating replication...

Seem to have an issue in working with Service principle login and Azure monitor

trying to use powershell to pull CPU usage metrics but keep failing with

Exception type: AzPSApplicationException, Message: Microsoft.Azure.Commands.Common.Exceptions.AzPSApplicationException: No subscription found in the context. Please ensure that the credentials you provided are authorized to access an Azure subscription, then run Connect-AzAccount to login.
at Microsoft.Azure.Commands.Common.Authentication.Factories.ClientFactory.CreateArmClient[TClient](IAzureContext context, String endpoint)
at Microsoft.Azure.Commands.Insights.ManagementCmdletBase.get_MonitorManagementClient()
at Microsoft.Azure.Commands.Insights.Metrics.GetAzureRmMetricDefinitionCommand.ProcessRecordInternal()
at Microsoft.Azure.Commands.Insights.MonitorCmdletBase.ExecuteCmdlet(), Code: Null, Status code:Null, Reason phrase: Null

$conn = Get-AutomationConnection -Name 'AzureRunAsConnection'

#Connect-AzAccount -Tenant $conn.TenantId -ApplicationId $conn.ApplicationId -CertificateThumbprint $conn.CertificateThumbprint -ServicePrincipal

Add-AzureRmAccount -EnvironmentName "AzureCloud" -ServicePrincipal -TenantId $conn.TenantId -ApplicationId $conn.ApplicationId -CertificateThumbprint $conn.CertificateThumbprint

$resourceManagerVMList = @(Get-AzureRmResource | where {$_.ResourceType -like "Microsoft.*/virtualMachines"} | sort Name)

Write-Output "Processing [$($resourceManagerVMList.Count)] virtual machines found in subscription"
foreach($vm in $resourceManagerVMList)
{
    $vm1 = Get-AzureRmVM -ResourceGroupName $vm.ResourceGroupName -Name $vm.Name
    
    $resourceID = $vm1.Id

write-output "resource ID " $resourceID

    $endTime = Get-Date
    $startTime = $endTime.AddMinutes(-1440)
    $timeGrain = '00:01:00'
    $metricName = 'Percentage CPU'
    $metricData = Get-AzureRmMetric -ResourceId $resourceID -TimeGrain $timeGrain -StartTime $startTime -EndTime $endTime -MetricName $metricName
    Write-Output "[$($vm1.ResourceGroupName)]:[$($vm1.Location)]:[$($vm1.Name)]:[$($vm1.HardwareProfile.VmSize)]:[$($metricData)]"
    #break;
}

InvalidHttpRequestPath

Trying to export dependencies to Power BI. This worked perfectly yesterday, today I am receiving an error InvalidHttpRequestPath. I downloaded the current version of AzMig_Dependencies.psm and I have tested it in Powershell5.x, 7.3, and 7.4 preview all with the same error.
Screenshot 2023-06-13 at 1 24 06 PM

Token Usage Not Working

Line 20: $CurrentContext = Get-AzContext

"Get-AzContext" seems to not include token...

Line 47: $TokenCache = $CurrentContext.TokenCache

TokenCache is not a valid attribute... Execution throws the following:

Missing or incomaptible module version. Get the latest version of the Az.Accounts module
At C:\Users\100031355\Documents\WindowsPowerShell\azure-docs-powershell-samples-master\azure-migrate\dependencies-at-scale\AzMig_Dependencies.psm1:49 char:9
+ throw "Missing or incomaptible module version. Get the latest ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Missing or inco...Accounts module:String) [], RuntimeException
+ FullyQualifiedErrorId : Missing or incomaptible module version. Get the latest version of the Az.Accounts module

Import Module failed (AzureMigrateAssessmentCreationUtility.psm1)

The command name 'New-Group-Add-Machines' from the module 'AzureMigrateAssessmentCreationUtility' contains one or more of the following restricted characters: # , ( ) { } [ ] & - / \ $ ^ ; : " ' < > | ? @ * % + = ~`

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visualization of Multiple VM Dependencies Agentlessly

Hi, I want to visualize multiple (about 500) servers altogether using agentless dependency discovery and have a few queries.

  1. For agentless dependency discovery, no installation is needed.
    https://learn.microsoft.com/en-us/azure/migrate/concepts-dependency-visualization#compare-agentless-and-agent-based

And then, why ReadMe docs says that "Ensure that VMware Tools (later than 10.2) is installed on each VM you want to analyze."
https://github.com/Azure/azure-docs-powershell-samples/blob/master/azure-migrate/dependencies-at-scale/README.md#pre-requisites

  1. Is it only applicable to VMware servers?
    https://github.com/Azure/azure-docs-powershell-samples/blob/master/azure-migrate/dependencies-at-scale/README.md#overview
    image

  2. Is the extracted data using PowerShell the same with this data?
    image

Thank you.

Missing or incomaptible module version.

Getting the following error while executing Get-AzMigDependenciesAgentless

I have tried running in Version 5.1 Powershell 7.1, both have the same error
Az.Accounts version is 2.2.1
image

On further investigation found that

$TokenCache = $CurrentContext.TokenCache in the function function GetRequestProperties() is null. I have tried with Az module 1.9.5 still no luck. my scenario is B2B. I am assuming this should work regardless

maybe Get-AzAccessToken can be used to make it compatible

Is there any other way to extract this data? am keen to use the Bi template

hope for a fix soon, Plz Help

API endpoint in Set-AzMigDependencyMappingAgentless function does not work for Hyper-V

The API endpoint used to enable/disable dependency mapping for discovered VMs does not work for Hyper-V machines. The endpoint accepts the request without error, creates and operation, and successfully completes the operation without error. However, the property is not updated on any of the VMs that were submitted to the endpoint.

After inspecting the request that the Azure Portal uses to enable dependency mapping for Hyper-V VMs, I noticed that the portal is using a different endpoint than the one defined in the PowerShell module. This is an un-published endpoint (not sure why), but it correctly enables dependency mapping at scale for Hyper-V VMs.

The endpoint used in the PowerShell module, that works for VMware VMs, is:
https://management.azure.com/subscriptions/<subscriptionid>/resourceGroups/<resource group>/providers/Microsoft.OffAzure/VMwareSites/<site name>/UpdateProperties?api-version=2020-01-01.
It expects a body object formatted like this:

{
  "machines": [
    {
      "machineArmId": "/subscriptions/<subscriptionid>/resourceGroups/<resource group>/providers/Microsoft.OffAzure/HyperVSites/<site name>/machines/<machine guid>",
      "dependencyMapping": "Enabled"
    }
  ]
}

The unpublished endpoint used in the Portal, that works for Hyper-V VMs, is:
https://management.azure.com/subscriptions/<subscriptionid>/resourceGroups/<resource group>/providers/Microsoft.OffAzure/HyperVSites/<site name>/UpdateDependencyMapStatus?api-version=2020-08-01-preview.
It expects a body object formatted like this:

{
  "machines": [
    {
      "machineId": "/subscriptions/<subscriptionid>/resourceGroups/<resource group>/providers/Microsoft.OffAzure/HyperVSites/<site name>/machines/<machine guid>",
      "isDependencyMapToBeEnabled": true
    }
  ]
}

Can the PowerShell module be updated to include this endpoint that works for Hyper-V machines? Alternatively, are PRs accepted for this repository?

Facing an Issue on running the dependency script

Hi I am facing an issue when running the Get-AzMigDiscoveredVMWareVms commands . Can you please look into it

ConvertFrom-Json : Cannot bind argument to parameter 'InputObject' because it is null.
At D:\Aswin\New folder\AzMig_Dependencies.psm1:136 char:19

  • $map = $map | ConvertFrom-Json
    
  •               ~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [ConvertFrom-Json], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

No Migrate Appliance in project
At D:\Aswin\New folder\AzMig_Dependencies.psm1:139 char:27

  • if (-not $map.count) {throw "No Migrate Appliance in project"}
    
  •                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (No Migrate Appliance in project:String) [], RuntimeException
    • FullyQualifiedErrorId : No Migrate Appliance in project

PowerBI Template does not handle multiple database instances on one VM

PowerBI Throws error for template "Azure Migrate Assessment Comparison PowerBI Template.pbit":
Column 'MachinesName in Table 'CentralSQLServer' contains a duplicate value 'Server01' and this is not allowed for columns on the one side of a many-to-one relationship of for columns that are used as the primary key of a table.

Creation of $secpassw for ACR Service Principal fails after migration to MicrosoftGraph API

The below line is used to generate a secure password which is passed to New-AzADServicePrincipal

$secpassw = New-Object Microsoft.Azure.Commands.ActiveDirectory.PSADPasswordCredential -Property @{ StartDate=Get-Date; EndDate=Get-Date -Year 2024; Password=$password}

When attempting to do this with version 7.1 of the Az Modules, you receive the following error:

New-Object: Cannot find type [Microsoft.Azure.Commands.ActiveDirectory.PSADPasswordCredential]: verify that the assembly containing this type is loaded

Which according to this issue: Azure/azure-powershell#16671, relates to the shift to MicrosoftGraph API with newer Az PowerShell modules.
The sample needs updating to reflect this and an alternate approach

Fields Incorrect

The PBI Template is looking at an old column for estimates.

Compute monthly cost USD in PBI, is now Compute monthly cost estimate USD and the same for storage

Az.RecoveryServices PS Module v2.4 - Changes Required

Hello

Please note that command New-AzRecoveryServicesAsrReplicationProtectedItem has been updated with new parameters in Az.RecoveryServices module v2.4
https://docs.microsoft.com/en-us/powershell/module/az.recoveryservices/new-azrecoveryservicesasrreplicationprotecteditem?view=azps-3.3.0#parameters

Specifically target storage account has been replaced by Disk Type parameter.

Please modify csv file and asr_startmigration.ps1 to address same.

Thanks
Ajay

PowerBi template expects costings in USD

I have been trying to work with the Azure Migrate Assessment comparison template, when I upload my exports I see errors as the template query's are set to expect costings in USD. I have all of them but still receive one last error for the CentralSummaryTable error (Below)

"'Total monthly cost estimate USD' in table 'CentralSummaryTable' cannot be found or may not be used in this expression."

The query has been changed to GBP but I still see the same error ?

let
   
   Source = try Summary otherwise Table.FromRecords(
    {  
      [Assessment name = "", Total monthly cost estimate GBP = "", Compute monthly cost GBP = "", Storage monthly cost GBP = ""]
    }
   ),
  
    #"Source1" = #"Source",
    #"Appended Query" = Table.Combine({Source1, #"Summary (2)", #"Summary (3)", #"Summary (4)", #"Summary (5)", #"Summary (6)", #"Summary (7)", #"Summary (8)", #"Summary (9)", #"Summary (10)", #"Summary (11)", #"Summary (12)"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Appended Query",{{"Total monthly cost estimate GBP", type number}, {"Compute monthly cost GBP", type number}, {"Storage monthly cost GBP", type number}})
in
    #"Changed Type"

Many thanks
Jon

AzMig_Dependencies.psm1 Error - Could Not Resolve <*****>.blob.core.windows.net

Hi Team,

Thank you for the script. I am able to get the list of VMs in Azure migrate project with its status of data dependency collection. However when I try to run: Get-AzMigDependenciesAgentless, i am getting a error stating that <>.blob.core.windows.net could not be resolved.

image

Am i missing something here?

Thanks!

Username Password Authentication

With MFA enabled, this script does not work as it calls to enter username and password.
Getting the following error:
WARNING: Unable to acquire token for tenant 'organizations' with error 'UsernamePasswordCredential authentication
failed: Unsupported User Type 'Unknown'. Please see https://aka.ms/msal-net-up.
See the troubleshooting guide for more information.
https://aka.ms/azsdk/net/identity/usernamepasswordcredential/troubleshoot'
Is there a way to bypass asking for creds since the PS session is already authenticated and connected to the tenant?

Static IP Address not needed; using DDNS/DHCP

We are using DDNS/DHCP for private IP addressing and the scripts asr_updateproperties.ps1 wants a RecoveryNicStaticIPAddress value and errors if one is not provided.
Is a way to just skip the Static IP Address assignment?
Assume if it’s null its not needed and continue.

**Warning:**
20190409_094620[LOG]-Creating job to set machine properties...
20190409_094620[ERROR]-Set-AzRecoveryServicesAsrReplicationProtectedItem : Cannot validate argument on parameter
'RecoveryNicStaticIPAddress'. The argument is null or empty. Provide an argument that is not null
or empty, and then try the command again.
At C:\JHCVS\Scripts\Azure\ASR_Migration_Automation_MS\asr_updateproperties.ps1:55 char:49
+                     -RecoveryNicStaticIPAddress $targetPrivateIP `
+                                                 ~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Set-AzRecoveryS...onProtectedItem], ParameterBindin
   gValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Azure.Commands.RecoverySer
   vices.SiteRecovery.SetAzureRmRecoveryServicesAsrReplicationProtectedItem


20190409_094620[ERROR]-Exception processing item
20190409_094620[ERROR]-Exception calling "Invoke" with "3" argument(s): "Cannot validate argument on parameter
'RecoveryNicStaticIPAddress'. The argument is null or empty. Provide an argument that is not null
or empty, and then try the command again."
At C:\JHCVS\Scripts\Azure\ASR_Migration_Automation_MS\asr_csv_processor.ps1:62 char:17
+ ...             $this.ProcessItemFunction.Invoke($this, $csvItem, $report ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ParameterBindingValidationException

PositionalParameterNotFound error while creating VNET using PowerShell

I was trying one of the sample from repo and getting below error.

#========Create a virtual network with a front-end subnet and back-end subnet.======================
try {

     # Create a virtual network with a front-end subnet and back-end subnet.
       $fesubnet = New-AzVirtualNetworkSubnetConfig -Name $FrontendSubnet -AddressPrefix '10.0.1.0/28'
       $besubnet = New-AzVirtualNetworkSubnetConfig -Name $BackendSubnet -AddressPrefix '10.0.2.0/28'
       $stmsubnet = New-AzVirtualNetworkSubnetConfig -Name $FunctionSubnet -AddressPrefix '10.0.3.0/28'

        $vnet = New-AzVirtualNetwork -ResourceGroupName $rgName -Name $virtualNetworkName -AddressPrefix '10.0.0.0/26' `
    -Location $location -Subnet $stmsubnet $fesubnet, $besubnet

 }
 catch {
      Write-Host "Failed to create VNET!"
      exit
 }

I am getting below error

System.Management.Automation.ParameterBindingException: A positional parameter cannot be found that accepts argument 'System.Object[]'.
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

Ability to migrate to a different subscription

Hi I think VMWare agentless Powershell scripts needs to be added with ability to migrate to a different subscription. Azure Migrate module provides option to migrate servers to different subscription rather than using same subscription where Azure migrate project is created. I have modified it script locally and it looks fine except for the availability set.

Having {"Error":"InvalidDataFormat","Message":null} error

Hi, I got the below error while running the ps, can I know what is causing this?

Invoke-WebRequest: /home/chris/PostStorageLogs2LogAnalytics.ps1:128
Line |
 128 |  … $response = Invoke-WebRequest -Uri $uri -Method $method -ContentType  …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | {"Error":"InvalidDataFormat","Message":null}

> Failed to post one log to Log Analytics workspace

This PS does not work for me and found 2 bugs in it

i am having 2 appliances installed and i am using Southeast Asia as a region

  1. applianceNameToSiteIdMapV2 does not work, i changed it to applianceNameToSiteIdMapV3 and its working fine for me.

  2. foreach does not fetch the appliance SiteId though $sites do have appliances listed because we cant get $site,ApplianceName directly as the key itself is appliance name that has to be passed. i don't know how to dynamically fetch the appliance name hence need help to solve this.

    $sites = ConvertFrom-Json $siteresponse.properties.details.extendedDetails.applianceNameToSiteIdMapV3

    $VMwareSiteID = ""

    foreach ($site in $sites) {

     $appliancename = $site.ApplianceName;
     
     if ($Appliance -ne $appliancename) {continue}
    
     $VMwareSiteID =  $site.SiteId
    

    }

Update RUs for collection isn't working

I am using this powershell file ps-sql-ru-update.ps1 to update RUs for a collection. But i am getting error as

Get-AzureRmResource : {"code":"NotFound","message":"Entity with the specified id does not exist in the system.\r\nActivityId: be311457-956f-4d79-aaca-27fde3d16566, Microsoft.Azure.Documents.Common/2.5.1"}

NOTE : The script works fine for updating RUs in Databases.

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.