Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Angel
Resolver III
Resolver III

Powershell - Create datasource using Basic Authentication

Hi, everyone

 

I'm struggling trying to create a datasource in a gateway. Credentials I'm going to use are basic.

 

I think the problem could be how I have created the body. This is the code.

 

 

 

$body =
     @{value =
       @{connectionDetails = @("http://localhost/DynamicsNAV110/OData/")
         datasourceName = @("URL Base ODATA")
         dataSourceType = @("OData")
         credentialDetails = @(
           @{credentialType = "Basic"
             credentials = '{\"credentialData\":[{\"name\":\"username\", \"value\":\"john\"},{\"name\":\"password\", \"value\":\"*****\"}]}'
             encryptedConnection = "Encrypted"
             encryptionAlgorithm = "None"
             privacyLevel = "None"
            }
         )
        }
      }

 

 

 

 

Can anyone help me with this, please???..

 

Thanks,

1 REPLY 1
vpartem
Frequent Visitor

I have the same error. Anyone?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.