Azure portal is recognizing System.Collections.Hashtable as system.string

Ankush Muley 0 Reputation points Microsoft Vendor

Below code is working fine for User A but not working for User B.
Both users are using same function from Microsoft Azure purview without changing code. As code is on portal then all environment and configuration must be same, then why different behavior is experienced by both users.
(Error and code is attached below, please refer)

Error received for user B :

[Error] ERROR: Cannot convert argument "jsonData", with value: ""{\n "name": "Azure",\n "Industry": "IT",\n "DLPPolicy": "Dynamics"\n}"", for ".ctor" to type "System.Collections.Hashtable": "Cannot convert the ""{\n "name": "Azure",\n "Industry": "IT",\n "DLPPolicy": "Dynamics"\n}"" value of type "System.String" to type "System.Collections.Hashtable"." Exception : Type : System.Management.Automation.MethodException ErrorRecord : Exception : Type : System.Management.Automation.ParentContainsErrorRecordException Message : Cannot convert argument "jsonData", with value: ""{\n "name": "Azure",\n "Industry": "IT",\n "DLPPolicy": "Dynamics"\n}"", for ".ctor" to type "System.Collections.Hashtable": "Cannot convert the ""{\n "name": "Azure",\n "Industry": "IT",\n "DLPPolicy": "Dynamics"\n}"" value of type "System.String" to type "System.Collections.Hashtable"." HResult : -2146233087 CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument InvocationInfo : ScriptLineNumber : 16 OffsetInLine : 1 HistoryId : -1 ScriptName : C:\home\site\wwwroot\TestFunction\run.ps1 Line : [DLPModelData] $CreateDLPDataobject = [DLPModelData]::new($jsonData) PositionMessage : At C:\home\site\wwwroot\TestFunction\run.ps1:16 char:1 + [DLPModelData] $CreateDLPDataobject = [DLPModelData]::new($jsonData) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\TestFunction PSCommandPath : C:\home\site\wwwroot\TestFunction\run.ps1 CommandOrigin : Internal ScriptStackTrace : at

Azure Cloud Services
Azure Cloud Services
An Azure platform as a service offer that is used to deploy web and cloud applications.
632 questions
Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
923 questions
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,037 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 43,926 Reputation points

    Hello there,

    This might be due to system configuration differences or the version.

    Also, make sure to check for User B's account status. To check a user’s account status, follow these steps:

    Open the Azure portal and sign in as a Global Administrator.

    Open the Azure Active Directory Extension by selecting All services at the top of the main left-hand navigation menu.

    Type in “Azure Active Directory” in the filter search box and select the Azure Active Directory item.

    Select Users and groups in the navigation menu.

    Select All users.

    Search for the user you are interested in and select the row to select.

    Select Profile.

    Under Settings ensure that Block sign-in is set to No.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments