Giter Site home page Giter Site logo

Comments (6)

sc-draymond avatar sc-draymond commented on July 19, 2024 1

I found that I could not use an object to create the string and had to use a string replacement instead. This is showing to not be an issue with the connection-string set function.

$newConnectionString = $ConnectionStringName + '=''Data Source=tcp:' + $DataSource + ',1433;Initial Catalog=' + $SQLDatabase + ';User Id=' + $UserID + ';Password=' + $Password + ';'''

az webapp config connection-string set --connection-string-type SQLServer --name $AppServiceName --resource-group $AppServiceResourceGroupName --subscription $AppServiceSubscriptionID --settings $newConnectionString

from azure-cli.

yonzhan avatar yonzhan commented on July 19, 2024

Thank you for opening this issue, we will look into it.

from azure-cli.

azure-client-tools-bot-prd avatar azure-client-tools-bot-prd commented on July 19, 2024

Hi @sc-draymond
Find similar issue #11552.

Issue title Error configuration function app with powershell object for --settings
Create time 2019-12-11
Comment number 7

Possible solution:
The error message "not enough values to unpack (expected 2, got 1)" is usually caused by an incorrect format of the input. In the existing issue, the error occurred when configuring application settings using a powershell object. The solution was to use the json format inside the json file and provide the correct path to the file in the --settings parameter.

Similarly, in this new issue, the error occurred when running the command "az webapp config connection-string set". The solution might be to check the format of the input and make sure it matches the expected format. It might also be helpful to check the structure of the json file to ensure it has the correct schema.

To set the connection string, you can try running the command with the --settings parameter and providing the correct path to the json file. The content of the json file should be in the following format:

[
{
"name": "ConnectionString",
"slotSetting": false,
"value": "Data Source=tcp:MyServer.database.windows.net,1433;Initial Catalog=MyDatabase;User Id=MyID;Password=MyPassword;"
}
]

Make sure to replace the values with your own connection string information.


Please confirm if this resolves your issue.

from azure-cli.

microsoft-github-policy-service avatar microsoft-github-policy-service commented on July 19, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI, @antcp.

from azure-cli.

microsoft-github-policy-service avatar microsoft-github-policy-service commented on July 19, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI, @antcp.

from azure-cli.

seligj95 avatar seligj95 commented on July 19, 2024

I'm unable to repro - I copied your input into CloudShell and was able to set the connection strings.

Please ensure the settings parameter is formatted correctly and escape characters are included where needed based on your shell type.

from azure-cli.

Related Issues (20)

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.