Slay
Slay

Reputation: 1283

Encountered a runtime exception when running code

I am trying to interact my web app with azure api. I got this php exception error. Can anyone tell me what is it?

RuntimeException: The provided config value '[http | https]' does not belong to the valid values subset:

This is my code (account key has been deleted):

$conn_string="DefaultEndpointsProtocol=[http | https];AccountName=storage;AccountKey=..."; 

$blobRestProxy = ServicesBuilder::getInstance()->createBlobService($conn_string);

Upvotes: 1

Views: 149

Answers (2)

Ulrich Schmidt-Goertz
Ulrich Schmidt-Goertz

Reputation: 1116

You need to use either http or https, not both.

Upvotes: 0

haim770
haim770

Reputation: 49095

Your Storage Connection String is indeed invalid.

The value [http | https] is just a placeholder you copied from somewhere, it denotes that you have to pick http or https to configure whether you want to connect to your storage data over regular or secure http.

Simply try:

DefaultEndpointsProtocol=https;AccountKey=... etc

And BTW, you're exposing your account key to the public!

Upvotes: 1

Related Questions